fix: add noop fallback to smoke-copilot workflows on non-PR triggers#4872
Conversation
Update Output sections in all smoke-copilot* workflow prompts to handle schedule/workflow_dispatch triggers gracefully. When the workflow is not triggered by a pull request, the agent now calls `noop` instead of attempting to add a comment/label to a non-existent PR. Fixes the "missing required data: pull request number" error reported when smoke-copilot-byok-aoai-apikey runs on a scheduled trigger. Also adds a test (smoke-copilot-workflow.test.ts) that enforces the noop fallback pattern across all five copilot smoke workflows.
✅ 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 fixes scheduled and manually-dispatched Copilot smoke workflows that previously tried to comment/label “the current pull request” even when no PR context exists, causing safe-outputs to fail with missing PR metadata on non-PR triggers.
Changes:
- Updated all five
smoke-copilot*.mdworkflow prompts to gateadd_comment/add_labelsbehind PR triggers and usenoopwith a PASS/FAIL summary forschedule/workflow_dispatch. - Added a Jest test to enforce the noop-fallback output pattern across all Copilot smoke workflow variants.
Show a summary per file
| File | Description |
|---|---|
| scripts/ci/smoke-copilot-workflow.test.ts | Adds a regression test ensuring Copilot smoke workflow prompts include PR-gated outputs plus a noop fallback for non-PR triggers. |
| .github/workflows/smoke-copilot.md | Updates Output instructions to avoid PR-only safe-outputs on schedule/workflow_dispatch by using noop. |
| .github/workflows/smoke-copilot-pat.md | Same Output gating + noop fallback pattern for the PAT variant. |
| .github/workflows/smoke-copilot-byok.md | Same Output gating + noop fallback pattern for the direct BYOK variant. |
| .github/workflows/smoke-copilot-byok-aoai-entra.md | Same Output gating + noop fallback pattern for the Entra-authenticated AOAI variant. |
| .github/workflows/smoke-copilot-byok-aoai-apikey.md | Same Output gating + noop fallback pattern for the AOAI API-key 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: 0
Smoke Test: Copilot BYOK (Direct) Mode ✅ PASSRunning in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com
Status: PASS
|
|
Smoke test report
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.
|
🔬 Smoke Test Results
Overall: FAIL — pre-step outputs ( cc
|
|
Smoke Test Results — Auth mode: PAT (COPILOT_GITHUB_TOKEN)
Overall: FAIL — pre-computed test data unavailable (template variables not resolved)
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL
|
Smoke copilot workflows run on
scheduleandworkflow_dispatchwith no PR context, but their agent prompts unconditionally instructedadd_commenton "the current pull request" — causing the safe-outputs layer to reportmissing_data: pull request numberon every scheduled run.Changes
.github/workflows/smoke-copilot-byok-aoai-apikey.md(primary): restructures the Output section to gateadd_comment/add_labelson a PR trigger, and fall back tonoopwith a PASS/FAIL summary onschedule/workflow_dispatchsmoke-copilot-byok-aoai-entra.md,smoke-copilot-byok.md,smoke-copilot.md,smoke-copilot-pat.md: same fix applied consistently across all copilot smoke variantsscripts/ci/smoke-copilot-workflow.test.ts: new test enforcing the noop fallback pattern is present in all five workflows (mirrors the existingsmoke-codex-workflow.test.ts)The pattern applied matches the already-fixed
smoke-codex.md: