Inspiration: Reviewers drown in pull requests. A huge change from a brand new author looks the same as a tiny fix from a teammate you trust, until you have already spent half an hour reading it. I wanted the risk to be visible before anyone reads a line of code.

What it does: Pull Request Risk Scorer is a Forge app for Bitbucket Cloud. It adds a Pull Request Risk panel to the overview tab of every pull request. The panel shows a risk score from 0 to 100, a Low, Medium or High band, and the top reasons in plain language. The demo scores sample pull request 42, Rewrite the checkout flow, at 85 out of 100, High risk, because it changes 1,423 lines, touches 12 files, changes no tests, and the author has no merged pull requests.

How we built it: Built with Atlassian Forge, using the native Bitbucket repoPullRequestOverviewPanel module and UI Kit. The app reads pull request data through the Bitbucket REST API version 2.0, read only, with the read:pullrequest:bitbucket scope. The scoring rules live in src/scoring.ts and are a plain sum of named signals, so every point is explained in the panel. It is written in TypeScript and tested with plain node:test, 9 tests, no account needed.

Challenges we ran into: The Forge login failed four times before we found the problem was the token, which had to be remade with the Forge scope. The first npm install failed when the internet dropped halfway. And bitbucket.org is blocked on my network, so the app has never been installed on a real Bitbucket site. The judges install it from the installation link instead, and the video shows the demo running in the terminal.

Accomplishments that we're proud of: The app is registered and deployed to production, version 2.0.0, with an installation link anyone with the link can use. The scoring logic passes all 9 tests. The demo video is recorded and uploaded.

What we learned: How Forge register, deploy and sharing actually work, how the Bitbucket REST API returns pull request data, and that a score is only useful if every point in it is explained in plain words.

What's next for Pull Request Risk Scorer:

Install it on a real Bitbucket workspace and watch it score real pull requests, then add more signals, like whether the change touches security sensitive files.

Built With

Share this project:

Updates

Submission history