-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Keeping consistent between UI and API about combined commit status state and fix some bugs #34562
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
Merged
Conversation
This file contains hidden or 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
7f22185
to
1ad800d
Compare
silverwind
approved these changes
Jun 6, 2025
hiifong
approved these changes
Jun 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
modifies/api
This PR adds API routes or modifies them
modifies/go
Pull requests that update Go code
type/bug
type/refactoring
Existing code has been cleaned up. There should be no new functionality.
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.
Extract from #34531
Move Commit status state to a standalone package
Move the state from
structs
tocommitstatus
package. It also introduceCommitStatusStates
so that the combine function could be used from UI and API logic.Combined commit status Changed
This PR will follow Github's combined commit status. Before this PR, every commit status could be a combined one.
According to https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#get-the-combined-status-for-a-specific-reference
This PR will follow that rule and remove the
NoBetterThan
logic. This also fixes the inconsistent between UI and API. In the API convert package, it has implemented this which is different from the UI. It also fixed the missingURL
andCommitURL
in the API.CalcCommitStatus
return nil if there is no commit statusesThe behavior of
CalcCommitStatus
is changed. If the parameter commit statuses is empty, it will return nil. The reference places should check the returned value themselves.