Version control & PR quality

/qa:merge-gate

Merge gate — evaluate a PR against the quality gates

Evaluate a PR against the project's gates — CI status, pass rate, coverage, severity blockers, security/a11y/perf — into a documented merge / hold decision. A change-scoped go/no-go that never auto-merges.

USAGE/qa:merge-gate [PR number | PR URL | branch] (optional — defaults to the current branch's PR)
Version control & PR qualityCTFL v4.0 §5.3 · CTAL-TMTest Leader · Test Manager · Automation

What it does

Gathers PR signals (CI checks, pass rate, coverage and delta, open defects by severity, security/a11y/perf results), evaluates each configured gate PASS/FAIL/N-A with evidence, and records a MERGE / MERGE-WITH-CONDITIONS / HOLD decision with conditions and residual risk — it never merges.

When to use it

When deciding whether a PR is safe to merge against the quality gates.

Prerequisites

qa.config.yml (gates thresholds, risk_areas for severity mapping, paths, tooling); the gh CLI for PR/CI signals, or supplied CI status/coverage; local reports under reports_dir.

Output

A merge gate decision record -> reports/MERGE-GATE-<id>-<date>.md with a gate table and residual risk.

Mechanics

How it works

  1. Resolve the PR (number/URL or current branch via gh)
  2. Gather signals — CI status, pass rate, coverage, defects by severity, security/a11y/perf
  3. Evaluate each gates item PASS/FAIL/N-A with evidence
  4. Decide MERGE / MERGE WITH CONDITIONS / HOLD, naming the driver
  5. Route severity blockers to /qa:triage, coverage holes to /qa:review-coverage, flakiness to /qa:flaky-hunt
  6. Record the decision with conditions, residual risk, and sign-off — never auto-merge

Why it works

The theory behind it

Exit-criteria evaluation against the configured gates plus a residual-risk statement (CTFL §5.3 monitoring, control & exit criteria; CTAL-TM release-decision practice). It is go/no-go at change scope — the same discipline as /qa:go-no-go applied per PR; severity (not priority) drives blockers (Principle 1).

CTFL v4.0 §5.3 · CTAL-TM

Example

See it in use

merge-gate
> /qa:merge-gate 482

✓ Correct when Every gates item is marked PASS/FAIL/N-A with evidence, severity (not priority) drives the blocker check, the verdict names the failing gate, and it records a recommendation rather than auto-merging.