Repository navigation
Fix invalid YAML in fleetctl new GitHub workflow template - #56479
Conversation
The pull_request_target trigger's branches key was over-indented, so every workflow scaffolded by fleetctl new failed to parse. Add a test that parses every YAML file the command writes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe generated GitHub Actions workflow now indents the Possibly related issues
Priority: ➖ Normal Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #56479 +/- ##
==========================================
- Coverage 77.56% 77.56% -0.01%
==========================================
Files 4377 4377
Lines 272003 272003
Branches 16052 16052
==========================================
- Hits 210971 210968 -3
- Misses 60846 60849 +3
Partials 186 186
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Related issue: #56477
The
pull_request_targettrigger in thefleetctl newGitHub Actions workflow template hadbranches:indented two spaces deeper than its siblingpaths:, so the generated.github/workflows/workflow.ymlisn't valid YAML (did not find expected key while parsing a block mapping) and GitHub rejects it as an invalid workflow. This dedentsbranches:and- mainto match thepush:block. Nothing else in the template changes.The bug came in with #53059 and is also on
rc-minor-fleet-v4.94.0, so this needs a cherry-pick intorc-minor-fleet-v4.94.0before 4.94.0 ships. 4.93.1 isn't affected.Checklist for submitter
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Testing
TestNewBasicFileStructuregets a newgenerates valid YAML filessubtest that walks thefleetctl newoutput and parses every.yml/.yamlfile withgithub.com/ghodss/yaml, the librarynew_test.goalready uses. It fails onmainand passes with the fix:Built
fleetctlfrom this branch and ranfleetctl new --org-name "QA Org". All 11 generated YAML files parse with a second, independent parser (Ruby Psych), andyq '.on.pull_request_target'on the generatedworkflow.ymlreturnsbranches: [main]andpaths: ["**"], matchingpush:. Psych rejects themainversion of the template with the same "did not find expected key" error.For unreleased bug fixes in a release candidate, one of:
AI
AI: Claude Code (claude-opus-5-5)
Frontend
Summary by CodeRabbit
fleetctl newso it uses valid YAML and can be accepted by GitHub. This prevents newly generated workflows from failing due to a YAML parsing error.