Skip to content

fix: skip a new dry run while one is running for the same commit - #1140

Closed
TovaBecker wants to merge 2 commits into
github-community-projects:main-enterprisefrom
TovaBecker:tova.becker/fix-double-dry-run
Closed

TovaBecker wants to merge 2 commits into
github-community-projects:main-enterprisefrom
TovaBecker:tova.becker/fix-double-dry-run

Conversation

@TovaBecker

Copy link
Copy Markdown
Contributor

Why

Approach

  • createCheckRun skips when a "Safe-setting validator" check run for the same commit is queued or in progress.
  • A new commit always gets its own run, and a re-run or reopen after the earlier run has finished still starts a new one.

Validation

  • New unit tests in test/unit/index-check-run.test.js. Unit tests: 1019 passed. Integration tests: 107 passed. No new standard findings.
  • Tested manually with a local app: opening a PR right after the push gave one check run and one comment, and closing and reopening the PR after that run had finished started a new one.

Closes #1139

🤖 Generated with Claude Code

When a PR was opened within seconds of the push, check_suite.requested and pull_request.opened both started a dry run, so the PR got two identical comments (github-community-projects#1139). A new run now waits its turn: it is skipped while a Safe-setting validator check run for the commit is queued or in progress, and a re-run after it finishes still works.
The first version skipped any trigger while a run was active, so a run that never finished blocked the commit for good, a same-named check from another app blocked ours, and a failed lookup stopped the dry run. Now only the two racing events skip when this app already has a run on the commit, reopen and re-run always start a new one, and a failed lookup starts the run anyway.
@TovaBecker TovaBecker closed this Nov 10, 2026
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.

Opening a PR right after pushing runs the dry run twice and posts two comments

1 participant