Repository navigation
fix(server): PR watches notify when retried Actions jobs finish #36502
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?
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 |
|---|---|---|
|
|
@@ -140,13 +140,23 @@ export function evaluatePullRequestWatch( | |
| const told = passed && passedChecks.length === 0 ? gateNames : passedChecks; | ||
| // Required checks can finish between sweeps; detect new names. With no required checks, ignore advisory gate growth. | ||
| const gateGrew = required.length > 0 && gateNames.some((name) => !told.includes(name)); | ||
| // Other checks still pending when required ones passed are owed one wake when all settle. | ||
| // Only those are owed, so later advisory churn never wakes. One turned required is gate news. | ||
| // Actions work can start after the gate passes, including same-head retries. Keep its debt | ||
| // when a workflow placeholder disappears; unrelated advisory churn still stays quiet. | ||
| const owed = | ||
| passedNow && passed | ||
| ? checks | ||
| .filter((check) => check.required !== true && owedChecks.includes(check.name)) | ||
| .map((check) => check.name) | ||
| ? [ | ||
| ...new Set([ | ||
| ...owedChecks, | ||
| ...checks | ||
| .filter( | ||
| (check) => | ||
| check.required !== true && | ||
| check.status === "pending" && | ||
| workflowRunOf(check.url) !== null, | ||
| ) | ||
| .map((check) => check.name), | ||
| ]), | ||
| ].filter((name) => !required.some((check) => check.name === name)) | ||
| : []; | ||
| const settled = | ||
| failed.length === 0 && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Emit a completion wake when optional retry debt settles with failures remaining. When the required gate has passed and optional Actions jobs are owed, a later read can show one owed job still failed while the other has succeeded. The failure keeps Emit one
|
||
|
|
||
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.
A failed unfinished-run listing must keep owed Actions debt.
When listing unfinished workflow runs fails with an error other than a rate-limit error, the provider substitutes an empty list. The read then has no pending entry for a run that is still active. If an owed Actions job is absent from that read and no other check is pending, the evaluator emits
checks-passedand clearsowedChecksbefore the retry finishes. A later job then starts new debt and produces a second completion.Handle this failure like the workflow-approval listing. On a non-rate-limit error, mark the read unavailable so it keeps an unread placeholder, and the evaluator skips settlement. Do not settle while an owed Actions run can still be active. Keep completion for owed jobs whose runs have finished, including the replacement case in
pullRequestWatch.test.tsat lines 621-707 (jobsObserved: false).