Introduce ActionRunAttempt to represent each execution of a run#37119
Draft
Zettat123 wants to merge 22 commits intogo-gitea:mainfrom
Draft
Introduce ActionRunAttempt to represent each execution of a run#37119Zettat123 wants to merge 22 commits intogo-gitea:mainfrom
ActionRunAttempt to represent each execution of a run#37119Zettat123 wants to merge 22 commits intogo-gitea:mainfrom
Conversation
3da69e5 to
7f338dd
Compare
bircni
reviewed
Apr 6, 2026
| return err | ||
| } | ||
|
|
||
| run.LatestAttemptID = runAttempt.ID |
Member
There was a problem hiding this comment.
UpdateRunAttempt calls UpdateRun again to sync status/started/stopped. That's three writes to action_run inside one transaction.
Contributor
Author
There was a problem hiding this comment.
Yes, I’ve noticed that issue as well. In this function, we need to create/update the same ActionRun record three times.
- Create the
ActionRunto getActionRun.ID - Use
ActionRun.IDto create aRunAttemptand writeRunAttempt.IDback toActionRun.LatestAttemptID - After all the jobs are created, update
ActionRun.Status(viaUpdateRunAttempt)
I'm not sure of a better way to handle this yet - any ideas are welcome.
RunAttempt to represent each execution of a runActionRunAttempt to represent each execution of a run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
ActionRunAttemptmodel and makes Actions execution attempt-scoped.Main Changes
ActionRunAttempt. The triggered jobs are then associated with this newActionRunAttemptrecord.ActionRunAttemptrecord for the workflow runActionRunJobrecords for the newActionRunAttemptrerunPlanto manage each rerun and refactored rerun flow into a two-phase plan-based model:buildRerunPlanexecRerunPlanRunAttemptID/actions/runs/{run_id})/actions/runs/{run_id}/attempts/{attempt_num})Compatibility
LatestAttemptID = 0and legacy jobs useRunAttemptID = 0. Therefore, these fields can be used to identify legacy runs and jobs and provide backward compatibility.RunAttemptID = 0.Improvements
run_attemptsemantics are now aligned with GitHub.TODO
Screenshots
Latest attempt:
Previous attempt (rerun is not allowed):
Dropdown for attempt records: