On 18 Apr 2018, at 22:57, Matthias Sohn <matthi...@gmail.com> wrote:On Wed, Apr 18, 2018 at 11:40 PM, lucamilanesio <luca.mi...@gmail.com> wrote:Hi, all Gerrit community & developers :-)This week there is the Gerrit Hackathon in Sweden and the Team is very productive ... possibly too productive?Bottom line is => we managed to "break" the stable master workflow with two changes that were verified in parallel, were not "syntactically in conflict" but, yes, semantically they were incompatible.The real-life example is:What happenedWe started with a stable master branch: all good, all working.Dave created Change Id4ad7bcdafa2 that removed the import of ProjectConfig *and* its use in the AccountIT class.So far, so good => build green. Ready to be merged.Han-Wen created Change I3a15fce564381 that leveraged the ProjectConfig class in AccountIT, adding some extra code but NOT touching the import of ProjectConfig.All good, because Dave's change hasn't been merged yet. => build green. Ready to be merged.Then ... at 4 PM ... boom. Dave pushed the "Submit" button, Han-Wen pushed the "Submit" button ... and the master became *RED*.Why did that happen?Gerrit uses "Merge if Necessary" strategy in Gerrit, which allows changes to be merged even if they aren't rebased.Dave and Han-Wen had no way to detect that their changes were semantically in a conflict between each other and then assumed that they were ready to go without having to sync with them.Our Gerrit-CI validation already validates that the *result* of the merge with the target branch works. However, the validation should remember the "target SHA1" that was tested and, if that changed, the Verified flag should be removed. We don't do that, because the submit button doesn't call the CI build before submitting the change.How to fix the problem?The safest approach IMHO would just change the Gerrit submit type to "Always rebase". The above problem would not have happened.What do you think?Did you have the same problem? How did you tackle it?to my experience this happens pretty rarely.
I guess in order to fix that auto-merge / auto-rebase on the serverneeds to reset at least the verified label and trigger another build and wait for another validation.
If that's successfulI guess the change could be auto-submitted. This should fix the problem but may lead to races with other changesin flight around the same time for the same project.
-Matthias
The documentation says:
"Rebase Always
Basically, the same as Rebase If Necessary, but it creates a new patchset even if fast forward is possible"
New PS means, if the project.config is set to do so, reset the verified flag and thus re-trigger a new CI build.
On 18 Apr 2018, at 23:13, Gert van Dijk <gert...@gmail.com> wrote:Using "Rebase Always" will have Gerrit rebase the change on-submit time, yet allows you to have out-of-date patch sets to be uploaded (and verified). Thus, "Rebase Always" will not solve the problem.
However, the "Fast foward only" prevents it, as the parent SHA1 must be the same as the target branch on submit time. That means a patch set out of change with the target branch even is never submittable. On busy target branches this means you will be hitting the rebase button very frequently and also triggering much more CI verification runs.
I believe this can't really be fixed, because you can't ask Gerrit+CI to verify all open changes in all combinations of each other as you don't know in what order they will be submitted.
A "work around" could be an additional periodic run of all open changes in a "simulated submit" state and vote -1. Apart from that it won't cover quick submissions after each other, it is also wasting a lot of resources.
In my situation I have regarded it as a residual risk, as in practise most cases will be caught already with a Merge Conflict state.
On Wednesday, 18 April 2018 23:40:20 UTC+2, lucamilanesio wrote:Hi, all Gerrit community & developers :-)This week there is the Gerrit Hackathon in Sweden and the Team is very productive ... possibly too productive?Bottom line is => we managed to "break" the stable master workflow with two changes that were verified in parallel, were not "syntactically in conflict" but, yes, semantically they were incompatible.The real-life example is:What happenedWe started with a stable master branch: all good, all working.Dave created Change Id4ad7bcdafa2 that removed the import of ProjectConfig *and* its use in the AccountIT class.So far, so good => build green. Ready to be merged.Han-Wen created Change I3a15fce564381 that leveraged the ProjectConfig class in AccountIT, adding some extra code but NOT touching the import of ProjectConfig.All good, because Dave's change hasn't been merged yet. => build green. Ready to be merged.Then ... at 4 PM ... boom. Dave pushed the "Submit" button, Han-Wen pushed the "Submit" button ... and the master became *RED*.Why did that happen?Gerrit uses "Merge if Necessary" strategy in Gerrit, which allows changes to be merged even if they aren't rebased.Dave and Han-Wen had no way to detect that their changes were semantically in a conflict between each other and then assumed that they were ready to go without having to sync with them.Our Gerrit-CI validation already validates that the *result* of the merge with the target branch works. However, the validation should remember the "target SHA1" that was tested and, if that changed, the Verified flag should be removed. We don't do that, because the submit button doesn't call the CI build before submitting the change.How to fix the problem?The safest approach IMHO would just change the Gerrit submit type to "Always rebase". The above problem would not have happened.What do you think?Did you have the same problem? How did you tackle it?Luca.
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is what the "batch" plugin is designed to help you do
efficiently. It allows you to merge changes server side for
serialized verification, and then "submitting" the exact sha1
you test.
Using "Rebase Always" will have Gerrit rebase the change on-submit time, yet allows you to have out-of-date patch sets to be uploaded (and verified). Thus, "Rebase Always" will not solve the problem.Yes, but in theory only if you have copyAllScoresOnTrivialRebase (defaulted to false). In practice, I believe you are right. The CI will be triggered anyway because you have a new PS pushed
*BUT* the validation would be useless because it could provide a -1 when the change has been merged already :-(
On 18 Apr 2018, at 23:38, Gert van Dijk <gert...@gmail.com> wrote:On Thursday, 19 April 2018 00:31:10 UTC+2, lucamilanesio wrote:Using "Rebase Always" will have Gerrit rebase the change on-submit time, yet allows you to have out-of-date patch sets to be uploaded (and verified). Thus, "Rebase Always" will not solve the problem.Yes, but in theory only if you have copyAllScoresOnTrivialRebase (defaulted to false). In practice, I believe you are right. The CI will be triggered anyway because you have a new PS pushedNo, it won't fire a patchet-created event for me, but only one of '"type":"change-merged"'.
*BUT* the validation would be useless because it could provide a -1 when the change has been merged already :-(And yes, even if you did get a patchset-created event as well it won't help you like you explained.
Hey,
Experience from a large’ish project (~100 full time devs, 5M LOC, ~200 changes per day):
1) Such semantic conflicts do occur. For us it was I think twice in ~6 years. Typically it is detected quite quickly (no developer workspace will compile anymore, tests will fail, etc. ;)) and fixed within minutes to maybe worst case one or two hours.
2) On the other hand the rebase strategies have a major drawback for us. Developers tend to fetch and rebase a lot. With merge if necessary this will fast forward in case the change is already merged. With rebase strategies, the same commit will be (tried to be) applied again and developers are confronted with conflicts. I know, we could just change the way devs work, but it’s not easy J
3) CI Builds are taking quite some time for us. With database changes, a single CI can take up to half an hour. This is a lot of time. Thinking of the ~200 changes per day on that particular project we just cannot affort spending more CI time than necessary, and will rather take the risk is hitting this issue from time to time instead.
Cheers,
Markus
--
--
To unsubscribe, email
repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 19 Apr 2018, at 06:48, Duft Markus <Marku...@ssi-schaefer.com> wrote:Hey,Experience from a large’ish project (~100 full time devs, 5M LOC, ~200 changes per day):1) Such semantic conflicts do occur. For us it was I think twice in ~6 years. Typically it is detected quite quickly (no developer workspace will compile anymore, tests will fail, etc. ;)) and fixed within minutes to maybe worst case one or two hours.
2) On the other hand the rebase strategies have a major drawback for us. Developers tend to fetch and rebase a lot. With merge if necessary this will fast forward in case the change is already merged. With rebase strategies, the same commit will be (tried to be) applied again and developers are confronted with conflicts. I know, we could just change the way devs work, but it’s not easy J
3) CI Builds are taking quite some time for us. With database changes, a single CI can take up to half an hour. This is a lot of time. Thinking of the ~200 changes per day on that particular project we just cannot affort spending more CI time than necessary, and will rather take the risk is hitting this issue from time to time instead.
--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
SSI Schäfer IT Solutions GmbH | Friesachstrasse 15 | 8114 Friesach | Austria
Registered Office: Friesach | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
From: Luca Milanesio [mailto:luca.mi...@gmail.com]
Sent: Thursday, April 19, 2018 8:57 AM
To: Duft Markus <Marku...@ssi-schaefer.com>
Cc: Luca Milanesio <Luca.Mi...@gmail.com>; Repo and Gerrit Discussion <repo-d...@googlegroups.com>
Subject: Re: Is Gerrit 'merge if necessary' strategy inherently broken?
On 19 Apr 2018, at 06:48, Duft Markus <Marku...@ssi-schaefer.com> wrote:
Hey,
Experience from a large’ish project (~100 full time devs, 5M LOC, ~200 changes per day):
1) Such semantic conflicts do occur. For us it was I think twice in ~6 years. Typically it is detected quite quickly (no developer workspace will compile anymore, tests will fail, etc. ;)) and fixed within minutes to maybe worst case one or two hours.
True, we found it quite quickly: basically everything became RED :-)
2) On the other hand the rebase strategies have a major drawback for us. Developers tend to fetch and rebase a lot. With merge if necessary this will fast forward in case the change is already merged. With rebase strategies, the same commit will be (tried to be) applied again and developers are confronted with conflicts. I know, we could just change the way devs work, but it’s not easy J
If rebase is done automatically, then no, you don't have those drawbacks.
Oh, we do! It does not matter how the rebase happens. If it is not FF, the local branch at the committers workplace will have a different commit ID, thus the rebase will try to re-apply the very same commit on top of whatever is fetched from the repository J
We even tried out the option for a few weeks, and we switched back exactly for this reason (mostly J).
On 18 Apr 2018, at 23:38, Gert van Dijk <gert...@gmail.com> wrote:On Thursday, 19 April 2018 00:31:10 UTC+2, lucamilanesio wrote:Using "Rebase Always" will have Gerrit rebase the change on-submit time, yet allows you to have out-of-date patch sets to be uploaded (and verified). Thus, "Rebase Always" will not solve the problem.Yes, but in theory only if you have copyAllScoresOnTrivialRebase (defaulted to false). In practice, I believe you are right. The CI will be triggered anyway because you have a new PS pushedNo, it won't fire a patchet-created event for me, but only one of '"type":"change-merged"'.That's a bug IMHO: if Gerrit creates a new PS and then merge it, it should generate:- patchset-created- change-merged
*BUT* the validation would be useless because it could provide a -1 when the change has been merged already :-(And yes, even if you did get a patchset-created event as well it won't help you like you explained.Not really, it would help to understand what's going on.Even if the CI feedback won't block the submission, it will be recorded on the change to say "Hey mate, that change broke the build !"It took a while for us to understand what was going on in Gerrit: I thought that our CI validation scripts were wrong .... a bit of panic :-(
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
On 19 Apr 2018, at 08:28, Åsmund Østvold <asm...@gmail.com> wrote:On Thu, Apr 19, 2018 at 12:42 AM, Luca Milanesio <luca.mi...@gmail.com> wrote:On 18 Apr 2018, at 23:38, Gert van Dijk <gert...@gmail.com> wrote:On Thursday, 19 April 2018 00:31:10 UTC+2, lucamilanesio wrote:Using "Rebase Always" will have Gerrit rebase the change on-submit time, yet allows you to have out-of-date patch sets to be uploaded (and verified). Thus, "Rebase Always" will not solve the problem.Yes, but in theory only if you have copyAllScoresOnTrivialRebase (defaulted to false). In practice, I believe you are right. The CI will be triggered anyway because you have a new PS pushedNo, it won't fire a patchet-created event for me, but only one of '"type":"change-merged"'.That's a bug IMHO: if Gerrit creates a new PS and then merge it, it should generate:- patchset-created- change-mergedIf this is introduced our CI process would need adjustments. On patchset-created event we trigger regression checkin and if the change is already merged it will fail and spam developers with messages. On change-merged we prepare binaries for test runs outside of checkin regression.
On 19 Apr 2018, at 08:28, Åsmund Østvold <asm...@gmail.com> wrote:
On Thu, Apr 19, 2018 at 12:42 AM, Luca Milanesio <luca.milanesio@gmail.com> wrote:On 18 Apr 2018, at 23:38, Gert van Dijk <gert...@gmail.com> wrote:On Thursday, 19 April 2018 00:31:10 UTC+2, lucamilanesio wrote:Using "Rebase Always" will have Gerrit rebase the change on-submit time, yet allows you to have out-of-date patch sets to be uploaded (and verified). Thus, "Rebase Always" will not solve the problem.Yes, but in theory only if you have copyAllScoresOnTrivialRebase (defaulted to false). In practice, I believe you are right. The CI will be triggered anyway because you have a new PS pushedNo, it won't fire a patchet-created event for me, but only one of '"type":"change-merged"'.That's a bug IMHO: if Gerrit creates a new PS and then merge it, it should generate:- patchset-created- change-mergedIf this is introduced our CI process would need adjustments. On patchset-created event we trigger regression checkin and if the change is already merged it will fail and spam developers with messages. On change-merged we prepare binaries for test runs outside of checkin regression.
*IF* we introduce an extra patchset-created, then it should respect the label settings for copying the score over.*IF* there is no copy max score policy, then it cannot merge automatically.
That's my idea, however, we are all here to discuss if that would be useful OR not. :-)
Luca.
*BUT* the validation would be useless because it could provide a -1 when the change has been merged already :-(And yes, even if you did get a patchset-created event as well it won't help you like you explained.Not really, it would help to understand what's going on.Even if the CI feedback won't block the submission, it will be recorded on the change to say "Hey mate, that change broke the build !"It took a while for us to understand what was going on in Gerrit: I thought that our CI validation scripts were wrong .... a bit of panic :-(--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 19 Apr 2018, at 09:03, Åsmund Østvold <asm...@gmail.com> wrote:On Thu, Apr 19, 2018 at 9:32 AM, Luca Milanesio <luca.mi...@gmail.com> wrote:On 19 Apr 2018, at 08:28, Åsmund Østvold <asm...@gmail.com> wrote:On Thu, Apr 19, 2018 at 12:42 AM, Luca Milanesio <luca.milanesio@gmail.com> wrote:On 18 Apr 2018, at 23:38, Gert van Dijk <gert...@gmail.com> wrote:On Thursday, 19 April 2018 00:31:10 UTC+2, lucamilanesio wrote:Using "Rebase Always" will have Gerrit rebase the change on-submit time, yet allows you to have out-of-date patch sets to be uploaded (and verified). Thus, "Rebase Always" will not solve the problem.Yes, but in theory only if you have copyAllScoresOnTrivialRebase (defaulted to false). In practice, I believe you are right. The CI will be triggered anyway because you have a new PS pushedNo, it won't fire a patchet-created event for me, but only one of '"type":"change-merged"'.That's a bug IMHO: if Gerrit creates a new PS and then merge it, it should generate:- patchset-created- change-mergedIf this is introduced our CI process would need adjustments. On patchset-created event we trigger regression checkin and if the change is already merged it will fail and spam developers with messages. On change-merged we prepare binaries for test runs outside of checkin regression.*IF* we introduce an extra patchset-created, then it should respect the label settings for copying the score over.*IF* there is no copy max score policy, then it cannot merge automatically.IIUC it would required for projects that has "rebase always" to have copy max score policy set to true. If no, how would we be be able to get commits in for Rebase Always and Cherry Pick? If I have understood correctly both always creates new commits on submit.
Talking with other contributors / maintainers, nobody really uses cherry-pick in production though.
Luca.