Skip to content

fix: switch quality gate to orchestrator-dispatched workflow_dispatch#169

Merged
microsasa merged 2 commits intomainfrom
fix/quality-gate-dispatch
Mar 19, 2026
Merged

fix: switch quality gate to orchestrator-dispatched workflow_dispatch#169
microsasa merged 2 commits intomainfrom
fix/quality-gate-dispatch

Conversation

@microsasa
Copy link
Owner

Fixes #168

Problem

The quality gate workflow triggers on pull_request_review: submitted but filters out bot reviews in the pre-activation job. Since the autonomous pipeline has no human reviewers, the quality gate never fires — clean PRs sit open indefinitely.

Example: PR #167 — CI green, Copilot review clean (0 comments), quality gate never ran, PR stuck open for 30+ minutes.

Changes

Quality Gate (.lock.yml + .md)

  • Trigger: pull_request_review: submittedworkflow_dispatch with pr_number input
  • Removed if: label check on activation (orchestrator handles dispatch timing)
  • All safe outputs: added target: "*" (no PR trigger context with workflow_dispatch)
  • Updated concurrency group to use inputs.pr_number
  • Updated prompt to use inputs.pr_number instead of github.event.pull_request.number
  • Added workflow_dispatch to PR context prompt condition

Orchestrator (pipeline-orchestrator.yml)

  • Added Step 4: after CI green + 0 open threads → dispatch quality gate
    • Skips if aw-quality-gate-approved label already present
    • Skips if quality gate already in flight
  • Added "Quality Gate" to workflow_run trigger list (orchestrator fires after QG completes)

Flow (after this change)

Implementer creates PR
  → CI runs
  → Copilot reviews
  → Orchestrator sees: CI green + 0 threads
  → Orchestrator dispatches Quality Gate
  → Quality Gate approves (or flags for human)
  → Auto-merge triggers

- Quality gate trigger: pull_request_review → workflow_dispatch with pr_number input
- Quality gate safe outputs: add target: "*" for all PR-interacting tools
- Quality gate .md: remove bot/role checks (orchestrator handles dispatch timing)
- Orchestrator: add Step 4 — dispatch quality gate when CI green + 0 open threads
- Orchestrator: add Quality Gate to workflow_run trigger list

Fixes #168

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 19, 2026 17:27
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

This PR changes the “Quality Gate” workflow to be orchestrator-dispatched via workflow_dispatch (with a pr_number input) so clean PRs with zero Copilot comments still get evaluated and can auto-merge.

Changes:

  • Converted Quality Gate trigger from pull_request_review: submitted to workflow_dispatch with pr_number.
  • Updated Quality Gate safe-outputs config/prompting to work without PR-event context (target: "*", use inputs.pr_number).
  • Extended Pipeline Orchestrator to dispatch Quality Gate on the “happy path” (CI green + no unresolved threads) and to react to Quality Gate completion.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/quality-gate.md Updates workflow frontmatter + instructions to accept pr_number and run when dispatched by orchestrator.
.github/workflows/quality-gate.lock.yml Regenerated compiled workflow reflecting workflow_dispatch, updated concurrency/prompt context/safe-outputs targets.
.github/workflows/pipeline-orchestrator.yml Adds Quality Gate to workflow_run triggers and adds Step 4 to dispatch Quality Gate when CI/threads are clear.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Drop global QG_RUNNING check (was checking all runs, not per-PR)
  Rely on quality gate's per-PR concurrency group for dedup instead
- Add aw-quality-gate-evaluated label for HIGH impact / poor quality decisions
- Orchestrator skips dispatch when aw-quality-gate-evaluated is present
  Prevents infinite re-dispatch loop for PRs needing human review

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsasa
Copy link
Owner Author

Addressed review comments in ac22a2e:

Comment 1 (QG_RUNNING global check): Fixed — dropped the global check entirely. The quality gate's per-PR concurrency group handles dedup.

Comment 2 (activation if guard removed): By design — the orchestrator is the sole dispatcher and already verifies the aw label before calling.

Comment 3 (re-dispatch loop after QG completes): Fixed — added aw-quality-gate-evaluated label. Quality gate adds this for HIGH impact / poor quality decisions. Orchestrator skips dispatch when present.

Comment 4 (no persisted state for non-approvals): Fixed — same as #3. aw-quality-gate-evaluated persists the state.

@microsasa microsasa merged commit 93da22a into main Mar 19, 2026
4 checks passed
@microsasa microsasa deleted the fix/quality-gate-dispatch branch March 19, 2026 17:35
microsasa pushed a commit that referenced this pull request Mar 20, 2026
- Changelog: new entry for quality gate dispatch fix (PRs #169, #170, this PR)
- Agent table: quality gate trigger updated to workflow_dispatch
- Pitfall #21: safe output target values differ by handler type
- Pitfall #18: updated with target: ${{ inputs.pr_number }} guidance
- History: new entry for 2026-03-19/20 quality gate fix + first autonomous PRs

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.

Quality gate never fires on clean PRs — orchestrator missing happy path

2 participants