-
Notifications
You must be signed in to change notification settings - Fork 295
Closed as not planned
Labels
cookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!
Description
Summary
The test job and the Integration: CLI Update Command job both fail on main at commit 78ecf47823d96945c35bf6868cea2cc31dbd8e2c. The unit failures stem from tests that assume legacy behavior: the PR transfer subcommand test insists on a local --verbose flag and the action pin sorting test checks for exactly 37 entries, while the integration test still expects gh aw update to error when no workflows have a source field despite the new graceful-path behavior.
Failure Details
- Run: 22426018746
- Commit: 78ecf47
- Trigger: push
Root Cause Analysis
TestNewPRTransferSubcommandcallscmd.Flags().Lookup("verbose"), but the transfer subcommand does not register a local--verboseflag—the flag comes from the root command (cmd/gh-aw/main.gosets a persistent--verbose/-v). The inherited flag is therefore not visible throughcmd.Flags().Lookup, so the test fails atpr_command_test.go:187with "Expected --verbose flag to exist".TestGetActionPinsSortingexpectsgetActionPins()to return 37 entries, butpkg/workflow/data/action_pins.jsonnow contains 38 pins (the embedded JSON is being marshaled once ingetActionPins()), so the length assertion fails with "getActionPins() returned 38 pins, expected 37".TestUpdateCommand_NoMergeFlagasserts thatgh aw update --no-merge --verboseshould error when no workflows contain asourcefield, butUpdateWorkflowsnow prints an info message and returnsnilwhen the scan yields zero workflows (seepkg/cli/update_workflows.golines 31‑39). The integration test therefore reportsAn error is expected but got nileven though the behavior change is intentional.
Failed Jobs and Errors
test: Fails becausepr_command_test.go:187cannot find a local--verboseflag, andaction_pins_test.go:302sees 38 pins instead of 37 (the embedded data has grown). The earlier failure message waspr_command_test.go:187: Expected --verbose flag to exist, and the later message wasaction_pins_test.go:302: getActionPins() returned 38 pins, expected 37.Integration: CLI Update Command:TestUpdateCommand_NoMergeFlagfails withError: An error is expected but got nil.and the command outputℹ no workflows found with source field, because the code now exits gracefully when there are no source workflows.
Investigation Findings
- The root persistent
--verboseflag defined incmd/gh-aw/main.gois inherited by thepr transfersubcommand, but the unit test only looks atcmd.Flags(), so it misses the inherited flag. The test should either register its own verbose flag or inspect inherited flags. getActionPinsunmarshals the embedded JSON frompkg/workflow/data/action_pins.jsonand sorts all entries; the file currently lists 38 entries, so a hard-coded expectation of 37 inTestGetActionPinsSortingis obsolete.UpdateWorkflowsnow bails out with a success return value when no workflows with asourcefield are found, printingno workflows found with source field.TestUpdateCommand_NoMergeFlagshould assert that the command succeeds (and optionally check for the info message) rather than expecting a failure.
Recommended Actions
- Update
TestNewPRTransferSubcommandto look for the inherited--verboseflag (e.g., viacmd.InheritedFlags()orcmd.PersistentFlags()) or register the flag locally so the lookup succeeds. - Relax
TestGetActionPinsSortingso it does not depend on a rigid count of 37 entries—either bump the expected count to 38 when new pins are added or assert on sorted order/field validity instead. - Refresh
TestUpdateCommand_NoMergeFlagto reflect the new graceful path when no workflows have asourcefield; it should assert that the command exits cleanly and prints the expected info message rather than failing.
Prevention Strategies
Keep CLI tests aligned with how flags are registered (local vs. inherited) and avoid hard-coded counts derived from embedded data files so they don't break whenever the data set changes.
AI Team Self-Improvement
- When testing CLI flag availability, check inherited flags or confirm the command registers the flag locally before asserting.
- Prefer assertions about the shape/sorting of data-driven lists rather than exact sizes that will break whenever the data set changes.
- When regression fixes adjust exit paths (e.g., returning success instead of failure), update the corresponding integration tests to assert on the new success path instead of expecting the old failure.
Historical Context
- Search
repo:github/gh-aw label:cookie "[CI Failure Doctor]" "Run #37890"returned no results, so this failure is not already tracked.
🩺 Diagnosis provided by CI Failure Doctor
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/ci-doctor.md@ea350161ad5dcc9624cf510f134c6a9e39a6f94d
- expires on Feb 27, 2026, 3:17 AM UTC
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!