Skip to content

fix(actions): re-emit run when reusable caller cascades from skipped children - #39590

Draft
mitre88 wants to merge 1 commit into
go-gitea:mainfrom
mitre88:fix/actions-caller-skip-reemit-39587
Draft

mitre88 wants to merge 1 commit into
go-gitea:mainfrom
mitre88:fix/actions-caller-skip-reemit-39587

Conversation

@mitre88

@mitre88 mitre88 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #39587

Summary

When children of a reusable-workflow caller finish as Skipped (scheduler if:), UpdateRunJob cascades RefreshReusableCallerStatus and persists the caller as Success in the DB. The in-memory jobStatusResolver still holds the pre-cascade caller status, so a job that needs: the caller stays Pending forever and the run never completes.

Change

After applying resolver updates for a non-caller job with ParentJobID > 0, set callerCascaded and add the run to RunIDsToReEmit (same pattern as caller/matrix expansion). A follow-up pass reloads jobs and resolves dependants.

This should also unblock the stuck caller commit status described in #39586 once the run can finish.

Test

go test ./services/actions/ -count=1 -run 'Test_checkJobsOfCurrentRunAttempt_CallerCascadeReEmitsForDependants|Test_checkJobsOfCurrentRunAttempt_'

New regression: Test_checkJobsOfCurrentRunAttempt_CallerCascadeReEmitsForDependants.

AI assistance

This change was prepared with AI assistance. I reviewed the root-cause analysis in #39587, kept the patch minimal, and ran the unit tests above.

…children

When children of a reusable-workflow caller finish as Skipped,
UpdateRunJob → RefreshReusableCallerStatus updates the caller in the DB,
but the in-memory jobStatusResolver still holds the pre-cascade caller
status. Jobs that `needs:` the caller then stay Pending forever (go-gitea#39587).

Re-emit the run after such a cascade so a follow-up pass resolves
dependants (and unsticks commit status for the caller, go-gitea#39586).

Fixes go-gitea#39587
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 4, 2026
@github-actions github-actions Bot added topic/gitea-actions related to the actions of Gitea type/bug labels Oct 4, 2026
@wxiaoguang

Copy link
Copy Markdown
Contributor

@bircni

bircni commented Oct 4, 2026

Copy link
Copy Markdown
Member

Related to your PR @bircni ?

Yep
I don't see how this fixes it though

@go-gitea go-gitea deleted a comment from chatgpt-codex-connector Bot Oct 4, 2026
@wxiaoguang

Copy link
Copy Markdown
Contributor

@mitre88 what do you think? (please discuss by human but not by AI)

@wxiaoguang
wxiaoguang marked this pull request as draft October 4, 2026 13:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/gitea-actions related to the actions of Gitea type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Actions: a job that needs a reusable-workflow caller is never scheduled when the called workflow ends with skipped jobs; the run never finishes (28.0.0)

4 participants