💡 Inspiration

Hey there, I'm Josh 👋

As a professional software developer I've spent a lot of time waiting for build pipelines to complete 😅

My goal with Pipeline optimizer was to help improve the developer experience and let developers focus on building world-class software - not waiting for pipelines to complete or manually optimizing them!

World-class software development also relies on secure fundamentals, which is why Pipeline optimizer also looks for build steps that could contain security vulnerabilities - inspired by my time working at large organizations which had many different pipeline implementations of varying age throughout the organization.

🔄 What it does

Pipeline optimizer looks for potential performance and security optimisations in the repository's Bitbucket pipeline. If suggestions are found, users have the ability to automatically create a Pull request in their repository with the suggested changes - from there they can simply merge the Pull request and have the changes applied. The app is available in the repository sidebar, with an additional overview card on the main repository page.

🛠️ How we built it

This app was built using Forge with UI Kit 2 using both the bitbucket:repoMainMenuPage and bitbucket:repoCodeOverviewCard Forge modules. I chose UI Kit 2 because I wanted to try the latest component library that was available, and it also seemed to have all the required components that I would need. I also implemented the API inside Forge resolvers, and worked hard to ensure there was type safety between the backend and frontend (inspired by frameworks like tRPC)

I initially evaluated several different AI language models (touched on below too) and ended up choosing Gemini, which the app communicates with when determining potential optimizations.

It also interacts with the Bitbucket Cloud REST API using an autogenerated service layer that I am experimenting with - the end goal of which is to have a fully type-safe wrapper around the API for use in Forge apps. This is done by generating client code from the OpenAPI specification. Whilst this has been a challenging process it was awesome to see that this project helped to improve my own productivity while developing this app.

Optimization suggestions are also cached in Forge storage for a period of time for faster retrieval.

🆘 Challenges we ran into

I was initially hoping to use a local AI model which would allow this app to have no egress outside of the Forge environment, however I found that the quality of small local models wasn't quite up to standard. However this was a very educational experience, and as these models improve I hope to be able to utilize one in the future instead of egressing out.

😃 Accomplishments that we're proud of

Mainly just super stoked to have completed this project! The other key accomplishments that I can think of are:

  • building and using the proof-of-concept API TypeScript wrapper for the Bitbucket Cloud REST API
  • full end-to-end type safety between the resolvers and TanStack Query in the frontend
  • learning about and testing a variety of local AI models when evaluating whether it would be feasible to include one inside the Forge resolver
  • iterating on the design over time and utilising a lot of different UI Kit 2 components

🎓 What we learned

I learned heaps about the Forge platform and the new UI Kit 2 component library. I also learnt a great deal about LLM promoting and the support for structured outputs in different AI language models.

📅 What's next for Pipeline optimizer

I think there's a lot of scope to improve Pipeline optimizer, such as:

  • listening to forge events and automatically retrieving suggestions when the repository has been updated
  • creating a workspace settings page which would allow admins to view security and performance improvements in all pipelines throughout the organisation
  • offering suggestions to fix pipelines that are failing, so that pipelines can get back to passing as soon as possible

Thanks so much for reading! ✨🙌🎉

➕ Additional details

Forge App ID: c6c14a41-24c6-4b51-9655-328ca403c03d

Built With

Share this project:

Updates