Repository navigation
ci: make formatting and spelling advisory on the document-only path - #2012
Conversation
Web-editor contributions are never hard-wrapped, so the focused path failed the very changes it was meant to ease (cncf#2005, repaired in cncf#2008). Record the decision: Markdown uses proseWrap preserve, Prettier and cspell are advisory on the document-only path, markdownlint, contract suites and the build still block, and a format-documents workflow repairs drift on main through a single automation pull request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Implements the ADR 0011 amendment of 2026-10-30. - Markdown and MDX use proseWrap: preserve, so a page edited in the GitHub web editor no longer fails Prettier for unwrapped prose. Two front-matter and reference-definition lines reflow as a result. - runDocumentLint runs Prettier and cspell as advisory checks: their findings become workflow annotations on the changed lines and a step summary with the one-line fix, and never fail the check. markdownlint still blocks. A tool that fails without naming a document is still reported rather than treated as clean. - A new "Format documents" workflow runs on every push to main that touches an authored document, weekly, and on dispatch; it formats the authored document paths with the repository configuration and opens or refreshes one "chore: format documents" pull request through the open-automation-pr action. - CONTRIBUTING, AGENTS.md and the markdownlint note describe the split. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
✅ Deploy Preview for endusers ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2f7e62c
ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @mrbobbytables, head
Hive did not add the |
|
The red Validate repository and Mutation testing checks share a single root cause, and it is in this PR's diff (reproduced locally at 2f7e62c).
// scripts/lib/content-only-ci.mjs:335
summaryPath = process.env.GITHUB_STEP_SUMMARY,The new test passes Reproduction: The Mutation testing job fails in its initial (unmutated) dry run on the same test for the same reason — same runner environment, same env var. Verified fix — isolate the variable inside the test: -test('keeps an advisory tool failure visible when it names no document', () => {
+test('keeps an advisory tool failure visible when it names no document', (t) => {
+ const savedSummary = process.env.GITHUB_STEP_SUMMARY;
+ delete process.env.GITHUB_STEP_SUMMARY;
+ t.after(() => {
+ if (savedSummary === undefined) {
+ delete process.env.GITHUB_STEP_SUMMARY;
+ } else {
+ process.env.GITHUB_STEP_SUMMARY = savedSummary;
+ }
+ });
const { result, logged, summaries } = quietLint(With that change the suite passes with and without (Fork PR, so I can't push this — posting the diagnosis for you to apply.) 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.88 |
There was a problem hiding this comment.
Both red checks ("Validate repository" and "Mutation testing") are one test-isolation bug, and it only reproduces inside GitHub Actions — which is why local validation in the PR body showed everything green.
Mechanism (verified by reading the code and reproducing the destructuring semantics):
scripts/lib/content-only-ci.mjs:335—runDocumentLintdestructuressummaryPath = process.env.GITHUB_STEP_SUMMARYas a parameter default.tests/content-only-ci.test.mjs:417— thequietLinthelper passessummaryPath: undefined, intending to disable the summary. But a destructuring default applies precisely when the value isundefined, so this does not override it: on an Actions runner, whereGITHUB_STEP_SUMMARYis always set,summaryPathsilently becomes the runner's real step-summary path.tests/content-only-ci.test.mjs:619— "keeps an advisory tool failure visible when it names no document" produces a cspell finding and then assertsassert.deepEqual(summaries, []). In CI the finding is appended (via the stubbedappendSummary, sosummariesgains an entry whosepathis/home/runner/work/_temp/_runner_file_commands/step_summary_…) and the assertion fails. That is exactly the failure in the job log.- The Stryker job fails for the same reason at its initial dry run:
ConfigError: There were failed tests in the initial test run.No mutant survived; the 100% local score is not contradicted.
Fix: in quietLint, pass summaryPath: null instead of undefined (defaults do not apply to null), or delete process.env.GITHUB_STEP_SUMMARY in the test setup. One line either way.
Everything else I checked holds up: format-documents.yml uses the same permissions: contents: write / pull-requests: write + open-automation-pr + branch-serialised concurrency pattern as the five existing refresh/audit workflows; checkout uses persist-credentials: false; the advisory path keeps markdownlint, the contract suites and the production build blocking, and a tool that exits non-zero without naming a document is still surfaced as a finding (that is the very test that caught this). The gating relaxation itself is recorded as an ADR 0011 amendment in the first commit.
@mrbobbytables — one-line test fix and a re-push should turn everything green.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
Passing undefined selected the default, so on a runner with GITHUB_STEP_SUMMARY set the test wrote a real summary and failed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
c3b2eff
ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @mrbobbytables, head
Hive did not add the |
Remit: a contributor editing a page in the GitHub web editor cannot merge a document-only PR today without a maintainer repairing it, because the focused lint path fails Prettier on every unwrapped line (
proseWrap: always) and cspell on any new proper noun; #2005 needed a force-merge and #2008 to land a User Group page.Implements an amendment to ADR 0011, recorded in the first commit.
What changed
*.md/*.mdxuseproseWrap: preserve. Wrapped and unwrapped prose are both accepted; lists, emphasis, tables and blockquote continuation are still normalized. Code files are unchanged. Two existing files reflow (a front-matter string and some reference definitions)..markdownlint.yaml's comment now matches reality.scripts/lib/content-only-ci.mjs): Prettier and cspell are advisory. Their output is parsed into::warning file=...,line=...,col=...annotations on the changed lines plus a step-summary block naming the fix (npm run fix:format/cspell:ignorecomment); they no longer fail "Lint repository" on the document-only path. markdownlint, the document-contract suites and the production build still block. An advisory tool that exits non-zero without naming a document is reported, not treated as clean. The full path is untouched.format-documents.yml: on every push tomaintouchingdocs/,blog/,adr/or a root document, weekly, and on dispatch, runs the newnpm run fix:format:documentsand opens or refreshes a singlechore: format documentsPR throughopen-automation-pr(branchautomation/format-documents, same concurrency pattern as the refresh workflows). Registered in the ordering and concurrency contracts.Validation
npm run test:unit:coverage:check: 3797 pass, source 100% lines/regions.npm run test:mutation -- --mutate scripts/lib/content-only-ci.mjs: 100%.check:format,check:spelling,check:lint,check:unused,check:duplication(YAML clones unchanged at 37/37): clean.npm run build: success.Not in scope
The focused path's suite list is extended separately in #2010; the two touch different parts of the repository and do not conflict.