-
Notifications
You must be signed in to change notification settings - Fork 18
chore: immediately post a commit check when a dry run starts #1041
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,12 @@ func (c *Controller) Process(ctx context.Context, item reconcile.Item) (reconcil | |
| agentType := dispatchCtx.JobAgent.Type | ||
| span.SetAttributes(attribute.String("agent.type", agentType)) | ||
|
|
||
| if len(result.AgentState) == 0 { | ||
| if checkErr := MaybeUpdateTargetCheck(ctx, c.getter, resultID); checkErr != nil { | ||
| span.RecordError(checkErr) | ||
| } | ||
| } | ||
|
Comment on lines
+77
to
+81
|
||
|
|
||
| planCtx, cancel := context.WithTimeout(ctx, planTimeout) | ||
| defer cancel() | ||
|
|
||
|
|
||
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 initial
MaybeUpdateTargetCheckcall can run concurrently for multiple results belonging to the same target (worker maxConcurrency > 1 and targets can have multiple agent results). SinceMaybeUpdateTargetCheckupserts via “list-by-name then create”, concurrent starts can race and create duplicate check runs / extra GitHub API traffic, and later updates may hit a non-deterministic check run ID when multiple exist. Consider adding an idempotency mechanism (e.g., persist the check_run_id per target+sha, or add a per-target lock/serialized updater, or retry create by re-listing on create failure) to ensure only one check run is created per target.