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

provider/github: Implements github_branch_protection #10476

Merged
merged 1 commit into from
Apr 20, 2017

Conversation

alindeman
Copy link
Contributor

This PR introduces a new resource, github_branch_protection, that configures branch protection for a given repository and branch.

The API required in go-github landed in google/go-github#476 and are included in a single commit a2da126 in this branch.

The Protected Branches API is still in a preview period, meaning it may change (including breaking changes). I'm open to keeping this PR open until it stabilizes, but I could also see it being useful to folks now (with a warning that it is not fully stable). I'm open to hearing feedback on that point.

/cc: @sr

@jason-riddle
Copy link
Contributor

Any update to this?

@alindeman alindeman force-pushed the github-branch-protection branch 3 times, most recently from 329e810 to df280ec Compare March 27, 2017 13:22
@alindeman
Copy link
Contributor Author

@stack72 @jason-riddle I've rebased this on 0.9.1 and added support for required_pull_request_reviews. This is ready for some feedback/review if anyone has a chance ❤️

@alindeman
Copy link
Contributor Author

I resolved new conflicts and rebased on 0.9.3. Any feedback @stack72 @mbfrahry? :)

@stack72
Copy link
Contributor

stack72 commented Apr 16, 2017

Hi @alindeman

Thanks for the work here - can you tell me if this is still in preview?

P.

Copy link
Contributor

@stack72 stack72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @alindeman

This LGTM! I have 1 question inline that we can fix up at another time if necessary :)

Paul


githubProtection, _, err := client.Repositories.GetBranchProtection(context.TODO(), meta.(*Organization).name, r, b)
if err != nil {
d.SetId("")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to refresh from state on every error ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stack72 Thanks for pointing this out. I think it would be frustrating to have the item cleared from state on, say, a network issue or timeout. I've proposed a more narrow version over in #13887

@stack72 stack72 merged commit 28d71e6 into hashicorp:master Apr 20, 2017
@ghost
Copy link

ghost commented Apr 13, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants