Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for FlakeLens

Inspiration

Every team with a CI pipeline knows the ritual: a build goes red, someone clicks "re-run", it goes green, and nobody writes anything down. Flaky tests train people to ignore failures, and then a real regression hides among them. The information needed to tell the two apart is already there, in the JUnit reports CI throws away after every run. I wanted a tool that keeps that history and answers the question honestly: flaky, or actually broken?

What it does

  • CI uploads its JUnit XML report after every run to a FlakeLens web trigger (one curl line in any pipeline).
  • FlakeLens keeps a per-test history and gives each test a verdict with the reason:
    • flaky: the same commit both passed and failed, or the outcome flips in at least 30% of consecutive runs;
    • broken: failed the last 3+ runs in a row after passing before, naming the first failing run and commit;
    • healthy: everything else, including one-off failures.
  • Jira page (Apps > FlakeLens): totals, a passed/failed bar per CI run and a ranked "fix these first" table with the evidence line for each test.
  • Rovo agent "FlakeLens Triage" with four actions: ask "Which tests are flaky in sample-demo-shop, and is anything actually broken?" and it answers from the stored runs. Ask it to file an issue and it creates one Jira issue per test (label flakelens) with the verdict and the runs behind it; if one already exists it adds a comment with the new evidence instead of a duplicate (shown live in the video: SHOP-2 got a comment).
  • Rovo MCP module: the three read-only tools (list-flaky-tests, explain-test, list-recent-runs) are available to AI clients outside Atlassian. Verified from an external OAuth 2.1 MCP client (shown in the video).
  • Load sample data: a judge can install it and see results in 2 minutes, no CI needed. The sample is 12 real JUnit reports, produced by running the bundled demo suite 4 times on each of 3 commits.

How we built it

  • Atlassian Forge (Node.js runtime): web trigger ingest-junit (bearer token stored as an encrypted Forge variable, duplicate run ids ignored), Forge KVS storage (last 50 observations per test, last 30 runs per project), Rovo agent + 4 Rovo actions, rovo:mcp module, Jira global page in UI Kit with a resolver.
  • A small dependency-free JUnit parser (Jest, pytest, Surefire and Node test runner styles), no XML entity expansion.
  • The verdict logic is one pure module (app/src/core/flake.js), so the page, the agent and the MCP tools always agree. 16 unit tests cover the parser, verdicts, ingest, issue text and sample data (npm test: 16/16 pass).
  • The demo data is real: demo-shop has genuinely nondeterministic tests (a latency assumption, a lost update across an await, a Promise.race) and a third commit that really breaks the coupon math.
  • AI disclosure: the code was written with Claude Code (Anthropic's AI coding agent) directed by me. I chose the problem and design and verified every feature by running it on an Atlassian developer site.

Challenges we ran into

  • Exposing the MCP tools outside Atlassian: the consent page said "Your account isn't associated with a supported site" until a site admin turns on "Expose tools to MCP-compatible apps" for the app. That step is now in the README.
  • Keeping the agent honest: the instructions make it report only what the stored runs show, and the actions return the evidence line with every verdict, so the answer can be checked against the Jira page.
  • Not spamming Jira: one issue per test, later evidence becomes a comment.
  • Judges have no CI wired to their site, so the empty state got a one-click "Load sample data" button.

Accomplishments that we're proud of

  • The same verdicts, scores and commits show up in the Jira page, the Rovo agent and an external MCP client.
  • The flaky tests in the demo are really flaky; nothing in the demo is hard-coded.

What we learned

  • Forge's rovo:mcp module turns Rovo actions into tools any MCP client can call, with Atlassian handling OAuth.
  • A flake score is only useful with its reason next to it; people trust "2 pass / 2 fail on commit 154ffbb9" more than a number.

What's next for FlakeLens

  • A Jira issue panel with the pass/fail strip for the linked test.
  • Auto-close the FlakeLens issue when a test has been healthy for N runs.
  • Per-branch views and quarantine suggestions.

Links

Built With

Share this project:

Updates

Submission history