What to do if my Merge Time is high?

Identify which team or repo

As a first step we should understand which team or repo is facing high merge times so that we can evaluate if that is expected or not given the business context and focus on them.

You can do this in the Cockpit, by switching to tabular view and sorting on merge time column.

Causes for high merge time

  • Merge Conflicts: Conflicts between the branch being merged and the main codebase can occur, particularly if the branch has been out of sync for a while. Resolving these conflicts can take time, especially in large or complex projects.

  • Multiple Stakeholder Reviews: Involving multiple stakeholders or requiring approvals from different departments can add layers of complexity and delay the merging process.

  • Technical Debt: High levels of technical debt can make merging more difficult, as changes may need to work around or refactor existing code, which can slow down the review and merge process.

  • Prioritization Issues: If reviewing and merging PRs is not prioritized, they may sit in the queue for longer, leading to higher merge times.

How to reduce merge time

  • Automate Testing and CI/CD Pipelines: Implement comprehensive automated testing (unit, integration, end-to-end) and continuous integration/continuous deployment (CI/CD) pipelines to catch issues early and streamline the merging process.

  • Use Feature Flags for Incremental Releases: Implement feature flags to merge changes incrementally, even if the full feature is not yet complete. This keeps the codebase up-to-date and reduces the risk of merge conflicts.

  • Address Merge Conflicts Early: Encourage developers to regularly rebase or merge the main branch into their feature branches to identify and resolve conflicts early.

  • Optimize Codebase for Merge Efficiency: Refactor and modularize the codebase where possible to ensure that changes in one area have minimal impact on others, reducing merge complexity.

Last updated