Repository navigation
fix(research): an empty or comment-only workflow file no longer crashes diffci plan - #171
Merged
adityankale190895 merged 2 commits intoNov 18, 2026
Conversation
…es diffci plan YAML.parse returns null for such a file, and parseWorkflow read .name from it, so analyzeCheckout threw for the whole repository. Fixes DiffCI#168 Signed-off-by: FredApps <[email protected]>
FredApps
commented
Nov 17, 2026
FredApps
left a comment
Contributor
Author
There was a problem hiding this comment.
Cross-review at 45abb7c.
Checked:
- The non-mapping guard returns an empty task list for empty, comment-only, scalar and list documents, which matches the existing malformed-YAML path.
- The three new tests (two parser cases and the
analyzeCheckoutcase) fail without the guard and pass with it. - Typecheck passes, the branch is up to date with main, and CI is green.
Fixed: nothing needed.
Open: nothing.
…test so it merges cleanly with DiffCI#182 No change to the tests themselves. DiffCI#182 appends its path-filter tests at the end of the same describe block. Signed-off-by: FredApps <[email protected]>
FredApps
marked this pull request as ready for review
November 18, 2026 01:15
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.
Fixes #168
What changed
parseWorkflow(src/research/baseline/workflow-parser.ts) only guarded against a YAML syntax error.YAML.parsereturnsnullfor an empty or comment-only file, and the next line read.namefrom it.analyzeCheckoutparses every workflow, so one empty.github/workflows/*.ymlmadediffci planfail for the whole repository:A document that isn't a mapping (null, a scalar or a list) has no jobs, so it now returns an empty task list, the same way the existing malformed-file case does. No other behavior changes.
Regression tests
tests/research/baseline/workflow-parser.test.tscovers empty, comment-only, scalar and list workflow files. Before the fix, the empty and comment-only cases throw.tests/analyze.test.tsadds "an empty workflow file does not stop the analysis (diffci plan crashes when a workflow file is empty or only comments #168)". Before the fixanalyzeCheckoutrejects. After it, the plan selects the dependent test.Validation
npm run typecheck,npm testandnpm run audit:boundarypass.npx tsx src/cli.ts plan --base HEAD~1) and it now prints a plan.