Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using the --batch feature the commit hashes that end up on master are not the same hashes that tests were run on #164

Closed
Dalamar42 opened this issue Mar 6, 2019 · 0 comments · Fixed by #264

Comments

@Dalamar42
Copy link
Contributor

Our workflow

First to explain our workflow so the issue makes sense:

Each run of our CI produces docker images that are tagged with the commit of the respective HEAD. Those images are then published to our internal docker registry and are what is shipped to production.

Our CI contract has three strong assumptions:

  1. CI is green on every branch before that branch is merged on master
  2. everything on master is immediately shippable
  3. we ship exactly what we test.

Issue

When using the --batch feature the commit hashes that end up on master are not the same hashes that tests were run on. The workflow currently looks like this:

  1. CI runs on individual branches and they are assigned to Marge
  2. Marge creates a batch branch
  3. CI runs on the batch branch and passes
  4. Marge rebases original MRs on master and applies trailers (reviewed-by, etc.) (not sure about the ordering here)
  5. Marge merges on master

With this workflow, at the time that the branches are merged on master CI has been run against the HEADs of the original branches as well as the HEAD of the batch branch. However, that may not be the same commit hash as the HEAD of master after this process is complete.

This issue breaks the second part of our CI contract. As no CI has been run on the current HEAD of master there are no images associated with it and we need to wait for CI to run once more on master after the merge for this commit to be shippable.

To avoid this issue what we would like is for the commit hashes that end up on master to be the same as those that were tested on the batch branch.

Proposal

  1. Marge creates a batch branch
  2. Apply trailers optimistically
  3. Run CI on batch branch
  4. If it succeeds, rewrite the original branches by cherry-picking the commits from the batch branch and merge them

In the unlikely case the trailers have changed on any one of the original branches (e.g. the list of approvers has changed) abort the batch.

deibido pushed a commit to deibido/marge-bot that referenced this issue Apr 2, 2020
Fix for issue smarkets#164.

Previously we added trailers to each MR and
merged the constituent MRs of a batch MR to
the target branch.
Now we will now optimistically add the trailers
to each MR and rebase on the batch branch. And
when the batch branch passes CI we merge it
which will automatically merge each constituent
branch.
deibido pushed a commit to deibido/marge-bot that referenced this issue Apr 3, 2020
Fix for issue smarkets#164.

Previously we added trailers to each MR and
merged the constituent MRs of a batch MR to
the target branch.
Now we will now optimistically add the trailers
to each MR and rebase on the batch branch. And
when the batch branch passes CI we merge it
which will automatically merge each constituent
branch.
deibido pushed a commit to deibido/marge-bot that referenced this issue Apr 3, 2020
Fix for issue smarkets#164.

Previously we added trailers to each MR and
merged the constituent MRs of a batch MR to
the target branch.
Now we will now optimistically add the trailers
to each MR and rebase on the batch branch. And
when the batch branch passes CI we merge it
which will automatically merge each constituent
branch.
deibido pushed a commit to deibido/marge-bot that referenced this issue Apr 3, 2020
Fix for issue smarkets#164.

Previously we added trailers to each MR and
merged the constituent MRs of a batch MR to
the target branch.
Now we will now optimistically add the trailers
to each MR and rebase on the batch branch. And
when the batch branch passes CI we merge it
which will automatically merge each constituent
branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant