Bitbucket administrators and users often ask about the size of repositories.
With a simple Forge app in Bitbucket, you can extend the UI and present the information to users and administrators exactly where they need it and in the format that works best for them.
App walkthrough
This app has two main features:
it provides an overview of the size of each repository in a workspace
it adds the size of a specific repository to the repository overview page
Repository size overview
The app adds a page, available from the workspace settings menu, that displays all the repositories in the workspace and their sizes in a table format.
The repository name is a link and by following it, you can open the repository settings directly.
The table can also be downloaded as a CSV file from the “Download” button, which is also part of the app.
Individual repository size
Each user can check a repository's size directly from the repository overview page. This is handy as this information is otherwise only visible to administrators.
How can you see the repository size in your Bitbucket workspace? (in less than 5 minutes)
At a high level, there are five steps required:
Clone the Bitbucket reports and follow the setup instructions of the 01.RepositorySize app
As a workspace admin, browse to the Workspace settings and open the Repositories Size Report page from the left-hand navigation menu
The YouTube video shows how the app works in Bitbucket Cloud.
FAQs
Q: How can I display additional information in the report? Or at the repository level?
A: Update either the workspace-settings.jsx or the repo-code-overview-card.jsx to add the desired information available from the Bitbucket REST API (List Repositories REST API).
Q: Is it possible to use one of the two features? E.g. add the report to the Workspace Settings but not to the repository overview page?
A: Yes. Edit the manifest.yml file in the cloned repository and only leave the required module.
Q: Does the report include the size of the Git LFS?
A: No, the Git LFS size is not included in the report and can't be retrieved at this stage.
What is a report that you would like to have available in Bitbucket?
Let us know in the comments
Caterina Curti
Developer Advocate
Sydney
109 accepted answers
0 comments