-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
failed non-required checks should not fail the overarching command #44
Comments
Anyone thinking of grabbing this? I want to pick this one up please |
Just noting this down but my first approach was to get all branch protection rules for target branch but I kept getting empty objects from the api but it turns out if you don't have the relevant rights to the repo you can't view the branch protection rules (sigh this took me while to figure out). |
Sounds great. It might help to create a command-line tool in this repo - just for devs, not part of the published package - that I can use to dump API output to disk. That would allow:
|
Yeah I kept wondering if I was losing my mind and went down rabbit holes until I tried querying a repo I own (which maddens me even more the fact I didn't do that earlier). |
Some updates on my end:
I don't really like this as it requires us to waste 2 api points since non-owners cannot even view branch-protection-rules |
hm - the extra request isn't a huge deal, but you're saying that non-maintain/admin can't even see if a check is required or not? |
Yes that is correct. When you try to get branchProtectionRules object from GitHub you won't be able to return anything unless you're admin. |
aha, ok. in that case, it seems like when the user is an admin of a repo, we'd have branch protection checks, and we're set! When not, and we have a PR number, we have However, if a check hasn't completed, do we know if it's required? It's useful to know that all the required checks are done, and the only pending ones are optional. |
Good question and my bad for not clarifying that in my previous reply! The best bet is to hope the one running This is why you'll see this strange behavior when running Lastly, sftl replies in this thread when I know you're following up. |
(i'm not sure what "sftl" means) It's totally fine to start with 2 checks pending and jump to 11, eg - it's not ideal obviously, but at least it still provides the right answer. So, to reiterate: if the user is an admin, we can check branch protections and get the complete list of required checks. If the user is not an admin, we can only know about checks that have "started" (existence, or required-ness). If we have a PR number, we can get this info on the initial request; if not, we have to make an additional request to get the info. Is that accurate? |
sftl - sorry for the late. Yes that is correct! |
Sounds like a fine plan, and as robust as is possible. |
Sounds great and working on that right now. Will also open another issue afterwards as a reminder incase anything on GitHub's end changes . |
I ran
can-merge --pr=428
on ljharb/qs#428, and the two node 0.6 jobs failed (which is expected). Then the command exited with code 1.However, since all of the required jobs have passed, it should have exited with code 0.
The text was updated successfully, but these errors were encountered: