Skip to content

fix(ci): accept a commented jobs: line in the Bun crash census workflow parser - #503

Merged
roodboi merged 1 commit into
nextfrom
wf/g110-census-parser-nits
Oct 24, 2026
Merged

roodboi merged 1 commit into
nextfrom
wf/g110-census-parser-nits

Conversation

@roodboi

@roodboi roodboi commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two small follow-ups to #489 in workflowJobBunVersion (scripts/ci-bun-crash-census.ts).

Root cause

  1. Commented jobs: line. The parser found the jobs section with line.trimEnd() === "jobs:". A valid workflow whose jobs: line has a trailing YAML comment (jobs: # all jobs) therefore had no jobs, and every job read as having no Bun version.
  2. Dead blank-line clause. The job scan skipped lines with line.trim() === "" || line.startsWith("#"). Removing the blank-line half changed no result: a blank or whitespace-only line has no non-space first character (so it does not end the jobs) and matches none of the job-key, name: or bun-version patterns (so it does not change a block). No test can fail without it, so the JSDoc claim that blank lines are "skipped" described code that did nothing.

Fix

  • Strip a whitespace-led trailing comment (/\s+#.*$/) before matching jobs:. A # with no space before it (jobs:#) is not a YAML comment and still does not match.
  • Remove the redundant blank-line clause and correct the JSDoc to say why blank lines need no skip.

Tests

  • New: a trailing comment on the jobs: line still opens the jobs (HACK-1462). It covers jobs: # all jobs with a whitespace-only line inside the job, plus the jobs:# negative case.
  • Existing: blank and column-0 comment lines inside jobs: do not end the job scan already has blank lines between jobs and still holds the documented behavior.

Evidence

Focused suite tests/ci-bun-crash-census.test.ts: 20 pass, 0 fail. Mutation results:

Mutation Result
M1: match jobs: with plain trimEnd() (pre-fix) new test fails (19 pass, 1 fail)
M2: comment regex \s*# (no whitespace needed) new test fails on the jobs:# case
M3: a blank line ends the jobs scan 4 tests fail, including the blank-line test and the real ci.yml test
M4: put back the removed blank-line clause 20 pass: the clause makes no difference to behavior

Gates: root bun run check (includes privacy:check) passes with exit 0. bun run --cwd packages/cli typecheck has 0 errors. Biome reports no issues on both changed files. gitleaks 8.30.1 found no leaks in origin/next..HEAD. The CLI surface and agent guidance did not change, so neither needs regeneration. For the full suite, see hosted CI test at this head.

Gaps

  • Job-key lines ( test: # note) and name: lines with trailing comments are still not handled. They are outside this unit's scope and are reported separately.

Refs HACK-1462

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…ow parser

workflowJobBunVersion matched the jobs: line with trimEnd() === "jobs:", so
a workflow whose jobs: line carried a trailing YAML comment (jobs: # all
jobs) had no jobs and every job read as having no Bun version. Strip a
whitespace-led trailing comment before matching.

The blank-line clause in the job scan was dead code: a blank line starts
with no non-space character and matches no job key, name: or bun-version
pattern, so removing the clause changed no result. Remove it and correct
the JSDoc, which claimed blank lines were skipped.

Refs HACK-1462

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Oct 24, 2026

Copy link
Copy Markdown

HACK-1462

@roodboi
roodboi marked this pull request as ready for review October 24, 2026 23:12
@roodboi
roodboi merged commit fc6ef17 into next Oct 24, 2026
21 checks passed
@roodboi
roodboi deleted the wf/g110-census-parser-nits branch October 24, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant