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

Error "Pull request is in clean status" #343

Closed
williamboman opened this issue Jun 14, 2022 · 11 comments
Closed

Error "Pull request is in clean status" #343

williamboman opened this issue Jun 14, 2022 · 11 comments

Comments

@williamboman
Copy link
Contributor

Hello! I'm trying to add this to one of my repos and I'm running into this error when trying run the action. The full workflow file can be found here. I couldn't really find anything on the internets, do you perhaps have any ideas what might be going wrong? My best guess is that it's attempting to enable automerge before it's ready (definition of ready being: no checks have been registered with the PR yet)

@adrianioana
Copy link

Hi. @williamboman I am also getting a similar error :(
Error: ["Pull request Pull request is in unstable status"]

@peter-evans
Copy link
Owner

Hi @williamboman

I've not seen this error before. Is it happening consistently, or just occasionally?

My best guess is that it's attempting to enable automerge before it's ready

You could try waiting a few seconds in a workflow step to see if that solves it. Perhaps there is a small delay on GitHub's side before the PR is ready, as you suggest.

@williamboman
Copy link
Contributor Author

What do you think about doing this inside this workflow instead? I feel like it'd be neat if one did not have to worry about these race conditions. I've come up with a somewhat naive approach in #344. Wdyt?

@williamboman
Copy link
Contributor Author

williamboman commented Jun 15, 2022

So I actually debugged this a bit closer and I don't believe this is happening because of some race condition, there has to be something else going on. I added a retry mechanism that sleeps for 30s before retrying, but it's still consistently failing with the same error, even if the PR checks are all registered and even completed.

@williamboman
Copy link
Contributor Author

I think I know what it might've been. I had not made any checks explicitly required under the repo settings - I had only enabled the checkbox itself. If you don't manually add specific checks that are required I believe GitHub's native automerge feature simply doesn't apply

Screenshot 2022-06-16 at 01 42 51

"

@peter-evans
Copy link
Owner

Ah, yes. You must have at least one required check set.

It's mentioned in the "conditions" section here.
https://github.com/peter-evans/enable-pull-request-automerge#conditions

The clean status error makes sense now. The pull request had no pending checks and was already able to be merged. I think this error message is new, because when I was developing the action and testing it I never saw that message. Previously, I think it just failed silently.

@williamboman
Copy link
Contributor Author

williamboman commented Jun 16, 2022

Thos are pretty bad error messages from their API if you ask me 🙈, it had me running in circles. Would you be open for parsing these error messages or even wrapping the entire exception with a custom error message, like:

catch (e) {
  core.error("Unable to enable automerge. Make sure you have enabled branch protection with at least one status check marked as required. See https://github.com/peter-evans/enable-pull-request-automerge#conditions for more information.")
  throw e
}

@peter-evans
Copy link
Owner

I would be happy to parse and capture the clean status error, because I think we can be fairly confident about what that means and how it occurs. I would prefer to capture and handle that one specifically, rather than output a custom error message for all exceptions.

@williamboman
Copy link
Contributor Author

Cool! I went ahead and implemented it in #345! Not sure if you want logging in the helper module, but that's where I'd put it.

@peter-evans
Copy link
Owner

Merged and released. Thanks!

I think we can consider this closed. If other error messages emerge we can handle those separately.

@Haegi
Copy link

Haegi commented Aug 31, 2022

Hi all,

I am facing this issue. Even with all conditions met.
It works when using it in a simple github action but in a composite action it fails with:

Error: Unable to enable automerge. Make sure you have enabled branch protection with at least one status check marked as required. See https://github.com/peter-evans/enable-pull-request-automerge#conditions for more information.
Error: Request failed due to following response errors:
 - ["Pull request Pull request is in clean status"]

Maybe it is also related to the fact that the composite action is located in the same repo, where it should open a PR but still it is kind of confusing.

Do you maybe have a an idea?

Quick update: The Pull request was opened against some branch, which did not have any branch protection. It works now.

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 a pull request may close this issue.

4 participants