-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Only check for conflicts/merging if the PR has not been merged in the interim #10132
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10132 +/- ##
==========================================
+ Coverage 43.63% 43.64% +<.01%
==========================================
Files 576 576
Lines 79716 79718 +2
==========================================
+ Hits 34788 34789 +1
- Misses 40631 40635 +4
+ Partials 4297 4294 -3
Continue to review full report at Codecov.
|
Still CI error :P |
This might improve the chance that the race does not affect us but does not prevent it.
Finally!! Ready for re-review @lafriks @guillep2k |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow! This thing was very difficult! Sorry about the "affected rows" count not working. 😞
Here's a couple of nits. I think the pr.Issue = nil
suggestion is important.
Co-Authored-By: guillep2k <[email protected]>
This is probably a bug on xorm or the MySQL driver. |
@guillep2k no, MS SQL Server does not allow updating ID key |
Co-Authored-By: guillep2k <[email protected]>
Oh, right, because it's auto-increment. I forgot about that. |
… interim (go-gitea#10132) * Only check for merging if the PR has not been merged in the interim * fixup! Only check for merging if the PR has not been merged in the interim * Try to fix test failure * Use PR2 not PR1 in tests as PR1 merges automatically * return already merged error * enforce locking * move pullrequest checking to after merge This might improve the chance that the race does not affect us but does not prevent it. * Remove minor race with getting merge commit id move check pr after merge * Remove unnecessary prepareTestEnv - onGiteaRun does this for us * Add information about when merging occuring * More logging Co-authored-by: Lauris BH <[email protected]> Co-authored-by: guillep2k <[email protected]>
@zeripath send backport (had to do some reorder) |
… interim (#10132) (#10206) * Only check for conflicts/merging if the PR has not been merged in the interim (#10132) * Only check for merging if the PR has not been merged in the interim * fixup! Only check for merging if the PR has not been merged in the interim * Try to fix test failure * Use PR2 not PR1 in tests as PR1 merges automatically * return already merged error * enforce locking * move pullrequest checking to after merge This might improve the chance that the race does not affect us but does not prevent it. * Remove minor race with getting merge commit id move check pr after merge * Remove unnecessary prepareTestEnv - onGiteaRun does this for us * Add information about when merging occuring * More logging Co-authored-by: Lauris BH <[email protected]> Co-authored-by: guillep2k <[email protected]> * re order Co-authored-by: zeripath <[email protected]> Co-authored-by: Lauris BH <[email protected]> Co-authored-by: guillep2k <[email protected]>
The current code for checking PRs suffers from a race with being merged in the interim. This PR reduces the likelihood of this race occurring.
(We would need temporary locks and to extend the state counter for PRs to include merging etc. for this to be completely fixed.)