-
-
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
Fix wrong hint when status checking is running on pull request view #9886
Conversation
modules/structs/commit_status.go
Outdated
) | ||
|
||
// IsWorseThan returns true if this State is worse than the given State | ||
func (css CommitStatusState) IsWorseThan(css2 CommitStatusState) bool { |
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.
IsWorseOrSameAs()
maybe?
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.
Or NoBetterThan ? :)
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.
Or NoBetterThan ? :)
NoBetterThan
sounds good too. My problem was that the old name implied <
but the function acts like <=
.
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.
Hmm... It looks like there is a genuine total order here. An alternative might be:
type CommitStatus int
const (
CommitStatusPending CommitStatus = 0
...
)
func (c CommitStatus) String() {
switch c {
case CommitStatusPending:
return "pending"
...
}
}
Then just use normal operators for the state.
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.
@zeripath I will left this other PRs to keep this PR clear.
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.
@guillep2k done.
0f4fb39
to
4312976
Compare
Codecov Report
@@ Coverage Diff @@
## master #9886 +/- ##
=========================================
Coverage ? 42.28%
=========================================
Files ? 608
Lines ? 79392
Branches ? 0
=========================================
Hits ? 33570
Misses ? 41680
Partials ? 4142
Continue to review full report at Codecov.
|
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.
dont mix api&struct import ...
4312976
to
3320ba5
Compare
…o-gitea#9886) * Fix wrong hint when status checking is running on pull request view * fix lint * fix test * fix test * fix wrong tmpl * fix import * rename function name
lable: backport/done |
When all required status check were running, it will display some required status check failed.
This PR will fix that. There are more states to check about the status check.
Fix #9394