-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Cleanup ActionRun creation #35624
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
base: main
Are you sure you want to change the base?
Cleanup ActionRun creation #35624
Conversation
* share more logic
This shows how, worse the duplication is at the moment. Preparation for further refactoring. Maybe
At least the surface of doing code path specific inconsistent changes decreases and more tests cover the shared code than the specific code ever did. |
} | ||
|
||
// FIXME PERF skip this for schedule, dispatch etc. | ||
CreateCommitStatus(ctx, allJobs...) |
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.
old code conditionally didn't call this, nested function does the check
} | ||
|
||
// FIXME PERF do we need this db round trip? | ||
allJobs, err := db.Find[actions_model.ActionRunJob](ctx, actions_model.FindRunJobOptions{RunID: run.ID}) |
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 wonder why we do not use job objects that insertrun creates? This db read seems like to not bring any advantage for me.
return fmt.Errorf("LoadAttributes: %w", err) | ||
} | ||
|
||
vars, err := actions_model.GetVariablesOfRun(ctx, run) |
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.
Can we use this vars
in InsertRun
to avoid querying vars again on services/actions/run.go L112?
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.
Sounds good to me to add vars
as parameter to InsertRun
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.
Passing this as parameter to InsertRun in a5aea1b
I think that caching vars context is good to be part of an interface that is part of the passed context of the workflow run.
Co-authored-by: delvh <dev.lh@web.de> Signed-off-by: ChristopherHX <christopher.homberger@web.de>
Closes #35622