Skip to content

fix: quality gate waits for Copilot review and checks actual approval state#202

Merged
microsasa merged 1 commit intomainfrom
fix/quality-gate-timing
Mar 21, 2026
Merged

fix: quality gate waits for Copilot review and checks actual approval state#202
microsasa merged 1 commit intomainfrom
fix/quality-gate-timing

Conversation

@microsasa
Copy link
Owner

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-approved label to skip re-dispatch. But dismiss_stale_reviews: true dismisses 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:

  1. Copilot review exists — query latestReviews for copilot-pull-request-reviewer on current head commit via headRefOid. Skip if missing.
  2. Copilot review not in progressgh run list for active "Copilot code review" runs. Skip if any running (fail-safe: defaults to 1 on API error).
  3. Valid approval check — query latestReviews for non-dismissed APPROVE from github-actions on current head commit. Only skip dispatch if valid approval exists.

Also added pitfalls #28 and #29 to agentic-workflows.md.

Fixes #178, #187

Copilot AI review requested due to automatic review settings March 21, 2026 06:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 headRefOid and latestReviews, and use them to gate quality-gate dispatch on current-commit Copilot review + current-commit approval.
  • Document two new orchestration pitfalls in agentic-workflows.md and record the change in docs/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.

… 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>
@microsasa microsasa force-pushed the fix/quality-gate-timing branch from 3f06f64 to 034716f Compare March 21, 2026 06:29
Copilot AI review requested due to automatic review settings March 21, 2026 06:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@microsasa microsasa merged commit 0fb5fda into main Mar 21, 2026
8 checks passed
@microsasa microsasa deleted the fix/quality-gate-timing branch March 21, 2026 06:39
microsasa pushed a commit that referenced this pull request Mar 21, 2026
…ctions

The orchestrator no longer checks this label — it verifies actual
approval state via GraphQL latestReviews (PR #202). The label is
obsolete noise.

Closes #204

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: quality gate dispatched before Copilot review completes

2 participants