Breaking your mono repo

Orgs have large repos to where most teams contribute, in Athenian this is how you can break those mono repos to have detailed insights

José Caldeira avatar
Written by José Caldeira
Updated over a week ago

To break your mono repo into more actionable components you need to add some identification to your PRs, like labels, that we can then filter on our side to create a logical representation of the components that compose your repo:

1. Auto label your PRs with a logical component identification

Use this GitHub action that will inject labels based in your repo folder structure

2. Apply to historical data

Apply the labels to your GitHub history by running retrolabeler:

cat .github/labeler.yml | ~/retrolabeler -j 1 -c <your mono repo>

This may take a while to run and give some timeouts due to GitHub API rate limits

3. Share your components with us

After step 2 is done please share with us your labeler.yml file, so that we re-run our preprocessor. This should allow you to see the data in your Athenian account.

Or do it your self by creating your logical components in our API. The structure of the PUT request should be similar to this:

curl -X 'PUT' \ '' \ -H 'accept: application/json' \ -H 'Authorization: Bearer <TOKEN>' \ -H 'Content-Type: application/json' \ -d '{ "account": 1, "name": "frontend", "parent": "", "prs": { "labels_include": [ "component:frontend" ] }, "releases": { "branches": "{{default}}", "tags": ".*", "events": ".*", "match": "tag" }, "deployments": { } }'

4. Configure your releases per logical repo

To configure your releases you just need to either ensure a release tag is created per logical component (e.g. componentname-v1.2.3) or you can use our API to send us an event identifying the release of a component.

As we know this process may create multiple components, feel free to reach out to us for dedicated support and automation

5. ℹ️ Configure your deployments per logical repo

Optional: only if you have or intent to have the deployment section enabled.

To do so

curl -X 'PUT' \ '' \ -H 'accept: application/json' \ -H 'Authorization: Bearer <TOKEN>' \ -H 'Content-Type: application/json' \ -d '{ "account": 1, "name": "frontend", "parent": "", "prs": { "labels_include": [ "component:frontend" ] }, "releases": { "branches": "{{default}}", "tags": "frontend-.*", "events": ".*", "match": "tag" }, "deployments": { "title": "frontend-\\d+-\\d+-\\d+-\\d+-\\d+" } }'

The releases part in the body should be the way you have setup releases in the UI of the product, while the deployment section should represent how your are naming your deployments when you call our Deployment API.

After all these steps are done you should be able to have more granularity and a better end to end visibility over your repository components. As this is a more advanced configuration feel free to reach out our Engineering Success team.

Did this answer your question?