I am working in a PR based workflow and here is the situation created
Two branches were created from master
1. branchA library changes, with its own ongoing PR
2. branchB app depending on library, with its own ongoing PR
Both are two different developers.
branchA
changes some APIs and now branchB
has to adapt to that.
branchB
has to take those changes from branchA
so that they test everything works properly after the API changes
. I am following this approach right now.
from branchB
git fetch
git merge branchA
build your code and check if your changes in branchB
is in sync with API changes from branchA
.
Issue 1 -
Next I push my changes to my PR, but now my PR has files from branchA
as well along with my changes in branchB
. This is happening because branchA
is not yet merged to master
and is still under its own PR review.
To avoid the above issue, I do the following -
I create a local copy of my changes outside the git folder, revert the merge with
git reset --hard
Now I bring those changes from local folder to git and then push it to PR.
Issue 2 -
Now Because of Continuous Integration(CI) jenkins
, both branchA
and branchB
PRs will fail the builds. To avoid this, I disable the app
build on jenkins, so that branchA
PR goes through the CI
. And then I push branchB
with app
build ON.
Question -
- How should both PRs be maintained due to dependency so that each has their own files for review.
- Is our approach in handling CI correct. i.e disable the app till the library changes get in and then push the app
- Or create
one big PR
with all the changes by merging one branch with other (after individual PRs are reviewed
) with internal discussion and then push.