Skip to content

Commit

Permalink
Remove obsolete members (#1622)
Browse files Browse the repository at this point in the history
* remove obsolete "Branches" methods from RepositoryClient (all were previuosly moved to RepositoryBranchesClient)

* Remove obsolete DeploymentStatus fields

* Remove obsoleteMergePullRequest.Squash parameter

* Remove obsolete request ctor

* Remove tests

* Not sure how I missed these test references
  • Loading branch information
ryangribble authored Jun 26, 2017
1 parent 98dfd77 commit b7ad64d
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 846 deletions.
77 changes: 0 additions & 77 deletions Octokit.Reactive/Clients/IObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,58 +221,6 @@ public interface IObservableRepositoriesClient
///</remarks>
IObservableMergingClient Merging { get; }

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
IObservable<Branch> GetAllBranches(string owner, string name);

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
IObservable<Branch> GetAllBranches(long repositoryId);

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
IObservable<Branch> GetAllBranches(string owner, string name, ApiOptions options);

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
IObservable<Branch> GetAllBranches(long repositoryId, ApiOptions options);

/// <summary>
/// Gets all contributors for the specified repository. Does not include anonymous contributors.
/// </summary>
Expand Down Expand Up @@ -474,31 +422,6 @@ public interface IObservableRepositoriesClient
/// <returns>All of the repositories tags.</returns>
IObservable<RepositoryTag> GetAllTags(long repositoryId, ApiOptions options);

/// <summary>
/// Gets the specified branch.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/#get-branch">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branchName">The name of the branch</param>
/// <returns>The specified <see cref="T:Octokit.Branch"/></returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
IObservable<Branch> GetBranch(string owner, string name, string branchName);

/// <summary>
/// Gets the specified branch.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/#get-branch">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branchName">The name of the branch</param>
/// <returns>The specified <see cref="T:Octokit.Branch"/></returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
IObservable<Branch> GetBranch(long repositoryId, string branchName);

/// <summary>
/// Updates the specified repository with the values given in <paramref name="update"/>
/// </summary>
Expand Down
110 changes: 0 additions & 110 deletions Octokit.Reactive/Clients/ObservableRepositoriesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,79 +322,6 @@ public IObservable<Repository> GetAllForOrg(string organization, ApiOptions opti
///</remarks>
public IObservableMergingClient Merging { get; private set; }

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
public IObservable<Branch> GetAllBranches(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");

return Branch.GetAll(owner, name, ApiOptions.None);
}

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
public IObservable<Branch> GetAllBranches(long repositoryId)
{
return Branch.GetAll(repositoryId, ApiOptions.None);
}

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
public IObservable<Branch> GetAllBranches(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(options, "options");

return Branch.GetAll(owner, name, options);
}

/// <summary>
/// Gets all the branches for the specified repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="options">Options for changing the API response</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>All <see cref="T:Octokit.Branch"/>es of the repository</returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.GetAll() instead. This method will be removed in a future version")]
public IObservable<Branch> GetAllBranches(long repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");

return Branch.GetAll(repositoryId, options);
}

/// <summary>
/// Gets all contributors for the specified repository. Does not include anonymous contributors.
/// </summary>
Expand Down Expand Up @@ -705,43 +632,6 @@ public IObservable<RepositoryTag> GetAllTags(long repositoryId, ApiOptions optio
return _connection.GetAndFlattenAllPages<RepositoryTag>(ApiUrls.RepositoryTags(repositoryId), options);
}

/// <summary>
/// Gets the specified branch.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#get-branch">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branchName">The name of the branch</param>
/// <returns>The specified <see cref="T:Octokit.Branch"/></returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
public IObservable<Branch> GetBranch(string owner, string name, string branchName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName");

return Branch.Get(owner, name, branchName);
}

/// <summary>
/// Gets the specified branch.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#get-branch">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branchName">The name of the branch</param>
/// <returns>The specified <see cref="T:Octokit.Branch"/></returns>
[Obsolete("Please use ObservableRepositoriesClient.Branch.Get() instead. This method will be removed in a future version")]
public IObservable<Branch> GetBranch(long repositoryId, string branchName)
{
Ensure.ArgumentNotNullOrEmptyString(branchName, "branchName");

return Branch.Get(repositoryId, branchName);
}

/// <summary>
/// Updates the specified repository with the values given in <paramref name="update"/>
/// </summary>
Expand Down
16 changes: 0 additions & 16 deletions Octokit.Tests.Integration/Clients/PullRequestsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -668,22 +668,6 @@ public async Task CanBeMergedWithShaSpecified()
Assert.True(result.Merged);
}

[IntegrationTest]
public async Task CanBeMergedWithSquashCommit()
{
await CreateTheWorld();

var newPullRequest = new NewPullRequest("squash commit pull request", branchName, "master");
var pullRequest = await _fixture.Create(Helper.UserName, _context.RepositoryName, newPullRequest);

var merge = new MergePullRequest { CommitMessage = "fake commit message", CommitTitle = "fake title", Squash = true };
var result = await _fixture.Merge(Helper.UserName, _context.RepositoryName, pullRequest.Number, merge);
var commit = await _github.Repository.Commit.Get(_context.RepositoryOwner, _context.RepositoryName, result.Sha);

Assert.True(result.Merged);
Assert.Equal("fake title\n\nfake commit message", commit.Commit.Message);
}

[IntegrationTest]
public async Task CanBeMergedWithMergeMethod()
{
Expand Down
Loading

0 comments on commit b7ad64d

Please sign in to comment.