Skip to content

[CI Failure Doctor] CI Failure Doctor: CLI flag + action pin test drift on run 37905 #18457

@github-actions

Description

@github-actions

CI Failure Investigation - Run #37905

Summary

  • The test job on main is failing because a CLI unit test expects a --verbose flag and a workflow unit test asserts a hard-coded action pin count that no longer matches the embedded data.
  • These regressions cause the test job to exit with code 1 and block the pipeline for commit caf3a0a8ecb44034ddc12a786d2ace02853b3646.

Failure Details

Root Cause Analysis

  • NewPRTransferSubcommand already calls cmd.Flags().GetBool("verbose") and logs verbose messages, but the command never registers a --verbose flag, so TestNewPRTransferSubcommand fails with Expected --verbose flag to exist when it looks up the flag.
  • TestGetActionPinsSorting still asserts that getActionPins() returns 37 entries while pkg/workflow/data/action_pins.json currently contains 39 pins, so the hard-coded length mismatch fails immediately whenever new pins are added.

Failed Jobs and Errors

  • testTestNewPRTransferSubcommand (pr_command_test.go:187): Expected --verbose flag to exist
  • testTestGetActionPinsSorting (action_pins_test.go:302): getActionPins() returned 39 pins, expected 37
Investigation Findings
  • Running go test ./pkg/cli -run TestNewPRTransferSubcommand reproduces the missing flag because the CLI command reads --verbose without registering it, so the lookup in the test returns nil.
  • Running go test ./pkg/workflow -run TestGetActionPinsSorting reproduces the pin count mismatch; the embedded JSON has 39 entries in Feb 2026, so the count assertion needs to be updated or derived from the file to stay in sync.

Recommended Actions

  • Register the --verbose flag on pr transfer (matching the transferPR code path) so TestNewPRTransferSubcommand can find it and the CLI tests pass again.
  • Update TestGetActionPinsSorting (or prune action_pins.json) so the assertion reflects the current number of pins—ideally deriving the expected count from the JSON during test setup to avoid brittle constants.

Prevention Strategies

Add tooling or guardrails that flag stale test expectations when CLI arguments or embedded datasets change (e.g., derive expected flag lists/pin counts from the code or data instead of hard-coded numbers).

AI Team Self-Improvement

When adding CLI flags or updating pinned action data, immediately refresh the corresponding tests or add assertions that derive their expectations from the sources of truth so regressions are caught before landing.

Historical Context
  • No existing [CI Failure Doctor] issue documents this specific failure, so this is a new regression introduced on caf3a0a.

🩺 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, 6:34 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Labels

    cookieIssue Monster Loves Cookies!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions