Fix skill evaluation authentication and runtime - #69030
Conversation
Select the first configured Copilot PAT pool entry instead of assuming slot zero, and retain the repository token fallback. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The workflow change is narrowly scoped, includes an explicit regression test for the credential selection expression, and the documentation is updated to match the new behavior.
Review tier: Lite
Findings: None
What changed in this PR
Updates the skill-evaluation GitHub Actions workflow to reliably select a usable Copilot credential when the copilot-pat-pool environment doesn’t provide COPILOT_PAT_0, preventing authentication failures during Vally execution.
Changes:
- Update
.github/workflows/skill-evals.ymlto select the first availableCOPILOT_PAT_0..COPILOT_PAT_9, falling back toCOPILOT_GITHUB_TOKEN, and improve the failure message when none are configured. - Add a regression guard in
eng/skill-evals/test_workflow.ps1to ensure the ordered PAT-pool selection + fallback expression remains present exactly once. - Update
eng/skill-evals/README.mdto document the PAT pool selection and fallback behavior.
| File | Description |
|---|---|
| eng/skill-evals/test_workflow.ps1 | Adds a workflow self-test to assert the ordered PAT-pool selection and repository fallback are present. |
| eng/skill-evals/README.md | Updates hosted-evaluation docs to reflect PAT pool selection across COPILOT_PAT_0..9 with repo fallback. |
| .github/workflows/skill-evals.yml | Selects the first configured PAT from the pool with fallback, scoped to the Vally execution step, and improves the configuration error message. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Randomly select a populated Copilot PAT slot in a trusted job and expose only the selected credential to the Vally worker. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review
No correctness or security defect survived consensus. The trusted selector matches ASP.NET Core’s existing .github/workflows/shared/pat_pool.md design: it receives the pool only in an isolated trusted job, emits only a numeric slot, and keeps candidate-controlled execution away from the pool.
One testing gap remains: the regression test verifies YAML text but does not execute the empty-pool, slot-2-only, multi-slot, or repository-fallback paths. This is especially relevant because the pull-request event skips the credential-bearing jobs.
The selected-secret expression is valid GitHub Actions syntax because steps.env supports both needs and secrets, and expression index syntax accepts a formatted key. However, it is not the exact consumer expression used by the repository’s existing PAT-pool workflows, which use a static case(...) mapping. That is a consistency difference, not a demonstrated runtime bug.
Methodology: 3 independent reviewers with adversarial consensus. The dynamic-lookup, fallback-provisioning, and selector-exposure concerns were independently disputed and discarded. Existing Copilot feedback reviewed the prior commit and did not cover the current random-selector implementation.
Test coverage assessment: structural coverage is present; the model-bearing authentication path lacks execution coverage in this PR.
Resolve the selected PAT slot with the same static case expression used by ASP.NET Core's existing agentic workflows while retaining the repository token fallback. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Extract and run the workflow's selector script against empty, single-slot, and multi-slot synthetic pools, and assert that credentials never appear in its outputs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Install the Vally and Copilot toolchain from a checked-in lockfile before credentials enter scope, and verify platform SDK resolution from the consuming package's module path. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore fork-panel-validation after validating dotnet#69030 against the COPILOT_PAT_2-only environment. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 4 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Fixes the authentication and runtime failures seen while evaluating #69028 in https://github.com/dotnet/aspnetcore/actions/runs/33777017172.
Two independent issues prevented the model evaluation from completing:
COPILOT_PAT_0was populated even though the sharedcopilot-pat-poolenvironment can expose any populated slot.This change follows the trusted PAT-pool and pinned-toolchain design used by the existing ASP.NET Core agentic workflows and
dotnet/skills:COPILOT_PAT_0throughCOPILOT_PAT_9, finds the populated slots, and randomly selects one.case(...)secret mapping, withCOPILOT_GITHUB_TOKENas the empty-pool fallback.1.0.80, and the workflow verifies Linux platform SDK resolution from the consuming SDK package's module path before running a model.The existing authorization, same-repository restriction, exact-commit binding, trusted default-branch workflow, and trusted-file staging boundaries are unchanged.
Validated locally with:
pwsh ./eng/skill-evals/run.ps1 Testpwsh ./eng/skill-evals/run.ps1 Validatenpm cifrom the checked-in lockfile and SDK-relative platform-resolution probegit diff --checkEnd-to-end validation used
PureWeen/aspnetcore, whosecopilot-pat-poolenvironment contained onlyCOPILOT_PAT_2: https://github.com/PureWeen/aspnetcore/actions/runs/337957370990.14.0, Copilot CLI1.0.80, and the Linux x64 SDK platform entry point resolved successfully.0.79against the0.6threshold; baseline scored0.555.The temporary fork commits were restored with a normal revert after the run.