Skip to content

fix: slightly different polling termination condition#208

Merged
meorphis merged 3 commits into
mainfrom
meorphis/slightly-different-poll-loop
Mar 12, 2026
Merged

fix: slightly different polling termination condition#208
meorphis merged 3 commits into
mainfrom
meorphis/slightly-different-poll-loop

Conversation

@meorphis
Copy link
Copy Markdown
Member

use pending outcome rather than completion status, to consolidate our logic about what constitutes "pending", should be a noop for public-facing behavior, slight change for internal behavior where we don't wait for postgen if there's no diff

@meorphis meorphis requested a review from cjquines March 11, 2026 15:44
@meorphis
Copy link
Copy Markdown
Member Author

well actually I guess it would affect public-facing behavior due to

const commitCompletedMoreThanXSecsAgo = outcome.commit
? new Date().getTime() - new Date(outcome.commit.completed_at).getTime() >
ASSUME_PENDING_CHECKS_SKIPPED_AFTER_SECS * 1000
: false;
- but that is a good thing, as we do not want to spin forever in the case where we give up on a CI check

Comment thread src/runBuilds.ts Outdated
Comment on lines +343 to +346
(Object.values(outcomes).some(
(outcome) => categorizeOutcome({ outcome }).isPending,
) &&
Date.now() - pollingStart < maxPollingSeconds * 1000)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: shouldn't the parentheses go like (less || some pending) && not timed out?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhh yeah good point 👍

@cjquines
Copy link
Copy Markdown
Contributor

i think this should be fix:, because surely this is what's intended lol

Copy link
Copy Markdown
Contributor

@cjquines cjquines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with comments^

@meorphis meorphis changed the title feat: slightly different polling termination condition fix: slightly different polling termination condition Mar 12, 2026
@meorphis meorphis merged commit 319cfc9 into main Mar 12, 2026
2 checks passed
@meorphis meorphis deleted the meorphis/slightly-different-poll-loop branch March 12, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants