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

Branch protection settings don't work for wildcards #227

Open
iphydf opened this issue Apr 24, 2020 · 16 comments
Open

Branch protection settings don't work for wildcards #227

iphydf opened this issue Apr 24, 2020 · 16 comments
Labels
pinned requires API changes It is currently not possible to configure this option through the API

Comments

@iphydf
Copy link

iphydf commented Apr 24, 2020

Problem Description

Setting "name" to "*" in "branches:" doesn't do anything. Github supports wildcard matching of branches, and I'd like to be able to (I do, in my manual settings) apply branch protection rules to all branches in a repo.

What is actually happening

Nothing.

What is the expected behavior

A branch protection rule with "*" as name should appear.

Error output, if available

Question: where would I see the errors?

Context

Are you using the hosted instance of probot/settings or running your own?

Hosted.

@iphydf iphydf added the bug label Apr 24, 2020
@travi
Copy link
Member

travi commented Apr 24, 2020

please be sure to look for similar issues when reporting problems. it sounds like this is a similar problem to what was reported in #136. are there any details in there that might help you get past this issue.

I havent had time to diagnose this issue very far, but if you dig deep enough to identify further details around the problem, i'm happy to guide further and would certainly be open to a PR if we can get far enough to decide what would help here. if you are able to confirm whether it works through the api outside of the settings app, such as with a curl request, that would be a huge help.

Question: where would I see the errors?

good question. since you mentioned using the hosted version, you wouldn't see them currently. this is why we ask whether you use the hosted version vs run your own. if you were running your own, you would have access to logs for your instance and could include details from there. one of the other high priority improvements planned is to include some of these details as part of check runs, so that you can see the reason for failures, even if you are using our hosted version.

@iphydf
Copy link
Author

iphydf commented Apr 24, 2020

The solution is probably similar. TBH if I look at the github API docs, it doesn't look like they have support for this (the API call is something like /.../:branch/..., indicating that the branch must exist - the wildcard feature was added later, and it seems the API hasn't adapted yet), so there isn't much you can do right now other than contacting github about this feature request.

@travi
Copy link
Member

travi commented Apr 24, 2020

there isn't much you can do right now other than contacting github about this feature request.

unfortunately, this is somewhat common with requests for additions to the settings app. i would encourage reaching out to github support with requesting the addition. if you get a useful response back, please include the details in appropriate issues here so we better understand the status.

@travi travi added requires API changes It is currently not possible to configure this option through the API and removed bug labels Apr 24, 2020
@mkrakowitzer
Copy link

I don't believe this is an API issue, I tested this now and the API supports wildcards

mutation MyMutation {
  __typename
  createBranchProtectionRule(input: {repositoryId: "XXXXXXXXXXXXXXXXXX", pattern: "foobar*", restrictsPushes: false}) {
    clientMutationId
  }
}

This is the same for #136, also works fine with the graphql API.

@stale
Copy link

stale bot commented Aug 29, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

@stale stale bot added the wontfix label Aug 29, 2020
@travi travi added the pinned label Aug 29, 2020
@stale stale bot removed the wontfix label Aug 29, 2020
@sagarvsh
Copy link

Hi All,

This is one of the features which we are badly waiting for. We use wildcards extensively to protect branches today, for example, any branch starting with release should be automatically protected. This is a critical feature in very rapid development repositories where more developers are actively working on. Adoption of settings bot in our organization has been very successful so far except for the most critical repositories, just because of this missing feature.

@travi
Copy link
Member

travi commented Aug 30, 2020

this is functionality that i would very much like to see as well, but as a single maintainer, time has been tight for working on features like this. if this is important to you, i encourage you to work on adding the functionality and submit a pull-request. i'm happy to help you work through the details along the way if you decide to make such a contribution.

@dennisroche
Copy link

dennisroche commented Aug 23, 2021

This is the same for #136, also works fine with the graphql API.

so, it looks like we need to use graphql endpoint. can the bot already do that?

edit: doesn't appear so. @travi would you support adding graphql to the bot? i can contribute the change if you can review...

https://docs.github.com/en/graphql/guides/migrating-from-rest-to-graphql

@bwalding
Copy link

Has anyone done this work on the side (and perhaps not contributed it back for integration) - it's causing sufficient irritation to us in our workflow that I'll have one of my team implement this if necessary.

(We currently have custom code that uses the GraphQL mutation to do the work - but it's becoming annoying having probot for some repos, and custom code for others).

@electriquo
Copy link

@bwalding

I'll have one of my team implement this if necessary

Did your team done it? Is there any related PR?

@dan-ih
Copy link

dan-ih commented Dec 22, 2022

Any progress here?

@electriquo
Copy link

We need to cast our votes on Update branch protection wildcard on GitHub API and Webhooks feedback

@bwalding
Copy link

bwalding commented Jan 6, 2023

@bwalding

I'll have one of my team implement this if necessary

Did your team done it? Is there any related PR?

There wasn't any feedback from a maintainer - so I figured no real appetite for implementing.

@electriquo
Copy link

@bwalding Please consider solving the community pain once and for all :)

@iphydf
Copy link
Author

iphydf commented Nov 23, 2023

What's needed to implement this? Is it difficult?

@ctoestreich
Copy link

I added a spike to support this but beyond the unit testing I am not sure how to test this

#982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned requires API changes It is currently not possible to configure this option through the API
Projects
None yet
Development

No branches or pull requests

9 participants