Repository navigation
fix(ci): accept a commented jobs: line in the Bun crash census workflow parser - #503
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small follow-ups to #489 in
workflowJobBunVersion(scripts/ci-bun-crash-census.ts).Root cause
jobs:line. The parser found the jobs section withline.trimEnd() === "jobs:". A valid workflow whosejobs:line has a trailing YAML comment (jobs: # all jobs) therefore had no jobs, and every job read as having no Bun version.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:orbun-versionpatterns (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
/\s+#.*$/) before matchingjobs:. A#with no space before it (jobs:#) is not a YAML comment and still does not match.Tests
a trailing comment on the jobs: line still opens the jobs (HACK-1462). It coversjobs: # all jobswith a whitespace-only line inside the job, plus thejobs:#negative case.blank and column-0 comment lines inside jobs: do not end the job scanalready 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:jobs:with plaintrimEnd()(pre-fix)\s*#(no whitespace needed)jobs:#caseci.ymltestGates: root
bun run check(includesprivacy:check) passes with exit 0.bun run --cwd packages/cli typecheckhas 0 errors. Biome reports no issues on both changed files. gitleaks 8.30.1 found no leaks inorigin/next..HEAD. The CLI surface and agent guidance did not change, so neither needs regeneration. For the full suite, see hosted CItestat this head.Gaps
test: # note) andname: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
Need help on this PR? Tag
@codesmith-botwith what you need.