Inspiration

We built this because we believe iteration speed is important and we should not be wasting time waiting for builds and deployments that run too long.

We realised there was space for a tool that could immediately highlight slow running pipelines and steps and provide suggestions on how to begin speeding them up.

What it does

Optimize Pipelines is an intelligent assistant for Bitbucket that automatically analyzes your build history to identify performance bottlenecks.

It visualizes your pipeline execution times, highlighting exactly which steps are slowing you down.

Beyond just reliable metrics, it uses AI to deep-dive into logs and configuration files, generating concrete optimization suggestions to reduce build time.

Best of all, it allows you to apply these improvements instantly by generating a "Fix PR".

How we built it

Architecture

Obviously follows the Forge architecture but within that we've build some key components:

Ingestion: we fetch pipeline information from the Bitbucket REST API and store it in Forge SQL. we have a long running consumer that is triggered from the UI which periodically checks in on it's progress. Once the pipelines are ingested the UI can call resolvers to get the information it needs to render graphs and dashboards.

AI Analysis: as mentioned we couldn't use Forge LLM as we were not granted access to the EAP program so instead we use OpenRouter and call it from a Forge consumer. It tries qwen/qwen3-coder:free first, if any issue there it falls back to x-ai/grok-code-fast-1. Both of these coding models do a great job of analysing the pipeline information and suggesting optimisations. We'll switch this to Forge LLM when available.

Tooling

Primarily using the forge cli to lint, build and deploy.

Used a number of other tools during development:

  • Antigravity w/ Claude and Gemini
  • VSCode with Rovo Dev and Kilo Code
  • Rovo MCP (questioning the docs)
  • TiDB locally, mysql client and Dbeaver - run tests and experiments locally before and after going to Forge SQL
  • Bitbucket for the code repository, builds and staging deployments and for just deepening understanding of Bitbucket and it's pipelines in order to improve the tool.

Challenges we ran into

  • fetching step logs requires egress to S3 so we lose "Runs on Atlassian": ECOHELP-102588
  • no way to fetch docker logs from Bitbucket REST for analysis Get-pipeline-step-docker-log-by-REST-API
  • no access to Forge LLM so setup a backend resolver to OpenRouter - so again we lose "Runs on Atlassian" opening up that egress
  • no access to Rovo chat or agents - was keen to try this out and see what the possibilities were and how it works etc. So instead just figured out a way to provide the AI analysis piece externally. Would love to revisit and rework this once I can try this out.
  • hit some inconsistencies with pipeline yaml validation. so i now have a modified version of the schema to pick up issues at precommit stage pipelines-configuration-schema-does-not-validate-cache-names

Accomplishments that we're proud of

Going from zero experience with Forge to building a pretty decent and capable app in a month.

Surfacing a bunch of information about pipeline runs that is otherwise time consuming and difficult to get to.

What we learned

Forge Apps: ins and outs of building forge apps - i18n translation, accessibility, Forge SQL and KV storage, asynchronous events and consumers, web triggers, Atlassian Design System and Atlaskit

Bitbucket: coming from Github and Gitlab learnt a lot about Bitbucket and what you can do, especially how to setup pipelines

Bitbucket REST: obviously leaned on this pretty heavily to ingest pipeline details and perform analysis

What's next for Optimizer

  1. Get feedback and test it out on a bunch of different sets of users pipelines.

  2. Generate more advanced and context sensitive optimization recommendations. eg. is aware a project is NodeJS based, or Rust based etc. and tailor suggestions and AI prompts to that.

  3. Static analysis - merge in some static analysis checks, eg. docker builds - is a remote builds cache setup?, is clone depth 1 set (instead of the default 50), etc.

  4. Switch to Forge LLM once granted access.

  5. Use Rovo agents once granted access.

  6. List on marketplace!

  7. Speed up pipeline ingestion.

Built With

Share this project:

Updates