Skip to content

Add environment: gating to write/spend-capable gh-aw workflows + recompile all to v0.79.8 - #35951

Merged
PureWeen merged 3 commits into
mainfrom
pureween/fuzzy-goggles
Jun 17, 2026
Merged

Add environment: gating to write/spend-capable gh-aw workflows + recompile all to v0.79.8#35951
PureWeen merged 3 commits into
mainfrom
pureween/fuzzy-goggles

Conversation

@PureWeen

@PureWeen PureWeen commented Jun 16, 2026

Copy link
Copy Markdown
Member

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-agents gating 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 by review-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-main on this branch — activation ✅, agent job running ✅ (confirms COPILOT_GITHUB_TOKEN from environment is accessible).

Changes

Commit 1: Environment gating + deprecated field migration

Workflow Write surface
rerun-review-scanner Labels, reactions, AzDO pipeline triggers, federation secrets
ci-status-main Creates up to 5 tracking issues/run
ci-status-net11 Creates up to 5 tracking issues/run
daily-repo-status Creates issues + closes older ones

All 4 now use environment: gh-aw-agents. Also migrates the deprecated max-effective-tokens: -1max-ai-credits: -1 in both CI scanner workflows.

Commit 2: Lock freshness

Recompiles agentic-labeler.lock.yml and copilot-review-tests.lock.yml to current gh-aw v0.79.8 / AWF 0.27.2. No source .md changes — lock-only refresh.

Commit 3: Fix copilot-evaluate-tests + recompile

Fixes workflow_dispatch.inputs.pr_number.required: truefalse — v0.79.8 correctly rejects required: true 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.

Intentionally NOT gated

Workflow Reason
agentic-labeler Uses roles: all for community auto-labeling; gating would require approval per issue/PR
copilot-evaluate-tests Comment-only (max 1), already role-gated to [admin, maintain, write]
copilot-review-tests Same as above

Environment setup (already done ✅)

The gh-aw-agents environment has been created with:

  • COPILOT_GITHUB_TOKEN — Copilot inference auth
  • AZDO_TRIGGER_TENANT_ID — AzDO Workload Identity Federation
  • AZDO_TRIGGER_CLIENT_ID — AzDO Workload Identity Federation
  • No required reviewers (scheduled automation would stall)
  • No branch restrictions yet (can be added post-merge for main + net11.0)

- 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>
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35951

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35951"

@github-actions github-actions Bot added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Jun 16, 2026
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>
@PureWeen
PureWeen force-pushed the pureween/fuzzy-goggles branch from b73dbaa to 98b0936 Compare June 16, 2026 20:17

@kubaflo kubaflo 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.

🤖 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), no pull_request_target added, the fork-safety guard (head.repo.id == github.repository_id) preserved, all uses: 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 refreshed frontmatter_hash (no ERR_CONFIG risk — 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 ungated agentic-labeler (issues/pull_request_target) and copilot-review-tests (/review slash-command) are event-triggered — gating those would hang every PR/issue/command on manual approval, so leaving them ungated is right.

Findings (see inline)

  1. ⚠️ 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 the copilot environment exists; gh-aw-status and gh-aw-rerun-scanner 404. A referenced-but-missing environment auto-creates without protection, so merging this alone leaves the 4 jobs ungated (and on the new runtime). The environment: 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.
  2. 💡 Confirm max-ai-credits: -1 is 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 prior max-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.

Comment thread .github/workflows/ci-status-main.md
Comment thread .github/workflows/ci-status-main.md

@PureWeen PureWeen left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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 kubaflo 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.

🤖 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-scanner 404'd in dotnet/maui (so the gating would silently auto-create unprotected). You consolidated all 4 workflows onto a single gh-aw-agents and 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 (no permissions:/secret/trigger/egress delta).

Still open

  1. ⚠️ gh-aw-agents has 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 to gh-aw-agents (secret-scoping isn't visible via API, so I can't confirm that path). The environment: line is the right prerequisite — it just isn't an enforced control until one of those is configured. (inline)
  2. 💡 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.

Comment thread .github/workflows/ci-status-main.md
…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 kubaflo 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.

🤖 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 → false change is correct: a slash_command-triggered run doesn't supply workflow_dispatch inputs, so required: true would be incompatible; false lets both the slash-command and manual-dispatch paths work.
  • copilot-evaluate-tests is correctly ungated (it's slash_command + dispatch, event-triggered — same rationale as copilot-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_TOKEN still --exclude-env'd, no permissions:/trigger change).

Standing items (unchanged — repo-config, not code)

  • gh-aw-agents still has protection_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.

@PureWeen PureWeen changed the title Add environment: gating to write/spend-capable gh-aw workflows Add environment: gating to write/spend-capable gh-aw workflows + recompile all to v0.79.8 Jun 17, 2026

@kubaflo kubaflo 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.

🤖 Multi-model review — PR #35951 Round 3 Update

Verdict: LGTM

All workflow changes are correct:

  • environment: gh-aw-agents correctly added to all 4 workflows
  • copilot-evaluate-tests added to recompile with required: 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-agents environment exists but currently has no protection rules. This is acceptable as a baseline configuration that can be hardened later if needed.
  • max-ai-credits: -1 maintains 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

@PureWeen
PureWeen merged commit 92a5d81 into main Jun 17, 2026
9 of 10 checks passed
@PureWeen
PureWeen deleted the pureween/fuzzy-goggles branch June 17, 2026 20:00
@github-actions github-actions Bot added this to the .NET 10 SR9 milestone Jun 17, 2026
PureWeen added a commit that referenced this pull request Jun 17, 2026
…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>
PureWeen added a commit that referenced this pull request Jun 17, 2026
<!-- 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>
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants