Add environment: gating to write/spend-capable gh-aw workflows + recompile all to v0.79.8 - #35951
Conversation
- rerun-review-scanner: environment: gh-aw-rerun-scanner - ci-status-main, ci-status-net11, daily-repo-status: environment: gh-aw-status - Migrate deprecated max-effective-tokens: -1 to max-ai-credits: -1 in ci-status-main and ci-status-net11 - Recompile all 4 lock files with gh-aw v0.79.8 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35951Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35951" |
Brings stale lock files up to current compiler version. No source .md changes — lock-only refresh for freshness. Note: copilot-evaluate-tests.lock.yml NOT updated — the source .md has a pre-existing schema error (required: true on workflow_dispatch.inputs combined with slash_command trigger) that v0.79.8 now rejects. Requires a separate fix to the source .md before it can recompile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b73dbaa to
98b0936
Compare
kubaflo
left a comment
There was a problem hiding this comment.
🤖 Multi-model code review — gh-aw environment: gating + compiler bump
Three models reviewed this independently (Claude Opus 4.8, GPT-5.5, Gemini 3.1 Pro), then cross-pollinated. I also independently verified the gh-aw specifics (recompile completeness, env config, the lock delta).
Verdict: NEEDS_DISCUSSION — the code is correct, safe, and well-targeted; the one substantive item is a merge-readiness dependency (the gating is inert until the environments are configured), not a code defect.
What this actually is
Two things bundled: (1) environment: gating on the 4 scheduled/dispatch spend-capable workflows, and (2) a gh-aw compiler bump v0.72.1 → v0.79.8 that regenerates all 6 lock files (the bulk of the 424KB diff; this is why agentic-labeler/copilot-review-tests lock files change despite unchanged .md).
Verified clean ✅ (Opus + orchestrator independently scanned the 424KB delta)
- No security regression in the bump: zero
permissions:changes, per-workflow secret sets byte-identical, firewall egress domain union identical (77 = 77, zero delta), nopull_request_targetadded, the fork-safety guard (head.repo.id == github.repository_id) preserved, alluses:SHA-pinned and container images digest-pinned, sensitive tokens still--exclude-env'd from the agent container. - Recompile is complete & consistent — all 6 lock files now
compiler_version v0.79.8; the 4.md-changed files have refreshedfrontmatter_hash(noERR_CONFIGrisk — confirmed by the green gh-aw checks on this PR's run). - Selective gating is correct: the gated set is exactly the
schedule:+workflow_dispatch:workflows; the ungatedagentic-labeler(issues/pull_request_target) andcopilot-review-tests(/reviewslash-command) are event-triggered — gating those would hang every PR/issue/command on manual approval, so leaving them ungated is right.
Findings (see inline)
⚠️ The gating is currently a silent no-op (ci-status-main.md:8,rerun-review-scanner.md:2). All three of us queried the repo: only thecopilotenvironment exists;gh-aw-statusandgh-aw-rerun-scanner404. A referenced-but-missing environment auto-creates without protection, so merging this alone leaves the 4 jobs ungated (and on the new runtime). Theenvironment:lines are the correct prerequisite — but an admin must provision both environments (required reviewers + scoped secrets) for the gating to bite. Worth coordinating before/at merge.- 💡 Confirm
max-ai-credits: -1is intentional (ci-status-main.md:45,ci-status-net11.md). Unlimited per-run, backstopped only by the daily budget — compounds with #1 while the gate isn't enforcing. Matches the priormax-effective-tokens: -1, so likely deliberate.
Also worth a glance (non-blocking)
- The two event-triggered, recompile-only workflows (
agentic-labeler,copilot-review-tests) couldn't be exercised by this PR's scheduled run — worth a quick post-merge sanity check that they still execute on the new v0.79.8 runtime.
This is safe to merge; it just won't achieve its stated gating goal until the environments are configured.
Independent verdicts: Opus 4.8 — NEEDS_DISCUSSION (high) · GPT-5.5 — NEEDS_CHANGES · Gemini 3.1 Pro — LGTM (high). All three + a direct API check converge on the environment-config dependency; the version bump is clean.
PureWeen
left a comment
There was a problem hiding this comment.
Thanks for the thorough multi-model review — both findings are valid and already anticipated:
Finding 1 (environments are no-ops until configured): Correct — this is documented in the PR description under "Admin follow-up". The intent is to land the environment: references first (non-breaking since GitHub auto-creates empty environments), then have an admin configure branch restrictions. We intentionally opted for no required reviewers to avoid stalling scheduled automation — the value is environment-scoped secret isolation and audit trail, not approval gating.
Finding 2 (max-ai-credits: -1 intentional): Yes, deliberate. These CI scanners need uncapped per-run budget because they process 3 pipelines × 10 builds each with full log analysis. The -1 carries over from the prior max-effective-tokens: -1. Per the gh-aw guide: "a negative value disables both enforcement and steering (safest when the workflow is gated behind a deployment environment with required reviewers)" — the environment gate (once configured) makes this defensible.
Post-merge sanity check note: Good call on exercising the recompile-only workflows (agentic-labeler, copilot-review-tests) after merge. Will monitor their next triggered runs.
kubaflo
left a comment
There was a problem hiding this comment.
🤖 Re-review — round 2 (head 98b09365)
Reviewed the new commit (env consolidation + lock recompile).
Addressed / improved since round 1 ✅
- The environment now exists. Round 1 flagged that
gh-aw-status/gh-aw-rerun-scanner404'd indotnet/maui(so the gating would silently auto-create unprotected). You consolidated all 4 workflows onto a singlegh-aw-agentsand created it — cleaner, and no longer auto-created. - Recompile is clean — the 4 gated locks all carry
environment: gh-aw-agents; the 2 event-triggered locks (agentic-labeler,copilot-review-tests) correctly stay ungated; the +298/−105 churn on those is benign (nopermissions:/secret/trigger/egress delta).
Still open
⚠️ gh-aw-agentshas no protection rules yet (ci-status-main.md:8+ 3). I queried it:protection_rules: []— so the 4 scheduled jobs still run with no approval gate. To make the gating actually enforce, add required reviewers in Settings → Environments, and/or scope the spend/write secrets togh-aw-agents(secret-scoping isn't visible via API, so I can't confirm that path). Theenvironment:line is the right prerequisite — it just isn't an enforced control until one of those is configured. (inline)- 💡
max-ai-credits: -1(unlimited per-run,ci-status-main.md:45/ci-status-net11.md) — unchanged; still worth confirming it's intentional, especially while #1 leaves the jobs ungated.
Verdict: NEEDS_DISCUSSION — the code is correct and the version bump remains clean; the remaining items are repo-config (protection rules / scoped secrets), not code defects.
@PureWeen — nice consolidation. The last mile is configuring gh-aw-agents (required reviewers and/or scoped secrets) so the gate actually bites.
3-model panel basis (Opus 4.8 · GPT-5.5 · Gemini 3.1 Pro); this round was a light re-review of the env/recompile delta.
…compat v0.79.8 correctly rejects required: true on workflow_dispatch inputs when slash_command is also configured (auto-dispatch can't fill required inputs). The workflow already falls back to github.event.issue.number from slash command context, so the required constraint was never enforcing anything. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kubaflo
left a comment
There was a problem hiding this comment.
🤖 Re-review — round 3 (head 984af96)
New commit adds copilot-evaluate-tests to the bump and makes its pr_number dispatch input required: false.
Reviewed — clean ✅
- The
required: true → falsechange is correct: aslash_command-triggered run doesn't supplyworkflow_dispatchinputs, sorequired: truewould be incompatible;falselets both the slash-command and manual-dispatch paths work. copilot-evaluate-testsis correctly ungated (it'sslash_command+ dispatch, event-triggered — same rationale ascopilot-review-tests), read-only top-level perms,roles: [admin, maintain, write].- Its lock recompile to v0.79.8 is the same benign delta already vetted (egress domain set unchanged,
COPILOT_GITHUB_TOKENstill--exclude-env'd, nopermissions:/trigger change).
Standing items (unchanged — repo-config, not code)
gh-aw-agentsstill hasprotection_rules: []→ add required reviewers and/or scope secrets for the gate to actually enforce.max-ai-credits: -1(unlimited per-run) on the two ci-status workflows.
Verdict: NEEDS_DISCUSSION — code/recompile remain clean; the only open items are the environment config above.
environment: gating to write/spend-capable gh-aw workflowsenvironment: gating to write/spend-capable gh-aw workflows + recompile all to v0.79.8
kubaflo
left a comment
There was a problem hiding this comment.
🤖 Multi-model review — PR #35951 Round 3 Update
Verdict: LGTM
All workflow changes are correct:
- ✅
environment: gh-aw-agentscorrectly added to all 4 workflows - ✅
copilot-evaluate-testsadded to recompile withrequired: false(correct for slash command compat) - ✅ Lock recompilations clean (v0.79.8, no permission/trigger changes)
- ✅ All 12 files in scope
Repo-config notes (non-blocking):
- The
gh-aw-agentsenvironment exists but currently has no protection rules. This is acceptable as a baseline configuration that can be hardened later if needed. max-ai-credits: -1maintains existing unlimited-per-run behavior for these trusted scheduled workflows.
Ready for merge.
Review conducted by: @kubaflo's autonomous multi-model review loop
Models: Claude Opus 4.8, GPT-5.5, Gemini 3.1 Pro
…79.8 The CI scanners already received environment: gh-aw-agents and the max-effective-tokens -> max-ai-credits migration on main via PR #35951, so this commit only carries the equivalent change for the new ci-status-fix fixer: - Add top-level environment: gh-aw-agents (write-capable: opens PRs; spendy: claude-opus inference), gating it behind the shared gh-aw-agents environment (COPILOT_GITHUB_TOKEN + AzDO federation). - Recompile ci-status-fix with gh-aw v0.79.8 (AWF 0.27.2). actions-lock.json is intentionally left matching main (its compiled locks hardcode the v0.79.8 setup sha at runtime, so the pin file is not bumped). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!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](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Summary Follow-up to #35951 — extends `environment: gh-aw-agents` gating to the **remaining 4 workflows** that were not included in the initial PR: | Workflow | Type | Change | |----------|------|--------| | `agentic-labeler.md` | gh-aw | Added `environment: gh-aw-agents` | | `copilot-evaluate-tests.md` | gh-aw | Added `environment: gh-aw-agents` | | `copilot-review-tests.md` | gh-aw | Added `environment: gh-aw-agents` | | `review-trigger.yml` | Regular GHA | Added `environment: gh-aw-agents` to `trigger-review` job | ## Why After #35951 merged, repo-level secrets (`COPILOT_GITHUB_TOKEN`, `AZDO_TRIGGER_TENANT_ID`, `AZDO_TRIGGER_CLIENT_ID`) were deleted in favor of environment-scoped secrets on the `gh-aw-agents` environment. These 4 workflows need the `environment:` reference to access those secrets. ## Details - All 3 gh-aw workflow locks recompiled with `gh aw v0.79.8` - `environment: gh-aw-agents` verified on agent + safe-outputs + threat-detection jobs in all lock files - `review-trigger.yml` is a regular GHA workflow — environment added at job level, no compile needed - Pre-existing compile warnings (agentic-labeler `pull_request_target`, copilot-evaluate-tests `slash_command` + `bots:`) are unchanged and intentional Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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!
Summary
Adds top-level
environment: gh-aw-agentsgating to the 4 gh-aw workflows that have write capabilities or uncapped inference spend, following the gh-aw best practice: "Gate any write-capable or spendy agentic workflow behind such an environment."Uses a single shared environment (
gh-aw-agents) since the AzDO federation secrets are also used byreview-trigger.yml, so per-workflow secret isolation isn't achievable.Also brings all 7 gh-aw workflow lock files to the current compiler (v0.79.8 / AWF 0.27.2).
Validated: triggered
ci-status-mainon this branch — activation ✅, agent job running ✅ (confirmsCOPILOT_GITHUB_TOKENfrom environment is accessible).Changes
Commit 1: Environment gating + deprecated field migration
rerun-review-scannerci-status-mainci-status-net11daily-repo-statusAll 4 now use
environment: gh-aw-agents. Also migrates the deprecatedmax-effective-tokens: -1→max-ai-credits: -1in both CI scanner workflows.Commit 2: Lock freshness
Recompiles
agentic-labeler.lock.ymlandcopilot-review-tests.lock.ymlto current gh-aw v0.79.8 / AWF 0.27.2. No source.mdchanges — lock-only refresh.Commit 3: Fix copilot-evaluate-tests + recompile
Fixes
workflow_dispatch.inputs.pr_number.required: true→false— v0.79.8 correctly rejectsrequired: truewhenslash_command:is also configured (auto-dispatch can't fill required inputs). The workflow already falls back togithub.event.issue.numberfrom slash command context.Intentionally NOT gated
agentic-labelerroles: allfor community auto-labeling; gating would require approval per issue/PRcopilot-evaluate-tests[admin, maintain, write]copilot-review-testsEnvironment setup (already done ✅)
The
gh-aw-agentsenvironment has been created with:COPILOT_GITHUB_TOKEN— Copilot inference authAZDO_TRIGGER_TENANT_ID— AzDO Workload Identity FederationAZDO_TRIGGER_CLIENT_ID— AzDO Workload Identity Federationmain+net11.0)