fix: quality gate waits for Copilot review and checks actual approval state#202
Merged
fix: quality gate waits for Copilot review and checks actual approval state#202
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the pipeline orchestrator logic so the quality gate won’t run (or be skipped) based on stale signals; instead it waits for Copilot review completion and verifies a current-commit approval state before deciding whether to dispatch the quality gate.
Changes:
- Extend orchestrator PR GraphQL query to include
headRefOidandlatestReviews, and use them to gate quality-gate dispatch on current-commit Copilot review + current-commit approval. - Document two new orchestration pitfalls in
agentic-workflows.mdand record the change indocs/changelog.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
docs/changelog.md |
Adds an entry describing the new quality-gate gating logic and rationale. |
docs/agentic-workflows.md |
Adds pitfalls #28/#29 documenting why orchestrator must wait for Copilot and check real approval state. |
.github/workflows/pipeline-orchestrator.yml |
Implements the new gating checks (Copilot review exists, no Copilot run in progress, valid approval on head commit). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
83115a0 to
3f06f64
Compare
… state Before dispatching quality gate, the orchestrator now: 1. Verifies Copilot has reviewed the current head commit 2. Checks no Copilot code review is in-progress 3. Checks for valid (non-dismissed) approval on current commit instead of relying on aw-quality-gate-approved label Fixes #178, #187 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3f06f64 to
034716f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 21, 2026
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.
Problem
#178 — Quality gate dispatched before Copilot review completes
The orchestrator dispatched the quality gate as soon as CI was green and threads were resolved, without checking whether Copilot had reviewed. Quality gate approved PRs before Copilot's review arrived — then Copilot's comments went unaddressed. Observed on PR #193 (4 unresolved threads at merge).
#187 — Quality gate label/approval desync
The orchestrator checked for
aw-quality-gate-approvedlabel to skip re-dispatch. Butdismiss_stale_reviews: truedismisses the approval when new code is pushed while the label persists. Orchestrator saw the stale label and skipped, leaving PR stuck.Fix
Replaced the label-based quality gate check (step 4) with three verification steps:
latestReviewsforcopilot-pull-request-revieweron current head commit viaheadRefOid. Skip if missing.gh run listfor active "Copilot code review" runs. Skip if any running (fail-safe: defaults to 1 on API error).latestReviewsfor non-dismissed APPROVE fromgithub-actionson current head commit. Only skip dispatch if valid approval exists.Also added pitfalls #28 and #29 to agentic-workflows.md.
Fixes #178, #187