Skip PAT environment for no-op CI investigations - #175
Draft
nagilson wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Review-only fork PR.
nagilson/sdkmain already contains the broaderpull_request_targetexperiment from #174, so this draft compares the minimal alternative against the same pre-fix baseline branch.Scope
Fix the observed post-merge no-op failure without changing the existing
pull_request: closedtrigger or adding target-branch checkout behavior.The failed upstream run https://github.com/dotnet/sdk/actions/runs/31824301915 had:
collect: successshould_run=falsepre_activation: failed before runner assignment because the top-levelcopilot-pat-poolenvironment was evaluated for the PR-head deploymentChange
on.needs: [collect]sopre_activationandactivationwait for deterministic collection.collect.should_runthrough apre_activationoutput.copilot-pat-poolonly whenshould_run=true; no-op runs resolve to no environment.collectdependencies for threat detection and safe outputs so their conditional environment expressions are valid.pull_request: closedtrigger.Deliberate limitation
This fixes the failure mode actually observed: a no-op merged-PR run becoming red before collection could suppress AI.
It does not make an actionable ordinary
pull_requestevent compatible with the production main-only PAT environment. Whenshould_run=true, PAT-consuming jobs still requestcopilot-pat-pool, so GitHub may reject the PR-head deployment. Supporting actionable merged-PR investigation outsidemainremains deferred to the broader trigger/checkout design in #174 or another follow-up.Validation
gh aw compile .github/workflows/ci-quality-monitor.md --approve: success, zero warnings.git diff --check: clean.pat_poolstill contains the real token-selection step.pre_activationwaits forcollectand conditionally omits the protected environment for no-op runs.copilot-pat-poolwhenshould_run=true.Live no-op validation
Temporarily configured the fork
copilot-pat-poolenvironment to allow onlymain, matching production, then dispatched this workflow from the non-maincopilot/ci-monitor-minimal-preactivationbranch with no build ID.Run: https://github.com/nagilson/sdk/actions/runs/31837528121
collect: success; 0 failed-build dossiers;should_run=falsepre_activation: success with a real runnerpat_pool: success; the job still ran because the shared import has noif. In the fork it selected repository-levelCOPILOT_PAT_0; no protected-environment deployment was created.activation,agent, detection, safe outputs, conclusion: skippedcopilot-pat-pooldeploymentsThe fork defines
COPILOT_PAT_0both as a repository secret and an environment secret, so an empty environment does not prevent that repository secret from reaching the job.dotnet/sdkhas no repository-levelCOPILOT_PAT_*; itsCOPILOT_PAT_1exists only incopilot-pat-pool, so the production no-op job would run, find no PAT values, warn, and exit successfully. This PR avoids the protected-environment failure but does not skip thepat_poolrunner. Skipping the imported job requires a separate backward-compatible condition inshared/pat_pool.mdand recompilation of its consumers.The fork environment was restored to unrestricted after the test.