Skip to content

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

@microsasa

Description

@microsasa

Problem

The quality gate workflow never fires for PRs that receive a clean Copilot review (no comments). This means PRs with green CI and zero review issues sit open indefinitely — nobody approves them.

Root Cause

The quality gate triggers on pull_request_review: submitted, but the lock file has a bot filter:

# - Copilot # Bots processed as bot check in pre-activation job
# - copilot-pull-request-reviewer # Bots processed as bot check in pre-activation job

When Copilot submits a clean COMMENTED review, the pull_request_review event fires, but the quality gate pre-activation job filters it out because it came from a bot. Since there are no human reviewers in the autonomous pipeline, the quality gate never runs.

Example: PR #167

Timeline:

  1. 16:51:12 — Implementer created PR fix: use format_tokens() in render_live_sessions (#133) #167 (fix: use format_tokens() in render_live_sessions (#133))
  2. 16:52:32 — Copilot reviewed → clean, 0 comments, COMMENTED state
  3. 17:01 — CI passed (check, CodeQL, analyze all green)
  4. 17:01:30 — Orchestrator ran, saw the PR, checked CI/threads — all clear. Did nothing because there's no "dispatch quality gate" step.
  5. 17:18 — PR still sitting open. No quality gate run. No approval. No merge.

The orchestrator has logic for the hard path (CI failing → ci-fixer, review comments → responder) but no logic for the happy path (everything green → dispatch quality gate → merge).

Fix

  1. Add quality gate dispatch to orchestrator: When a PR has:

    • CI green
    • Copilot has reviewed
    • 0 open review threads
    • No aw-quality-gate-approved label yet
    • No in-flight quality gate run
      → Dispatch quality gate via workflow_dispatch with pr_number input
  2. Switch quality gate trigger: Change from pull_request_review: submitted to workflow_dispatch with pr_number input. Update the .md frontmatter and regenerate the lock file.

  3. Update quality gate instructions: Since it won't have github.event.pull_request context from the trigger, the agent needs to fetch PR info using the pr_number input (same pattern as responder).

  4. Quality gate safe outputs: May need target: "*" and fetch: "*" like responder/ci-fixer since there's no triggering PR context with workflow_dispatch.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions