-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fix job status aggregation logic #34823
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 job status aggregation logic #34823
Conversation
You can add (or fix) a test case here: |
specifically modify one here: gitea/models/actions/run_job_status_test.go Lines 67 to 69 in 182cdd3
I'm not sure that this is a right fix, more that github does it weirdly in this case. Unless entire workflow can recover from the failure (which I don't know if it's possible) I think we do this correctly now. I don't think the fix is complete though as there's still the case of the |
- Updated the condition for returning `StatusFailure` to ensure it only occurs when all jobs are done.
182cdd3
to
8726113
Compare
Hmm, I also have the question: should we report the failure as soon as possible? IMO the old behavior (reporting failure as soon as possible) is better to end users. If a job fails, then the final status must be also "failed". Reporting failure to users early can tell them "there is something" in first time, no need to wait all jobs finishes. |
Or maybe we can introduce a new status like running with part failure. |
I think that would be the best solution. That way UI can indicate that run has already failed BUT there's something still pending. |
It sounds a strong reason. So I think we can write the details into comment, and use this solution, and backport. Leave more improvements to the future. |
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.
This could be another PR
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Merged now, let's see whether we should continue changing the priority, then never make the "failure" win other status. Maybe something related:
Open for discussion. |
|
Why? "waiting" is similar to "running" in this case and the "waiting" will be come "running" sooner or later. |
Hmm, it's also strange to me. According to my experience, GitHub still makes failure have higher priority. It is what I have seen for the latest 1.24 branch:
I suspect there are some problems in this PR or the whole design (ps: I don't really use Actions so I can't comment more or spend more time on it) |
I think other CI/CDs should have the similar problems? |
My brief understanding of the problem is (just my guess, some of my previous comments might be not right): GitHub has 2 kinds of "aggregation logic"
If I understand correctly, Gitea also has 2 kinds of "aggregation logic", the same to GitHub.
So, overall this change should be fine. |
* giteaofficial/main: [skip ci] Updated translations via Crowdin Add issue delete notifier (go-gitea#34592) Refactor "change file" API (go-gitea#34855) Fix some log and UI problems (go-gitea#34863) Update go tool dependencies (go-gitea#34845) Fix archive API (go-gitea#34853) Update `uint8-to-base64`, remove type stub (go-gitea#34844) Refactor repo contents API and add "contents-ext" API (go-gitea#34822) [skip ci] Updated translations via Crowdin fix(issue): Replace stopwatch toggle with explicit start/stop actions (go-gitea#34818) Remove unused variable HUGO_VERSION (go-gitea#34840) Fix SSH LFS timeout (go-gitea#34838) Ignore force pushes for changed files in a PR review (go-gitea#34837) Fix log fmt (go-gitea#34810) Fix team permissions (go-gitea#34827) Fix job status aggregation logic (go-gitea#34823) [skip ci] Updated translations via Crowdin correct migration tab name (go-gitea#34826) Refactor template helper (go-gitea#34819)
Fix #34821 by checking if all the jobs are done before set status to fail
