Repository navigation
fix(server): wake PR watches when CI fails during the baseline gap #39094
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 |
|---|---|---|
|
|
@@ -126,8 +126,11 @@ const make = Effect.gen(function* () { | |
| if (watching && before?.snapshot?.state === "merged") { | ||
| return yield* new PullRequestNotOpenError({ state: "merged" }); | ||
| } | ||
| // When CI was still running (or the rollup was unread) at watch start, seed checksPending so | ||
| // a failure that lands before the first reactor sweep is reported instead of baselined away. | ||
| let checksPendingAtStart: boolean | undefined; | ||
| if (watching && before?.watch === undefined) { | ||
| yield* pullRequests | ||
| checksPendingAtStart = yield* pullRequests | ||
| .summary( | ||
| { | ||
| projectId: thread.projectId, | ||
|
|
@@ -142,11 +145,14 @@ const make = Effect.gen(function* () { | |
| Effect.flatMap((summary) => | ||
| summary.state === "merged" | ||
| ? Effect.fail(new PullRequestNotOpenError({ state: "merged" })) | ||
| : Effect.void, | ||
| : Effect.succeed( | ||
| // Unknown rollup: prefer pending so a fast fail still wakes. | ||
| summary.checksState === "pending" || summary.checksState == null, | ||
|
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. Seed The seed reads only the aggregate
|
||
| ), | ||
| ), | ||
| Effect.catchTags({ | ||
| // Host and transport errors can recover while the watch is active. | ||
| PullRequestOperationError: () => Effect.void, | ||
| PullRequestOperationError: () => Effect.succeed(true as const), | ||
| }), | ||
| ); | ||
| } | ||
|
|
@@ -162,6 +168,9 @@ const make = Effect.gen(function* () { | |
| watching, | ||
| ...(watching ? { link: { url: target.url, source: "agent" as const } } : {}), | ||
| ...(watching && input.until !== undefined && { until: input.until }), | ||
| ...(watching && checksPendingAtStart !== undefined | ||
| ? { checksPending: checksPendingAtStart } | ||
| : {}), | ||
| }) | ||
| .pipe( | ||
| Effect.catchCause((cause) => | ||
|
|
||
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.
Do not discard failures while another check remains pending.
If both checks are pending at startup, lint can fail before the first sweep while test remains pending.
!checksPendingsuppresses lint's failure, but Line 94 records lint infailedChecksand the returned state clearsawaitingBaseline.If test then succeeds,
newlyFailedis empty. Lint's failure is never reported. This leaves the startup race unfixed for multi-check CI.Report new failures for the pending-start seed immediately, or retain unreported failures until settlement. Preserve baseline suppression for
checksPending: false. Extend the existing test with this second sweep.