Target aspire.dev release branch by milestone in pr-docs-check workflow#16268
Target aspire.dev release branch by milestone in pr-docs-check workflow#16268IEvangelist wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Resolve the draft PR target branch on microsoft/aspire.dev using the source PR milestone (or linked-issue milestone / release base branch), normalized via regex to release/X.Y[.Z]. Create the release branch from aspire.dev main if it does not yet exist. Fall back to main when no milestone can be resolved. Preserves the existing ASPIRE_BOT app-token flow; the only YAML change is simplifying the safe-outputs mirror checkout ref to main (the dynamic base is passed via the create_pull_request safe output). 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 -- 16268Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16268" |
There was a problem hiding this comment.
Pull request overview
Updates the pr-docs-check agentic workflow so docs PRs created in microsoft/aspire.dev can be targeted at the appropriate release branch (derived from milestones / linked issues / PR base), rather than always defaulting to main.
Changes:
- Expanded the workflow prompt to resolve a target
aspire.devbase branch using milestone/issue/base-branch heuristics and (if needed) create the branch onaspire.dev. - Simplified the safe-outputs mirror checkout to seed from
aspire.devmain. - Regenerated the compiled workflow lockfile and refreshed action pins (
gh-awv0.68.3, updated container images, etc.).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/pr-docs-check.md | Updates the agent prompt and changes the mirror checkout ref to main. |
| .github/workflows/pr-docs-check.lock.yml | Regenerated compiled workflow with updated pins and the new mirror checkout ref: main. |
| .github/aw/actions-lock.json | Updates the locked github/gh-aw-actions/setup version to v0.68.3. |
| # Seed the mirrored workspace at aspire.dev's default branch. The | ||
| # actual base branch for the draft PR is resolved by the agent (from | ||
| # milestone/linked-issue/source base) and passed to the | ||
| # create_pull_request safe output via its `base` field; the | ||
| # safe-outputs tool handles branching from that base. | ||
| ref: main |
There was a problem hiding this comment.
The prompt instructs the agent to set a base field on the create_pull_request safe output, but the compiled safe-outputs schema in pr-docs-check.lock.yml only supports fields like branch, title, and body (no base). This will likely cause the agent output to be rejected/ignored and the PR will still target whatever default base the handler uses. Update the workflow/tooling so create_pull_request supports a base input, or change the approach to select the base branch via a supported mechanism (e.g., checkout the desired base in the safe-outputs job before PR creation).
Per PR review feedback: the agent-side create_pull_request schema does not accept a `base` field, so the agent cannot set the docs PR base dynamically from the source PR milestone. Instead, target the aspire.dev branch that matches the source aspire PR's base branch (github.base_ref) via the supported workflow-level `base-branch` config. A PR merged into aspire release/X.Y now produces a docs PR against release/X.Y on aspire.dev; a PR merged into main targets main. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for the sharp review — both reviewer threads were correct. Confirmed by reading gh-aw source ( Pushed an update (e7e639b) that pivots to the supported mechanism:
One remaining limitation this approach doesn't cover: an aspire PR merged to |
|
Closing this PR without merging. After working through the reviewer feedback, we confirmed the approach here can't actually deliver what we originally set out to do: target the aspire.dev docs PR based on the source aspire PR's milestone (e.g., milestone The current gh-aw
Filed a feature request upstream capturing the use case, the limitation, and a few possible designs: github/gh-aw#26908. Will revisit once that lands (or with a post-handler retarget workaround if the upstream issue stalls). Closing for now to keep the review queue clean. |
Description
Updates the
pr-docs-checkagentic workflow so draft PRs opened onmicrosoft/aspire.devtarget the correct release branch instead of always defaulting tomain.Motivation
microsoft/aspireships versioned releases, whilemicrosoft/aspire.dev'smaintracks the latest build bits. Today the workflow always opens docs PRs againstaspire.devmain, which is usually wrong for changes associated with a shipped/servicing release.What changed
The agent prompt now resolves a target branch on
microsoft/aspire.devusing this priority order, stopping at the first match:Closes/Fixes/Resolves #Nin the PR bodyrelease/X.Yorrelease/X.Y.ZmainMilestone titles are normalized with the regex
^v?(\d+)\.(\d+)(?:\.(\d+))?, so:13.3,13.3 - Preview 1,v13.3→release/13.313.2.1,v13.2.1→release/13.2.1If the resolved
release/X.Y[.Z]branch does not yet exist onmicrosoft/aspire.dev, the agent creates it from the current tip ofmainonaspire.devvia the Git refs API (using the sameASPIRE_BOTapp-token flow already wired up). The resolved branch is then passed to thecreate_pull_requestsafe output via itsbasefield, and surfaced in both the draft PR description and the follow-up comment on the source PR.Scope constraints honored
The GH App token flow (
ASPIRE_BOT_APP_ID/ASPIRE_BOT_PRIVATE_KEY) is org-required and non-trivial to configure, so this change is deliberately minimal on the YAML side:github-app:blocks (top-levelcheckout:× 2,tools.github,safe-outputs),permissions,tools,network, and the "Configure mirrored target repo Git credentials" step.safe-outputs.steps→ "Mirror target repo checkout" →ref:simplified from the source-PR-base expression (which previously resolved to the sourceaspirePR's base, unrelated toaspire.dev's branch structure) tomain. The dynamic base branch is now communicated through the safe output'sbasefield.All remaining edits are in the Markdown prompt body: new Step 2 ("Determine Target Branch"), new Step 3 ("Ensure the Target Branch Exists"), subsequent steps renumbered, and the draft PR/source PR comment instructions updated to include the resolved base branch.
Validation
gh aw compile pr-docs-check→ 0 errors, 0 warnings.ref: mainand app-token configuration is preserved.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: