Skip to content

feat: add missing branch protection fields#2376

Closed
ruben-chainalysis wants to merge 2 commits intoPyGithub:masterfrom
ruben-chainalysis:complete-branch-protection
Closed

feat: add missing branch protection fields#2376
ruben-chainalysis wants to merge 2 commits intoPyGithub:masterfrom
ruben-chainalysis:complete-branch-protection

Conversation

@ruben-chainalysis
Copy link

Fixes #2373

Add new BranchProtection options listed here: https://developer.github.com/v3/repos/branches/

`required_linear_history`
`allow_force_pushes`
`allow_deletions`

Replica of #1723 (and like the original contributor, running the tests locally is giving me pain).

@harry-unlikelyai
Copy link
Contributor

harry-unlikelyai commented Dec 9, 2022

Can you add lock_branch to this?

Edit: Also from what I can gather, you may need to edit the tests/ReplayData to get the CI passing

@ruben-chainalysis
Copy link
Author

ruben-chainalysis commented Dec 9, 2022

Can you add lock_branch to this?

Sure, I only needed 2 of the missing ones and didn't notice there are more protections not mentioned in the original, I'll take a look, seems in scope for this (mentioning #2299 because we might fix that one too).

Edit: Also from what I can gather, you may need to edit the tests/ReplayData to get the CI passing

I'll give it a go, thanks for the suggestion! Any help with this would be appreciated, as this PR might take some time to get merged, I'm working on using requests directly as a workaround and that takes precedence.

@harry-unlikelyai
Copy link
Contributor

harry-unlikelyai commented Dec 9, 2022

I have done this now upstream from here in this PR which looks like it is passing!

Edit: Worth noting I couldn't get pytest working to update those files automatically either so I ended up just updating each file with the new fields manually

@ruben-chainalysis
Copy link
Author

Closing in favour of #2378

@ruben-chainalysis ruben-chainalysis deleted the complete-branch-protection branch January 3, 2023 10:42
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 this pull request may close these issues.

github.BranchProtection.BranchProtection missing 3 attributes

2 participants