fix(pr-docs-check): remove duplicate aspire.dev checkout that broke create_pull_request branch pinning - #18320
Conversation
…reate_pull_request branch pinning The pr-docs-check agentic workflow failed on run 27765082872 (source PR microsoft#18312) when the create_pull_request safe-output could not pin the docs branch before generating its bundle: Failed to pin branch 'docs/aspire-18312-chart-calculator-refactor' before bundle generation: ERR_SYSTEM: fatal: Needed a single revision Root cause: the agent-job checked out microsoft/aspire.dev twice -- once as the current workspace (path "") where the agent authors docs and creates the docs branch, and once as a mirror at _repos/aspire.dev. gh-aw builds a checkout manifest keyed by the lowercased repo slug with last-wins semantics (build_checkout_manifest.cjs), so the mirror entry shadowed the workspace entry. create_pull_request's findRepoCheckout("microsoft/aspire.dev") then resolved to the mirror, and the pin step ran git -C _repos/aspire.dev rev-parse --verify refs/heads/<branch>^{commit} against the mirror, where the branch never existed -> "Needed a single revision". The resolver and base-branch selection were NOT at fault: it emitted effective_target_branch=release/13.5 (resolution=exact_match), that branch exists on aspire.dev, and the agent used it correctly. The only defect was the duplicate checkout shadowing the workspace. Fix: drop the redundant _repos/aspire.dev mirror from the agent-job checkout block so a single microsoft/aspire.dev -> path="" entry resolves to the workspace where the docs branch is created. The safe-outputs job keeps its own independent _repos/aspire.dev checkout for bundle apply, so that path is unaffected. Regenerated the lock file (gh aw compile, v0.79.8, clean). Fixes microsoft#18319 Refs microsoft#18223 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18320Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18320" |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the pr-docs-check agentic workflow where create_pull_request failed with fatal: Needed a single revision because microsoft/aspire.dev was checked out twice in the agent job — once as the workspace and once as a mirror under _repos/aspire.dev. The gh-aw checkout manifest uses last-wins semantics keyed by lowercased repo slug, so the mirror entry shadowed the workspace entry, causing the branch-pin step to look for the docs branch in the mirror (where it didn't exist).
Changes:
- Removed the redundant
_repos/aspire.devmirror checkout (and its app-token generation step) from the agent job'scheckout:block, leaving a singlemicrosoft/aspire.dev → path=""workspace entry. - Updated the inline comment to document why a second
microsoft/aspire.devcheckout must not be added to this block, and updated the agent prompt note to reflect the single-checkout setup. - Regenerated the lock file (
gh aw compile), reflecting the removal of the duplicate checkout steps and manifest count change from 2 to 1.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/pr-docs-check.md |
Removed the duplicate microsoft/aspire.dev mirror checkout from the agent job, added a detailed explanatory comment about the last-wins manifest behavior, and updated the agent prompt note. |
.github/workflows/pr-docs-check.lock.yml |
Auto-regenerated lock file reflecting the removal: updated metadata hashes, removed the second checkout + app-token steps, reduced GH_AW_CHECKOUT_MANIFEST_COUNT from "2" to "1", and dropped the mirror from the checkouts prompt. |
PR Testing Report — CI Infrastructure ValidationPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed (2 files, +32 / -50)
Change Categories
CI Infrastructure ValidationWhat runs on this PR
Automated tests
Static validation performed (all ✅)
Results validation (root cause confirmed against primary source)
Failure-modes §6 (gh-aw) scan — all pass
Manual / live triggers
Summary
Overall Result✅ PR VERIFIED (static + recompile + source-confirmed). The fix is correct, minimal, and well-scoped. The generated lock is in sync, no triggers/permissions/gating changed, the
Recommendations
|
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
I thought there was a limitation that I seem to remember with the gh aw that required the dual checkout. I guess, we can try this to see if it works now.
What broke
The
pr-docs-checkagentic workflow failed on run 27765082872 (source PR #18312, milestone 13.5). Everycreate_pull_requestattempt died at the branch-pin step:No docs PR was opened on
microsoft/aspire.dev.Root cause
Not the base-branch / milestone resolution — that part was correct. The resolver emitted
effective_target_branch=release/13.5(resolution=exact_match),release/13.5exists onaspire.dev, and the agent based the docs branch on it correctly.The real defect is a duplicate checkout. The agent job checked out
microsoft/aspire.devtwice:path: "") — where the agent authors docs and creates the docs branch, and_repos/aspire.dev.gh-aw builds a checkout manifest keyed by the lowercased repo slug with last-wins semantics (
build_checkout_manifest.cjs). The mirror entry shadowed the workspace entry, socreate_pull_request'sfindRepoCheckout("microsoft/aspire.dev")resolved to the mirror. The pin step then ran:against the mirror, where the docs branch never existed →
fatal: Needed a single revision.(The agent's own logged hypothesis — a git remote-URL mismatch — is a red herring:
findRepoCheckoutconsults the manifest first and only falls back to a git scan, so the duplicate-slug shadowing is the operative bug.)The fix
Remove the redundant
_repos/aspire.devmirror from the agent-jobcheckout:block, leaving a singlemicrosoft/aspire.dev -> path: ""entry that resolves to the workspace where the docs branch is actually created.The mirror was unnecessary: the manifest already maps the current workspace for the slug, so the handler can rediscover the target repo without it.
Call-outs
_repos/aspire.devcheckout for bundle apply — that's a different job and is left untouched.gh aw compile(v0.79.8,0 error(s), 0 warning(s)); the only.lock.ymlchanges are dropping the second checkout/app-token steps andGH_AW_CHECKOUT_MANIFEST_COUNT: 2 -> 1.actions-lock.jsonis unchanged.Fixes #18319
Refs #18223