Skip to content
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

[actions] Skipped jobs are displayed as failed #23599

Closed
denyskon opened this issue Mar 20, 2023 · 4 comments · Fixed by #23786
Closed

[actions] Skipped jobs are displayed as failed #23599

denyskon opened this issue Mar 20, 2023 · 4 comments · Fixed by #23786
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Milestone

Comments

@denyskon
Copy link
Member

Description

I have a workflow file with three different jobs. The workflow is triggered by push and issue_comment events, and an if statement in the job definition decides which of the jobs gets executed by the github.event_name variable.

In the actions list (/actions?workflow=&state=closed) the action run is being displayed as successful.

grafik

When opening the log view, the skipped job is being displayed correctly, but the steps are being displayed as failed.

grafik

In the code view, the action is being displayed as failed, and in the tooltip, the skipped job is being displayed as failed.

grafik

Gitea Version

1.19.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Using the official docker image

Database

SQLite

@yardenshoham yardenshoham added the topic/gitea-actions related to the actions of Gitea label Mar 20, 2023
@a1012112796
Copy link
Member

a1012112796 commented Mar 21, 2023

that's because there are only five optional commit status now: "pending", "success", "error", "failure", and "warning"

@lunny lunny added this to the 1.19.1 milestone Mar 21, 2023
@yardenshoham
Copy link
Member

I think GitHub keeps it on "pending" https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks

We could also add a new status? "skipped"

@a1012112796
Copy link
Member

Hmm, I think whether skipped means failed should be optional for each repo.

@denyskon
Copy link
Member Author

GitHub also seems to have neutral for that, at least that's what I have seen a few times.....

jolheiser pushed a commit that referenced this issue Mar 29, 2023
Before:
<img width="353" alt="xnip_230329_163852"
src="https://user-images.githubusercontent.com/9418365/228479807-424452df-10fa-45cf-ae4b-09939c0ed54c.png">
After:
<img width="508" alt="xnip_230329_163358"
src="https://user-images.githubusercontent.com/9418365/228479923-537b54fe-9564-4105-a068-bcc75fa2a7ea.png">

Highlights:
- Treat `StatusSkipped` as `CommitStatusSuccess` instead of
`CommitStatusFailure`, so it fixed #23599.
- Use the bot user `gitea-actions` instead of the trigger as the creator
of commit status.
- New format `<run_name> / <job_name> / (<event>)` for the context of
commit status to avoid conflicts.
- Add descriptions for commit status.
- Add the missing calls to `CreateCommitStatus`.
- Refactor `CreateCommitStatus` to make it easier to use.
denyskon pushed a commit to denyskon/gitea that referenced this issue Apr 11, 2023
Refactor commit status for Actions jobs (go-gitea#23786)

Before:
<img width="353" alt="xnip_230329_163852"
src="https://user-images.githubusercontent.com/9418365/228479807-424452df-10fa-45cf-ae4b-09939c0ed54c.png">
After:
<img width="508" alt="xnip_230329_163358"
src="https://user-images.githubusercontent.com/9418365/228479923-537b54fe-9564-4105-a068-bcc75fa2a7ea.png">

Highlights:
- Treat `StatusSkipped` as `CommitStatusSuccess` instead of
`CommitStatusFailure`, so it fixed go-gitea#23599.
- Use the bot user `gitea-actions` instead of the trigger as the creator
of commit status.
- New format `<run_name> / <job_name> / (<event>)` for the context of
commit status to avoid conflicts.
- Add descriptions for commit status.
- Add the missing calls to `CreateCommitStatus`.
- Refactor `CreateCommitStatus` to make it easier to use.
techknowlogick pushed a commit that referenced this issue Apr 12, 2023
Backport #23786

Refactor commit status for Actions jobs (#23786)

Highlights:
- Treat `StatusSkipped` as `CommitStatusSuccess` instead of
`CommitStatusFailure`, so it fixed #23599.
- Use the bot user `gitea-actions` instead of the trigger as the creator
of commit status.
- New format `<run_name> / <job_name> / (<event>)` for the context of
commit status to avoid conflicts.
- Add descriptions for commit status.
- Add the missing calls to `CreateCommitStatus`.
- Refactor `CreateCommitStatus` to make it easier to use.

Co-authored-by: Jason Song <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants