argos
argos copied to clipboard
Multiple reference branches
As a user, I would like to set up multiple reference branches
Motivation
In MUI X we've started working on next major version of the library on next branch.
The previous stable version is on master branch.
Since we develop mostly on next branch, we've set Reference branch in Argos settings to next as well.
The problem we face is that as soon as there's a visual change approved on next branch, Argos will always fail on master branch, since all PRs submitted to master branch will be compared to next branch.
Detail
I imagine it working as follows - let's say we set up 2 reference branches: master and next.
Then:
- commits on
masterand PRs opened againstmasterwill usemasteras a reference branch - commits on
nextand PRs opened againstnextwill usenextas a reference branch
Hi @cherniavskii, your use case is correct, we will work on multi reference branch support soon. For now you should ignore Argos on master branch or even don't run it. I let this issue opened and I will close it when it will be supported.
@gregberge Thanks!
Implementation
The column referenceBranch in the database should no be a RegExp. We use it twice:
https://github.com/argos-ci/argos/blob/87086299dbb354feb3cc1dfa712c4d82207f1b1f/apps/build/src/createBuildDiffs.ts#L25
Easy to replace it with a RegExp.
And in the baseCompare process to find base screenshot bucket.
The second one is more complicated. If we have a RegExp, we have to get the base branch of the pull-request and rely on it.
The issue #695 is needed to get the number of the pull-request. With this number we can request pull-request information and find the base branch.
With the base branch information, we could find a base that is not considered as reference. In this case it is not a problem, we can still find a reference build on the branch. So in fact the term of "reference" branch will be only relevant to set the type of the build.
I think we can just use the branch specified in PR if the mode is set to automatic from GitHub to solve this.
- If the reference branch is inferred from GitHub
- If we have the PR number
Then we fetch the PR, got the base from it and it is done.
Hey @gregberge, any chance to have this done any time soon?
Thanks