Skip to content
This repository has been archived by the owner. It is now read-only.

[DM-10133] Update github3.py protection API. #1

Merged
merged 1 commit into from Apr 13, 2017

Conversation

@jmatt
Copy link

commented Apr 12, 2017

The new GitHub v3 branches protection API has been updated. This implements the current documented API.

See Also

https://developer.github.com/changes/2017-03-22-protected-branches-admin-improvements/

https://developer.github.com/changes/2017-04-11-protected-branch-dismissal-restrictions/

Update Branch <github3.repos.branch.Branch>.

  • Make protection a method.
  • Update protect.
  • Update unprotect.

Add Protection <github3.repos.branch.Protection>.

  • Get branch protection
  • Update branch protection
  • Remove branch protection (delete)
  • Get required status checks of protected branch
  • Get pull request review enforcement of protected branch
  • Get admin enforcement of protected branch
  • Get restrictions of protected branch

Add RequiredStatusChecks <github3.repos.branch.RequiredStatusChecks>

  • Update required status checks of protected branch
  • Remove required status checks of protected branch (delete)
  • List required status checks contexts of protected branch
  • Replace required status checks contexts of protected branch
  • Add required status checks contexts of protected branch
  • Remove required status checks contexts of protected branch (delete_contexts)

Add RequiredPullRequestReviews <github3.repos.branch.RequiredPullRequestReviews>

  • Update pull request review enforcement of protected branch
  • Remove pull request review enforcement of protected branch (delete)

Add EnforceAdmins <github3.repos.branch.EnforceAdmins>

  • Add admin enforcement of protected branch
  • Remove admin enforcement of protected branch

Add Restrictions <github3.repos.branch.Restrictions>

  • Remove restrictions of protected branch
  • List team restrictions of protected branch
  • Replace team restrictions of protected branch
  • Add team restrictions of protected branch
  • Remove team restrictions of protected branch
  • List user restrictions of protected branch
  • Replace user restrictions of protected branch
  • Add user restrictions of protected branch
  • Remove user restrictions of protected branch

TODOs

Tests

  • Update existing Branch tests.
  • Add Protection tests.
  • Add RequiredStatusChecks tests.
  • Add RequiredPullRequestReviews tests.
  • Add EnforceAdmins tests.
  • Add Restrictions tests.

Push LSST SQuaRE version

  • Pypi version: sqre-github3.py
  • Pull request to lsst-sqre/github3.py

Push Upstream

  • Create or find issue.

  • Fixup branch and PR.

  • Add name to AUTHORS.

    modified: github3/repos/branch.py

[DM-10133] Update github3.py protection API.
  The new GitHub v3 branches protection API has been updated. This implements the current documented API.

  See:

  https://developer.github.com/v3/repos/branches/

  https://developer.github.com/changes/2017-03-22-protected-branches-admin-improvements/

  https://developer.github.com/changes/2017-04-11-protected-branch-dismissal-restrictions/

  * Update :class:`Branch <github3.repos.branch.Branch>`.

  [X] Make protection a method.
  [X] Update `protect`.
  [X] Update `unprotect`.

  * Add :class:`Protection <github3.repos.branch.Protection>`.

  [X] Get branch protection
  [X] Update branch protection
  [X] Remove branch protection (delete)

  [X] Get required status checks of protected branch
  [X] Get pull request review enforcement of protected branch
  [X] Get admin enforcement of protected branch
  [X] Get restrictions of protected branch

  * Add :class:`RequiredStatusChecks <github3.repos.branch.RequiredStatusChecks>`

  [X] Update required status checks of protected branch
  [X] Remove required status checks of protected branch (delete)
  [X] List required status checks contexts of protected branch
  [X] Replace required status checks contexts of protected branch
  [X] Add required status checks contexts of protected branch
  [X] Remove required status checks contexts of protected branch (delete_contexts)

  * Add :class:`RequiredPullRequestReviews <github3.repos.branch.RequiredPullRequestReviews>`

  [X] Update pull request review enforcement of protected branch
  [X] Remove pull request review enforcement of protected branch (delete)

  * Add :class:`EnforceAdmins <github3.repos.branch.EnforceAdmins>`

  [X] Add admin enforcement of protected branch
  [X] Remove admin enforcement of protected branch

  * Add :class:`Restrictions <github3.repos.branch.Restrictions>`

  [X] Remove restrictions of protected branch

  [X] List team restrictions of protected branch
  [X] Replace team restrictions of protected branch
  [X] Add team restrictions of protected branch
  [X] Remove team restrictions of protected branch

  [X] List user restrictions of protected branch
  [X] Replace user restrictions of protected branch
  [X] Add user restrictions of protected branch
  [X] Remove user restrictions of protected branch

	modified:   github3/repos/branch.py

@jmatt jmatt requested a review from athornton Apr 12, 2017

@athornton
Copy link
Member

left a comment

This looks very nice. AFAICT it's a complete implementation of the API, which is way better than what I did in codekit/u-ccutter.

@jmatt jmatt merged commit b550322 into lsst-sqre:develop Apr 13, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.