Honor workflow-level COPILOT_MODEL in Copilot BYOK smoke workflows#4876
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR ensures the Copilot BYOK smoke workflows always honor the workflow-level COPILOT_MODEL pin (to keep token/credit usage predictable), by post-processing compiled lockfiles to remove repo-level model override expressions.
Changes:
- Update the smoke-workflow postprocessor to rewrite any compiled step-level
COPILOT_MODEL: ${{ ... }}expression in BYOK smoke lockfiles toCOPILOT_MODEL: ${{ env.COPILOT_MODEL }}. - Regenerate the affected BYOK smoke lockfiles so they no longer allow repo vars to override the workflow’s intended model.
- Add regression tests to assert the BYOK source workflow pin and the lockfile normalization behavior.
Show a summary per file
| File | Description |
|---|---|
| scripts/ci/postprocess-smoke-workflows.ts | Rewrites compiled BYOK lockfile COPILOT_MODEL expressions to always reference env.COPILOT_MODEL. |
| scripts/ci/postprocess-smoke-workflows.test.ts | Updates/expands regex unit coverage for the BYOK COPILOT_MODEL rewrite behavior. |
| scripts/ci/smoke-copilot-byok-workflow.test.ts | Adds a focused regression test asserting the source workflow pin and lockfile normalization. |
| .github/workflows/smoke-copilot-byok.lock.yml | Updates compiled lockfile to use COPILOT_MODEL: ${{ env.COPILOT_MODEL }} (no repo override). |
| .github/workflows/smoke-copilot-byok-aoai-apikey.lock.yml | Same compiled lockfile normalization for AOAI API key variant. |
| .github/workflows/smoke-copilot-byok-aoai-entra.lock.yml | Same compiled lockfile normalization for AOAI Entra variant. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 1
| // For smoke-copilot-byok variants: replace empty model fallbacks with the | ||
| // workflow-level COPILOT_MODEL env so the generated step inherits the shared | ||
| // default without hardcoding a duplicate model string here. | ||
| // workflow-level COPILOT_MODEL env so the generated step inherits the | ||
| // workflow's intended BYOK model instead of any repo-level default. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback |
Smoke Test: Copilot PAT Auth Validation
Overall: PASS PR: "Honor workflow-level COPILOT_MODEL in Copilot BYOK smoke workflows" — author Auth mode: PAT (COPILOT_GITHUB_TOKEN)
|
|
Smoke Test: Copilot BYOK (Direct) Mode — PASS ✅
Running in direct BYOK mode ( Overall: PASS | Authors:
|
🧪 Smoke Test Results
PR: Honor workflow-level COPILOT_MODEL in Copilot BYOK smoke workflows
|
|
Smoke test results
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results
Overall: FAIL
|
|
PR #4876 by
|
|
Honor workflow-level COPILOT_MODEL in Copilot BYOK smoke workflows: ✅
|
The Copilot BYOK smoke workflow could exceed the AI credits budget because the compiled lockfiles still allowed repo-level Copilot model defaults to override the workflow’s intended low-cost BYOK model. This change makes the BYOK smoke workflows consistently use their workflow-defined model selection.
Root cause
COPILOT_MODEL, which changed runtime model selection and increased token/credit usage.Postprocess fix
scripts/ci/postprocess-smoke-workflows.tsto normalize BYOK smoke lockfiles to:smoke-copilot-byok*lockfiles so workflow-level model pins remain authoritative even when repo-level defaults are configured.Generated workflow updates
smoke-copilot-byok.lock.ymlsmoke-copilot-byok-aoai-apikey.lock.ymlsmoke-copilot-byok-aoai-entra.lock.ymlRegression coverage
GH_AW_DEFAULT_MODEL_COPILOTvars.GH_AW_MODEL_AGENT_COPILOT || env.COPILOT_MODELoverridesCOPILOT_MODEL.Example of the effective compiled change: