-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Protected Branches Preview API Update - main methods #1407
Comments
Yep I was about to post this too 😀 Pretty major changes, as previously all protection settings were done via 1 object and the single "update branch" endpoint, whereas now protection is pulled apart into various sub components (enabled, required contexts, user/team push restrictions) but overall a much better approach for the feature 👍 |
For complete coverage of all the new API endpoints we will need to add 40 methods! Given that some are only a "convenience" (since you can manage everything with the top level endpoints anyway), this issue will cover implementing the following top level methods: Task<BranchProtectionSettings> GetBranchProtection(string owner, string name, string branch);
Task<BranchProtectionSettings> GetBranchProtection(int repositoryId, string branch);
Task<BranchProtectionSettings> UpdateBranchProtection(string owner, string name, string branch, BranchProtectionSettingsUpdate update);
Task<BranchProtectionSettings> UpdateBranchProtection(int repositoryId, string branch, BranchProtectionSettingsUpdate update);
Task<bool> DeleteBranchProtection(string owner, string name, string branch);
Task<bool> DeleteBranchProtection(int repositoryId, string branch); And the remainder will be moved to new issues Task<BranchProtectionRequiredStatusChecks> GetRequiredStatusChecks(string owner, string name, string branch);
Task<BranchProtectionRequiredStatusChecks> GetRequiredStatusChecks(int repositoryId, string branch);
Task<BranchProtectionRequiredStatusChecks> UpdateRequiredStatusChecks(string owner, string name, string branch, BranchProtectionRequiredStatusChecks update);
Task<BranchProtectionRequiredStatusChecks> UpdateRequiredStatusChecks(int repositoryId, string branch, BranchProtectionRequiredStatusChecks update);
Task<bool> DeleteRequiredStatusChecks(string owner, string name, string branch);
Task<bool> DeleteRequiredStatusChecks(int repositoryId, string branch);
Task<IReadOnlyList<string>> GetRequiredStatusCheckContexts(string owner, string name, string branch);
Task<IReadOnlyList<string>> GetRequiredStatusCheckContexts(int repositoryId, string branch);
Task<IReadOnlyList<string>> UpdateRequiredStatusCheckContexts(string owner, string name, string branch, IReadOnlyList<string> contexts);
Task<IReadOnlyList<string>> UpdateRequiredStatusCheckContexts(int repositoryId, string branch, IReadOnlyList<string> contexts);
Task<IReadOnlyList<string>> AddRequiredStatusCheckContext(string owner, string name, string branch, string context);
Task<IReadOnlyList<string>> AddRequiredStatusCheckContext(int repositoryId, string branch, string context);
Task<IReadOnlyList<string>> DeleteRequiredStatusCheckContext(string owner, string name, string branch, string context);
Task<IReadOnlyList<string>> DeleteRequiredStatusCheckContext(int repositoryId, string branch, string context);
Task<ProtectedBranchRestrictions> GetProtectedBranchRestrictions(string owner, string name, string branch);
Task<ProtectedBranchRestrictions> GetProtectedBranchRestrictions(int repositoryId, string branch);
Task<bool> DeleteProtectedBranchRestrictions(string owner, string name, string branch);
Task<bool> DeleteProtectedBranchRestrictions(int repositoryId, string branch);
Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(string owner, string name, string branch);
Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(int repositoryId, string branch);
Task<IReadOnlyList<Team>> SetProtectedBranchTeamRestrictions(string owner, string name, string branch, IReadOnlyList<string> teams);
Task<IReadOnlyList<Team>> SetProtectedBranchTeamRestrictions(int repositoryId, string branch, IReadOnlyList<string> teams);
Task<IReadOnlyList<Team>> AddProtectedBranchTeamRestriction(string owner, string name, string branch, string team);
Task<IReadOnlyList<Team>> AddProtectedBranchTeamRestriction(int repositoryId, string branch, string team);
Task<IReadOnlyList<Team>> DeleteProtectedBranchTeamRestriction(string owner, string name, string branch);
Task<IReadOnlyList<Team>> DeleteProtectedBranchTeamRestriction(int repositoryId, string branch);
Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(string owner, string name, string branch);
Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(int repositoryId, string branch);
Task<IReadOnlyList<User>> SetProtectedBranchUserRestrictions(string owner, string name, string branch, IReadOnlyList<string> users);
Task<IReadOnlyList<User>> SetProtectedBranchUserRestrictions(int repositoryId, string branch, IReadOnlyList<string> users);
Task<IReadOnlyList<User>> AddProtectedBranchUserRestriction(string owner, string name, string branch, string user);
Task<IReadOnlyList<User>> AddProtectedBranchUserRestriction(int repositoryId, string branch, string user);
Task<IReadOnlyList<User>> DeleteProtectedBranchUserRestriction(string owner, string name, string branch);
Task<IReadOnlyList<User>> DeleteProtectedBranchUserRestriction(int repositoryId, string branch); |
Announcement
Just noting this down so we don't miss it. I haven't had a chance to look over the actual work required.
The text was updated successfully, but these errors were encountered: