Inspiration
Every team has merged a pull request that "looked fine" and broken the one component that was already on fire: two open P1 bugs, an incident last week, and a queue of unfinished work. None of that context lives in the diff. Reviewers see the change; they don't see the risk of the place the change lands. AI summary bots don't fix this — they describe the diff back to you, and their wording changes from run to run. A merge gate needs to be a decision, and a decision needs to be reproducible.
What it does
When a pull request is created in Bitbucket, MergeGate:
- Reads the PR's diffstat and maps changed files to components (
src/payments/**→payments, and so on). - Scores each touched component from live Jira data — open P1/P2 bugs, incidents in the last 30 days, open dependencies — plus the size of the change and whether it ships without test changes.
- Returns a verdict from a pure, deterministic scoring function (no LLM anywhere in the scoring path): PASS (< 25), CONDITIONAL (25–59), BLOCK (≥ 60, or 2+ open P1 bugs).
- Posts the verdict, the score and the top 3 reasons back onto the pull request as a comment — automatically, within seconds of PR creation.
- Can create the missing readiness tasks in Jira (add tests, verify the P1, review the risk) — idempotently, so re-runs never duplicate work.
The same capabilities are exposed three ways:
- a Rovo agent ("Release Gate Agent") you can ask in plain language,
- an MCP server (
rovo:mcp) exposing six tools —register-pr-snapshot,get-pr-diff,get-component-risk,post-gate-comment,create-readiness-tasks,seed-demo-data— so any MCP client can drive the gate, - a Jira issue panel that shows every issue's component standing risk.
The Jira side also works standalone: seed the demo data from the agent and you get three graded demo PRs — BLOCK 77, CONDITIONAL 39, PASS 6 — whose scores are pinned by unit tests.
How we built it
Two Forge apps share one scoring core, because Forge cannot host Jira site scopes and Bitbucket workspace scopes in a single app. The Jira app holds the agent, the MCP tools, risk aggregation, verdicts, readiness tasks and the seed; the Bitbucket app listens for PR creation, fetches the diffstat, sends a snapshot to the Jira app over a secret-signed web trigger, and mirrors the verdict onto the PR. The scoring core (score.js) is a dependency-free pure function with a Node test suite, so the demo numbers are verifiable offline.
Challenges we ran into
- The Jira/Bitbucket scope split (Atlassian tracks it as ECO-223) forced the two-app bridge design — which turned into a feature: the Jira app is fully usable on its own.
- Bitbucket UUIDs arrive wrapped in braces, which Forge KVS keys reject; key normalisation fixed a bridge failure that only appeared end-to-end.
- Real sites don't all have an Incident issue type, so incident detection accepts the type or an
incidentlabel.
Accomplishments that we're proud of
- A real pull request gets a correct, fully-explained BLOCK verdict comment about five seconds after creation — no human in the loop.
- Every number in a verdict traces to a Jira issue count or a diffstat, and the headline demo verdicts are locked in by unit tests.
- Zero running cost in the scoring path: no Forge LLM calls at all.
What we learned
Determinism is a feature users can feel: when a gate gives the same answer twice, teams start trusting it. We also learned the Forge platform's edges (scope families, KVS key rules, MCP exposure settings) by hitting each one with a real end-to-end test instead of a mock.
What's next for MergeGate
Per-team scoring weights, deployment-frequency signals from Bitbucket pipelines, and a Marketplace listing once the review window fits the schedule.
Built With
- atlassian-mcp
- bitbucket
- forge
- javascript
- jira
- node.js
- rovo