Skip to content
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

Wait for in progress github checks before merging #798

Open
styfle opened this issue Apr 13, 2022 · 3 comments
Open

Wait for in progress github checks before merging #798

styfle opened this issue Apr 13, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@styfle
Copy link

styfle commented Apr 13, 2022

Some repositories use GitHub Actions to dynamically create jobs based on what files changed.

In that case, we can't set those checks to "required" because it would block PRs that don't create those jobs.

However, this caused Kodiak to permaturally merge a PR while the checks were still in progress.

It would be great if there was a way to say "don't merge while any checks are in progress".

@styfle styfle added the enhancement New feature or request label Apr 13, 2022
@chdsbd
Copy link
Owner

chdsbd commented Apr 14, 2022

Hey @styfle,

Thanks for the suggestion!

On a separate project, we ran into a similar issue with GitHub Actions when using the "on.push.paths" configuration option. As a workaround, we're using https://github.com/fkirc/skip-duplicate-actions, which seems to work: https://github.com/sbdchd/squawk/blob/f8588d1daf1d09a57a1dc8d1efed49375ed0df32/.github/workflows/js.yml

We use CircleCI in Kodiak, which makes skipping jobs much easier and we have a small script to handle that:

- run:
name: skip build if no changes
command: |
./s/stop_ci_if_no_changes bot/

Anyway, I think we could add an option to support not merging until all checks have finished, but wouldn't that mean if a job failed, the PR would still be merged?

@styfle
Copy link
Author

styfle commented Apr 14, 2022

Anyway, I think we could add an option to support not merging until all checks have finished, but wouldn't that mean if a job failed, the PR would still be merged?

Hmm good point. So maybe the new option should be something like "wait for optional checks to pass" in addition to required checks.

@chdsbd
Copy link
Owner

chdsbd commented Apr 24, 2022

One catch I just realized is that the GitHub API only provides a list of required status checks, not optional status checks.

So there isn't a way for Kodiak to know the optional status checks unless we provide them manually.

Some solution would probably interact with the code here:

required_status_checks = set(branch_protection.requiredStatusCheckContexts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants