-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Improve Actions status aggregations #32860
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
Conversation
Is Unknown a status which should change the final result? For example combination |
Good catch, added more cases and comments in f438b56 |
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.
LGTM
I'll check how Github treats all skipped workflows later.
{[]Status{StatusFailure, StatusWaiting}, StatusFailure}, | ||
{[]Status{StatusFailure, StatusRunning}, StatusFailure}, | ||
{[]Status{StatusFailure, StatusBlocked}, StatusFailure}, | ||
|
||
// skipped with other status | ||
{[]Status{StatusSkipped}, StatusSuccess}, | ||
// TODO: need to clarify whether a PR with "skipped" job status is considered as "mergeable" or not. |
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.
I would say yes:
As I see it, a skipped job is mainly something like execute on hardware xy, but it wasn't available
. Or perhaps something like only execute once a month
. Still, that doesn't prevent the PR from merging.
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.
Confirmed, skips are treated as a pass:
TheFox0x7/repro#1
And cancellations as fails:
TheFox0x7/repro#2
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.
The "actions status to commit status" converting seems consistent:
gitea/services/actions/commit_status.go
Lines 143 to 154 in 22c4599
func toCommitStatus(status actions_model.Status) api.CommitStatusState { | |
switch status { | |
case actions_model.StatusSuccess, actions_model.StatusSkipped: | |
return api.CommitStatusSuccess | |
case actions_model.StatusFailure, actions_model.StatusCancelled: | |
return api.CommitStatusFailure | |
case actions_model.StatusWaiting, actions_model.StatusBlocked, actions_model.StatusRunning: | |
return api.CommitStatusPending | |
default: | |
return api.CommitStatusError | |
} | |
} |
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.
Updated the comment in #32861 (with more trivial fixes)
Let's merge this as-is since 1.23 is releasing soon. We can do more improvements in the future if we have new ideas and samples. |
Make the result the same as GitHub: