Repository navigation
[aw] Run action-pin refresh in trusted pre-agent setup - #39333
Conversation
Move lock-pinned gh-aw provisioning and action refresh into trusted pre-agent setup, preserving bot PR deduplication and the lockfile-only publication boundary. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39333Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39333" |
There was a problem hiding this comment.
🟡 Changes recommended
The pinned CLI treats action-lock update errors as nonfatal, allowing setup to report success after the intended refresh fails.
1 open finding
What changed in this PR
Moves action-pin refresh into trusted pre-agent setup, avoiding inference-time extension installation.
Changes:
- Installs and verifies the lock-pinned
gh-awin isolated CLI state. - Runs the refresh before inference and passes its result to the agent.
- Regenerates the compiled workflow lock.
| File | Description |
|---|---|
.github/workflows/aw-actions-update.md |
Adds trusted refresh setup and updates agent instructions. |
.github/workflows/aw-actions-update.lock.yml |
Regenerates the compiled workflow. |
🧠 Review effort: Balanced
|
Automatic Pester CI reports 2541 passed and 3 failed. All three failures are pre-existing stale model assertions: CopilotPipeline.Tests.ps1:70 and Review-PR.Tests.ps1:328 expect the local reviewer to be gpt-5.6-sol, while trusted base 4342761 already pins gpt-6-astra in Review-Tests.ps1:592; Review-Tests.Tests.ps1:85 expects hosted gpt-5.6-sol, while that base already pins gpt-6.1-sol in copilot-review-tests.md. The scripts/tests and model fields are unchanged by these fixes. Both independent fix PRs fail exactly the same assertions. These are not a green-CI or merge-readiness claim, and no pipeline tests or models were changed to bypass the gate. The configuration/security validation described in the PR remains separate from this baseline failure. |
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review
As an independent reviewer, I reviewed the two changed workflow files at exact head 910a43a74083145f10dd741fe205ae7b8dcea40b, including the generated execution order and the pinned gh-aw v0.86.2 producer contracts. Two additional findings survived adversarial adjudication.
1. ❌ Logic - The correct installed version fails the new trusted-host gate
Location: .github/workflows/aw-actions-update.md:101-105.
installed="$(gh aw --version)" captures stdout, but the pinned CLI emits its version on stderr: v0.86.2 sets the root command's output to os.Stderr and installs the version template, and Cobra's --version branch writes through that output. When no existing action-pin PR causes an early skip and installation succeeds, installed is empty even for the correct version. Setup exits 1 before the refresh or inference can run.
The old prompt also had a stream mismatch, but this change turns its graceful no-op into a deterministic host-job failure. Capture stderr while preserving the command's exit status, validate the exact expected version line rather than an arbitrary substring, and regenerate the lock. A synthetic probe using the exact committed gate and the pinned stderr-only output reproduced the mismatch.
Consensus: 3/3 reviewers after dispute.
2. ⚠️ Error Handling - Moving the network calls loses their 15-minute execution bound
Location: .github/workflows/aw-actions-update.md:71-78.
The new refresh step has no step timeout, and the generated agent job has no job timeout. The existing timeout-minutes: 15 applies only to the later Copilot execution step. The initial gh pr list is reachable before deduplication and the failing version gate; if its HTTP request stalls awaiting a response, it can now hold the runner and the non-cancelling workflow concurrency slot until GitHub's default 360-minute job limit instead of the former 15-minute bound. The CLI's HTTP-client construction leaves the request timeout unset; go-gh documents that default as no timeout.
Add an explicit timeout, such as timeout-minutes: 15, to the pre-agent refresh step and regenerate the lock. This finding does not depend on gh aw update being reachable before finding 1 is fixed.
Consensus: 2/3 reviewers after dispute; the third supplied partial agreement, which was not counted.
Prior review: The existing CCR thread about nonfatal action-update errors remains open. I have not duplicated that request or changed its resolution state.
Coverage and limits: Three independent reviewers with adversarial consensus checked the authoritative diff, surrounding workflow/import behavior, credential scope, isolated CLI state, report handoff, deduplication, and the exclusive safe-output file allowlist. Focused synthetic shell probes exercised metadata parsing and the version gate; no hosted workflow, networked refresh, or compiler regeneration was executed. No regression tests accompany these changes; a focused setup harness should cover correct-version stderr output, wrong versions/nonzero exits, and the emitted refresh-step timeout. The title accurately describes the relocation; the checks above show why the new execution path still needs correction.
Scope: code review only. CI/check status and merge readiness were not evaluated; use the repository's CI-analysis workflow for that assessment.
Bound trusted setup to 15 minutes, capture the pinned CLI stderr version, and fail on its nonfatal action-lock warning before reporting success. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Addressed the two actionable findings in review 5491607493 in commit 752abf2. Version verification now captures combined output (including the pinned stderr version line), preserves nonzero failure, and requires exact equality rather than a substring. Trusted setup declares a 15-minute step timeout; because v0.86.2 omits that field from the generated lock, the emitted shell additionally wraps the entire dedup/install/update sequence in GNU timeout with a 15-minute limit and 30-second kill grace. I also fixed the separate nonfatal action-lock warning thread and resolved it. Strict compilation and shellcheck passed with zero warnings; actionlint has only the four unchanged baseline findings. Seven credential-free one-off offline probes using the emitted setup and mocked gh operations passed, including stderr-only success, wrong/nonzero version, exit-zero warning, updater failure, and propagation of mocked timeout exits 124/137. No test/harness files, new pipeline tests, real networked setup/update, or workflow dispatch were added. Real Linux timeout enforcement and hosted runtime remain unverified. The source and regenerated lock retain v0.86.2, read-only credentials, bot deduplication, isolated extension state, and the actions-lock.json-only publication boundary. |
There was a problem hiding this comment.
🔵 Needs a closer look
The trusted infrastructure path lacks a hosted execution, and current validation remains incomplete despite the Pester failures matching the main-branch baseline.
0 open findings
1 resolved since last review
🧠 Review effort: Balanced
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review
As an independent reviewer, I reviewed the complete changes in .github/workflows/aw-actions-update.md and its generated lock at exact head 752abf24651cff39623986ac58e2b1f32ada58ff.
Conclusion: no actionable introduced or worsened defects found. All three independent reviewers reached a clean assessment after checking the current diff and the pinned gh-aw v0.86.2 contracts. This is a code-review conclusion, not an approval.
The follow-up addresses the two findings in my earlier-head review: combined stdout/stderr capture preserves version-command failures and reads the pinned CLI's version output, and the GNU timeout wrapper bounds the entire pre-agent setup despite v0.86.2 omitting custom step timeouts from the generated lock. Captured updater output also rejects the Could not update actions-lock.json: warning before writing a completion report. The existing CCR thread for that warning is resolved; I did not add replies or change thread state.
Independent checks: source/generated setup-script equivalence and metadata hashes; trusted-hook execution order; exact version/exit handling; the warning marker's producer and emission condition; timeout failure propagation; deduplication and report availability inside the sandbox; isolated CLI state, read-only setup credentials, and the exclusive .github/aw/actions-lock.json safe-output allowlist. The title and description match the relocation and the follow-up behavior.
Focused offline probes exercised successful completion, an existing bot PR, invalid metadata, wrong version, version/install/updater command failures, and an exit-zero action-lock warning. Failure cases produced no completion report. A shortened real GNU timeout against a sleeping mocked command returned 124 without a report; this was not a real 15-minute hosted run. Other upstream per-action warnings retain their existing nonfatal semantics and were not treated as new defects.
Limits: no live extension installation, real networked updater, hosted workflow, or compiler regeneration was executed during this review. The probes used mocked GitHub operations and are retained as private evidence, not committed regression tests. Real hosted startup, credentials, network behavior, and full-duration timeout enforcement remain unverified.
Methodology: 3 independent reviewers with adversarial consensus.
Scope: code review only. CI/check status and merge readiness were not evaluated; use the repository's CI-analysis workflow for that assessment.
|
@dalexsoto stamp |

Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Move deterministic action-pin refresh into trusted pre-agent setup instead of asking the inference agent to install/remove a gh extension.
In run 37690369428, Copilot denied the composite "Install and verify lock-pinned gh-aw extension" shell command because interactive approval was unavailable. The update was never run; this was not an OS or network failure.
The trusted setup checks for an existing bot-created
[actions]PR before mutation, validates the exact compiler version from the committed workflow lock, installs it in isolated CLI state without removing a runner-wide extension, checks exact version equality, and runsgh aw update --verbose. Metadata, installation, version, or update failures fail the job explicitly.Review follow-up fixes capture the pinned CLI's stderr version output while preserving command failure and requiring the exact version line, and reject its nonfatal
Could not update actions-lock.json:warning even when the updater exits zero. Failed refreshes never write a successful completion report.The setup declares
timeout-minutes: 15. Because gh-aw v0.86.2 drops custom pre-agent step timeouts from the generated lock, the entire setup shell is also bounded by GNUtimeout --signal=TERM --kill-after=30s 15m; timeout failures propagate before inference. The compiler version remains v0.86.2.Inference reads the trusted setup result, rechecks deduplication, inspects and excludes generated/source workflow drift, and requests the existing safe-output. There is no extension dependency inside the AWF chroot. Read-only API credentials, inference credentials, firewall/tool controls, and the enforced
.github/aw/actions-lock.json-only PR allowlist are unchanged.Only this workflow source and its matching v0.86.2 generated lock are changed. No matching open fix PR was found after independently designing the change.
Validation
gh aw compile aw-actions-update --strict --shellcheck --no-check-update: passed, one workflow, zero warnings.gh aw compile aw-actions-update --strict --shellcheck --no-emit --no-check-update: passed source validation; initial revision also passed staged configuration validation.git diff HEAD^ HEAD --check: passed.actionlint .github/workflows/aw-actions-update.lock.yml: reports four pre-existing compiler/import findings, also present in the unchanged baseline: unsupportedconcurrency.queuetwice, generated SC2129, and the generatedgithub.awexpression. No new diagnostics.env -i PATH="$PATH" python3 -: passed seven cases using the exact emitted setup script with everyghoperation mocked: correct stderr version, wrong version, version-command error, exit-zero action-lock warning, updater error, and timeout exit propagation 124/137. Only the successful case produced a completion report. Source/emitted script equality and the 15-minute timeout configuration were checked. No test/harness file was written.752abf24651cff39623986ac58e2b1f32ada58ff: PASS, all ten safe-property answers YES; no new vulnerability.The installed compiler does not support
--dry-run; Docker-based scanners were unavailable. No product builds or new CI tests were needed. No real networked setup/update or hosted workflow was dispatched. Real Linux timeout enforcement and hosted startup/runtime remain unverified; the offline timeout probes mocked the command's return codes, not elapsed-time enforcement. No Azure PR builds are currently available, and this PR is not a CI-green or merge-readiness claim.Issues Fixed
Addresses #39238. Issue closure is managed separately by the coordinating session.