Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git-bisect, but for N repos

Our software is modular and I have about 20 git repos in one project.

If a test fails, it is sometimes hard to find the matching commit since several developers work on these 20 repos.

I know the test worked yesterday and fails reproachable today.

Sometimes I use git-bisec, but this works only for one git repo.

Often changes in two git repos make a test fail.

I could write a dirty script which loops over my N git repos myself, but before doing so, I would like to know how experts would solve this.

I use Python, Django and pytest, but AFAIK this does not matter for this question.

like image 484
guettli Avatar asked Dec 09 '16 09:12

guettli


People also ask

Is git bisect useful?

The git bisect command is used to discover the commit that has introduced a bug in the code. It helps track down the commit where the code works and the commit where it does not, hence, tracking down the commit that introduced the bug into the code.

How do I stop bisecting?

To end the bisect session at any point, run git bisect reset. Mark the current commit (HEAD) as bad with git bisect bad.

What is git bisect command?

git bisect help. This command uses a binary search algorithm to find which commit in your project's history introduced a bug. You use it by first telling it a "bad" commit that is known to contain the bug, and a "good" commit that is known to be before the bug was introduced.

How do I remove a bad commit in git bisect?

Use Git Bisect to find the commit in which line 2 is changed from 'b = 20' to 'b = 0.00000'. Remove the bad commit by using Git Revert. Leave the commit message as is. Push to the remote repository.


2 Answers

I personally prefer to use repo tool to manage complex projects. Put those 20 repos in manifest.xml and each time when build starts create patch manifest if build fails do repo diff manifests to see what was changed and where.

like image 94
Filip Stefanov Avatar answered Oct 11 '22 23:10

Filip Stefanov


There is category of QA tool for "reverse dependency" CI builds. So your higher level projects get rebuilt every time a lower level change is made. At scale it can be resource intensive.

The entire class of problem is removed if you stop dealing with repo-to-repo relationships and start following version release methodology for the subcomponents. Then you can track the versions of lower-level dependencies and know when you go to upgrade that it broke. Your CI could build against several versions of dependencies if you wanted to systematize it.

Git submodules accomplish that tracking for individual commits, so you again get to decide when to incorporate changes from lower levels. (Notably, that can also be used like released versions if you only ever update to tagged release commits.)

like image 37
Joe Atzberger Avatar answered Oct 12 '22 01:10

Joe Atzberger