Skip to content

fix(ci): skip agent inventory when checkout predates script - #2955

Open
groupthinking wants to merge 1 commit into
mainfrom
fix/copilot-setup-inventory-guard
Open

groupthinking wants to merge 1 commit into
mainfrom
fix/copilot-setup-inventory-guard

Conversation

@groupthinking

@groupthinking groupthinking commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

Canonical issue

Closes #2954

Outcome

Copilot code review and cloud-agent setup no longer fail on branches cut before #2935. The failing job (https://github.com/groupthinking/EventRelay/actions/runs/47127476642/job/144327758349, PR #2938) exited 2 because scripts/ci/agent_inventory.py was absent. Copilot runs copilot-setup-steps.yml from the default branch while checking out the PR head SHA.

Scope

  • Included: the Inventory active agents and automations step runs the script when present. When the script is absent, the step emits a ::warning:: and writes a placeholder agent-inventory.md so Expose inventory to the agent still succeeds. New regression tests in tests/unit/test_agent_inventory.py execute the real workflow step scripts under bash -e -o pipefail, as the Copilot runner does.
  • Explicitly excluded: changes to agent_inventory.py itself; rebasing feat(web): add YouTube-to-agent-tasks and UVAI vs YouExtractor pages #2938 or other stale branches.

Risk

  • Risk level: low
  • Failure mode: older branches get a placeholder inventory instead of live data, flagged by a warning annotation. A present-but-failing script still fails setup (covered by a test).
  • Rollback: revert this commit.

Verification

Head: c41d2b7e9

  • Focused tests: pytest tests/unit/test_agent_inventory.py tests/unit/test_workflow_pr_gate_coverage.py -o addopts="" --strict-markers --strict-config passed with 41 tests.
  • Red/green: against the original workflow, test_setup_steps_tolerate_checkout_that_predates_inventory_script failed with the CI error (python: can't open file ... [Errno 2], exit 2). It passes with the fix.
  • ruff check tests/unit/test_agent_inventory.py scripts/ci/ passed with no issues.
  • actionlint .github/workflows/copilot-setup-steps.yml passed with no issues.
  • Required CI: copilot-setup-steps passes on this PR, and all 5 test_agent_inventory.py tests pass in CI. test (Python 3.11/3.12) fails on 2 pre-existing tests (test_dependency_review_workflow, test_node_engines_floor[apps/web]). Those same 2 tests fail on main at base d71fb6c9f (run 47286474955) and are unrelated to this change.
  • Review threads resolved

Production evidence

Not applicable. This changes CI and Copilot setup only; nothing is deployed.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

Copilot runs copilot-setup-steps.yml from the default branch but checks
out the task's head SHA. Branches cut before #2935 lack
scripts/ci/agent_inventory.py, so the inventory step exited 2 and failed
Copilot code review setup (e.g. #2938). Skip with a warning and write a
placeholder inventory when the script is absent; a present-but-failing
script still fails setup.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot AI max review requested due to automatic review settings December 4, 2026 17:32
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Dec 4, 2026 5:33pm UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The fallback leaves .agent-inventory.md unignored on older branches, risking accidental commits and subsequent inventory runs modifying a tracked file.

1 open issue
What changed in this PR

Updates UVAI’s Copilot setup to tolerate checkouts that predate the agent-inventory script, addressing #2954.

Changes:

  • Adds a warning and placeholder inventory when the script is absent.
  • Adds regression tests for missing scripts and present-but-failing scripts.
File Description
tests/​unit/​test_agent_inventory.py Exercises workflow shell steps for both compatibility cases.
.github/​workflows/​copilot-setup-steps.yml Adds the missing-script fallback while preserving execution failures.

Review effort: Max

"# Agent inventory (check before starting work)" \
"" \
"_Unavailable: this checkout predates scripts/ci/agent_inventory.py._" \
> "$RUNNER_TEMP/agent-inventory.md"

This branch was successfully deployed

1 active deployment
Preview — c41d2b7e Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copilot setup steps fail on branches that predate scripts/ci/agent_inventory.py

3 participants