Skip to content

Commit

Permalink
Merge pull request #1428 from TattsGroup/protected-branches-obsolete
Browse files Browse the repository at this point in the history
Flag obsolete warnings for initial Protected Branch API preview functionality
  • Loading branch information
shiftkey authored Jul 22, 2016
2 parents bc1967b + ba127b2 commit e3fd99e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Octokit.Reactive/Clients/IObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ public interface IObservableRepositoriesClient
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
IObservable<Branch> EditBranch(string owner, string name, string branch, BranchUpdate update);

/// <summary>
Expand All @@ -518,6 +519,7 @@ public interface IObservableRepositoriesClient
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
IObservable<Branch> EditBranch(int repositoryId, string branch, BranchUpdate update);

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Octokit.Reactive/Clients/ObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ public IObservable<Repository> Edit(int repositoryId, RepositoryUpdate update)
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public IObservable<Branch> EditBranch(string owner, string name, string branch, BranchUpdate update)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Expand All @@ -786,6 +787,7 @@ public IObservable<Branch> EditBranch(string owner, string name, string branch,
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public IObservable<Branch> EditBranch(int repositoryId, string branch, BranchUpdate update)
{
Ensure.ArgumentNotNullOrEmptyString(branch, "branch");
Expand Down
2 changes: 2 additions & 0 deletions Octokit/Clients/IRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ public interface IRepositoriesClient
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
Task<Branch> EditBranch(string owner, string name, string branch, BranchUpdate update);

/// <summary>
Expand All @@ -621,6 +622,7 @@ public interface IRepositoriesClient
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
Task<Branch> EditBranch(int repositoryId, string branch, BranchUpdate update);

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Octokit/Clients/RepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public Task<Repository> Edit(int repositoryId, RepositoryUpdate update)
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public Task<Branch> EditBranch(string owner, string name, string branch, BranchUpdate update)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Expand All @@ -230,6 +231,7 @@ public Task<Branch> EditBranch(string owner, string name, string branch, BranchU
/// <param name="branch">The name of the branch</param>
/// <param name="update">New values to update the branch with</param>
/// <returns>The updated <see cref="T:Octokit.Branch"/></returns>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public Task<Branch> EditBranch(int repositoryId, string branch, BranchUpdate update)
{
Ensure.ArgumentNotNullOrEmptyString(branch, "branch");
Expand Down
1 change: 1 addition & 0 deletions Octokit/Models/Request/BranchUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Octokit
/// Note: this is a PREVIEW api: https://developer.github.com/changes/2015-11-11-protected-branches-api/
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public class BranchUpdate
{
/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion Octokit/Models/Response/Branch.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.Globalization;

namespace Octokit
Expand All @@ -8,12 +9,14 @@ public class Branch
{
public Branch() { }

#pragma warning disable CS0618 // Type or member is obsolete
public Branch(string name, GitReference commit, BranchProtection protection)
{
Name = name;
Commit = commit;
Protection = protection;
}
#pragma warning restore CS0618 // Type or member is obsolete

/// <summary>
/// Name of this <see cref="Branch"/>.
Expand All @@ -24,6 +27,7 @@ public Branch(string name, GitReference commit, BranchProtection protection)
/// The <see cref="BranchProtection"/> details for this <see cref="Branch"/>.
/// Note: this is a PREVIEW api: https://developer.github.com/changes/2015-11-11-protected-branches-api/
/// </summary>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.", false)]
public BranchProtection Protection { get; protected set; }

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions Octokit/Models/Response/BranchProtection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Octokit
/// Note: this is a PREVIEW api: https://developer.github.com/changes/2015-11-11-protected-branches-api/
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public class BranchProtection
{
public BranchProtection() { }
Expand Down Expand Up @@ -42,6 +43,7 @@ internal string DebuggerDisplay
}

[DebuggerDisplay("{DebuggerDisplay,nq}")]
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public class RequiredStatusChecks
{
public RequiredStatusChecks() { }
Expand Down Expand Up @@ -74,6 +76,7 @@ internal string DebuggerDisplay
/// <summary>
/// The enforcement levels that are available
/// </summary>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
public enum EnforcementLevel
{
/// <summary>
Expand Down

0 comments on commit e3fd99e

Please sign in to comment.