-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Move from max( id )
to max( index )
for latest commit statuses
#30076
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Mar 25, 2024
pull-request-size
bot
added
the
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
label
Mar 25, 2024
stevapple
force-pushed
the
fix-commit-status
branch
2 times, most recently
from
March 25, 2024 19:41
638fea7
to
1b48878
Compare
stevapple
force-pushed
the
fix-commit-status
branch
from
March 27, 2024 13:44
1b48878
to
9f94336
Compare
Ping for a review |
wxiaoguang
approved these changes
Mar 27, 2024
GiteaBot
added
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
and removed
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
labels
Mar 27, 2024
lunny
reviewed
Mar 27, 2024
lunny
approved these changes
Mar 28, 2024
GiteaBot
added
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
and removed
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
labels
Mar 28, 2024
lunny
added
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Mar 28, 2024
@lunny May it be back-ported to v1.21, or is v1.22 around the corner? |
stevapple
changed the title
Move from
Move from Mar 28, 2024
max( id )
to max ( index )
for latest commit statusesmax( id )
to max( index )
for latest commit statuses
I was unable to create a backport for 1.21. @stevapple, please send one manually. 🍵
|
GiteaBot
added
backport/manual
No power to the bots! Create your backport yourself!
and removed
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
labels
Mar 28, 2024
stevapple
added a commit
to stevapple/gitea
that referenced
this pull request
Mar 28, 2024
…o-gitea#30076) This PR replaces the use of `max( id )`, and instead using ``max( `index` )`` for determining the latest commit status. Building business logic over an `auto_increment` primary key like `id` is risky and there’re already plenty of discussions on the Internet. There‘s no guarantee for `auto_increment` values to be monotonic, especially upon failures or with a cluster. In the specific case, we met the problem of commit statuses being outdated when using TiDB as the database. As [being documented](https://docs.pingcap.com/tidb/stable/auto-increment), `auto_increment` values assigned to an `insert` statement will only be monotonic on a per server (node) basis. Closes go-gitea#30074.
silverwind
pushed a commit
that referenced
this pull request
Mar 28, 2024
…30076) (#30155) Backport #30076. This PR replaces the use of `max( id )`, and instead using ``max( `index` )`` for determining the latest commit status. Building business logic over an `auto_increment` primary key like `id` is risky and there’re already plenty of discussions on the Internet. There‘s no guarantee for `auto_increment` values to be monotonic, especially upon failures or with a cluster. In the specific case, we met the problem of commit statuses being outdated when using TiDB as the database. As [being documented](https://docs.pingcap.com/tidb/stable/auto-increment), `auto_increment` values assigned to an `insert` statement will only be monotonic on a per server (node) basis. Closes #30074.
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Mar 29, 2024
* upstream/main: Remove fomantic checkbox module (go-gitea#30162) Refactor topic Find functions and add more tests for pagination (go-gitea#30127) replace jquery-minicolors with coloris (go-gitea#30055) Add API for `Variables` (go-gitea#29520) Fix `DEFAULT_SHOW_FULL_NAME=false` has no effect in commit list and commit graph page (go-gitea#30096) Fix migration v292 (go-gitea#30153) Adjust VS Code debug filename match in .gitignore (go-gitea#30158) Prevent re-review and dismiss review actions on closed and merged PRs (go-gitea#30065) Render code tags in commit messages (go-gitea#30146) Bump `@github/relative-time-element` to v4.4.0 (go-gitea#30154) Migrate font-family to tailwind (go-gitea#30118) Move from `max( id )` to `max( index )` for latest commit statuses (go-gitea#30076) Remember login for a month by default (go-gitea#30150)
lunny
pushed a commit
that referenced
this pull request
Apr 30, 2024
Caused by #30076. There may be some duplicate status check contexts when setting status checks for a branch protection rule. The duplicate contexts should be removed. Before: <img src="https://github.com/go-gitea/gitea/assets/15528715/97f4de2d-4868-47a3-8a99-5a180f9ac0a3" width="600px" /> After: <img src="https://github.com/go-gitea/gitea/assets/15528715/ff7289c5-9793-4090-ba31-e8cb3c85f8a3" width="600px" />
Zettat123
added a commit
to Zettat123/gitea
that referenced
this pull request
Apr 30, 2024
Caused by go-gitea#30076. There may be some duplicate status check contexts when setting status checks for a branch protection rule. The duplicate contexts should be removed. Before: <img src="https://github.com/go-gitea/gitea/assets/15528715/97f4de2d-4868-47a3-8a99-5a180f9ac0a3" width="600px" /> After: <img src="https://github.com/go-gitea/gitea/assets/15528715/ff7289c5-9793-4090-ba31-e8cb3c85f8a3" width="600px" />
lunny
pushed a commit
that referenced
this pull request
Apr 30, 2024
Backport #30660. Caused by #30076. There may be some duplicate status check contexts when setting status checks for a branch protection rule. The duplicate contexts should be removed. Before: <img src="https://github.com/go-gitea/gitea/assets/15528715/97f4de2d-4868-47a3-8a99-5a180f9ac0a3" width="600px" /> After: <img src="https://github.com/go-gitea/gitea/assets/15528715/ff7289c5-9793-4090-ba31-e8cb3c85f8a3" width="600px" />
Zettat123
added a commit
to Zettat123/gitea
that referenced
this pull request
Apr 30, 2024
Caused by go-gitea#30076. There may be some duplicate status check contexts when setting status checks for a branch protection rule. The duplicate contexts should be removed. Before: <img src="https://github.com/go-gitea/gitea/assets/15528715/97f4de2d-4868-47a3-8a99-5a180f9ac0a3" width="600px" /> After: <img src="https://github.com/go-gitea/gitea/assets/15528715/ff7289c5-9793-4090-ba31-e8cb3c85f8a3" width="600px" />
lunny
pushed a commit
that referenced
this pull request
May 1, 2024
Backport #30660. Caused by #30076. There may be some duplicate status check contexts when setting status checks for a branch protection rule. The duplicate contexts should be removed. Before: <img src="https://github.com/go-gitea/gitea/assets/15528715/97f4de2d-4868-47a3-8a99-5a180f9ac0a3" width="600px" /> After: <img src="https://github.com/go-gitea/gitea/assets/15528715/ff7289c5-9793-4090-ba31-e8cb3c85f8a3" width="600px" />
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
backport/done
All backports for this PR have been created
backport/manual
No power to the bots! Create your backport yourself!
backport/v1.21
This PR should be backported to Gitea 1.21
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
modifies/go
Pull requests that update Go code
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the use of
max( id )
, and instead usingmax( `index` )
for determining the latest commit status. Building business logic over anauto_increment
primary key likeid
is risky and there’re already plenty of discussions on the Internet.There‘s no guarantee for
auto_increment
values to be monotonic, especially upon failures or with a cluster. In the specific case, we met the problem of commit statuses being outdated when using TiDB as the database. As being documented,auto_increment
values assigned to aninsert
statement will only be monotonic on a per server (node) basis.Closes #30074.