A monorepo is a software development strategy where code for many projects is stored in the same repository. With the nature of many projects being stored in a single place, tracking monorepo's can be tricky.

This article will cover different methods to help get more insights from monorepo's.

How do measure Cycle Time in monorepo?

Most monorepo's have top-level folders dividing each project into its own path. An example structure would be like the following:

projectA/
projectB/
projectC/
...
README.md

The first thought would be analyzing be folder and file paths. Even though Haystack does not read source code, we can achieve this by using certain tools.

Github Labeler is a tool that would automatically label each pull request with certain rules. Adding the following rule will automatically add a label myProjectName to every pull request which has edited a code from the folder.

...

myProjectName:
- projectA/*

...

With labels setup correctly, you can

  1. Exclude projects by label

  2. Apply filters by label

If there is a clean project structure, this method should handle verticals. However, if the monorepo has many cross-project work going on (horizontals), then this method might not satisfy.

  • We recommend settings Teams and applying filters by team.

  • We have seen a few teams tracking horizontals is filtering by branch.

Note: Branch filtering requires process changes inside your company

How do measure Deployments in monorepo?

Haystack allows different ways to configure deployments. For monorepo's we have seen multiple ways of tracking.

We recommend having a consistent deployment method across all projects simplifying DevOps, CI, CD, and measuring these projects.

  • git tag: with this method, you can tag your deployment commits like v1.2.3 and Haystack can calculate deployments accurately for that project. We'd recommend tagging more specific like ProjectA-v1.2.3 clearing out any confusion when diving deeper into deployments.

  • merged into branch: with this method, you can assume any pull request merged into a default branch like master can be counted as deployments

  • containing label: with this method, you can label deployment pull requests as deployment allowing Haystack to know the differences.

Once the deployment method is standardized, filtering by that project would show accurate metrics for that project.

For more information, you can check

If none of these methods work your use case, reach us at [email protected] and our team will help support your needs!

Did this answer your question?