Skip to content

Commit

Permalink
Release v0.25 - She'll be Comin' Round the Mountain (octokit#1656)
Browse files Browse the repository at this point in the history
* Run `build -Target FormatCode` to fixup whitespace etc

* Fix delete release asset integration test

* Fix repository fork test

* Fix pagination test for PR Review Request

* First cut of release notes

* update release notes

* Update release notes

* include links to contributors

* Add breaking changes/advisories section

* Tidy up formatting

* Tidy up wording
  • Loading branch information
ryangribble authored Aug 23, 2017
1 parent 951ca4f commit 5e89232
Show file tree
Hide file tree
Showing 39 changed files with 164 additions and 99 deletions.
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/IObservablePullRequestsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface IObservablePullRequestsClient
/// Client for managing reviews.
/// </summary>
IObservablePullRequestReviewsClient Review { get; }

/// <summary>
/// Client for managing review comments.
/// </summary>
Expand Down
18 changes: 9 additions & 9 deletions Octokit.Reactive/Clients/ObservablePullRequestReviewsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ObservablePullRequestReviewsClient(IGitHubClient client)
public IObservable<PullRequestReview> Create(string owner, string name, int number, PullRequestReviewCreate review)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(review, nameof(review));
return _client.Create(owner, name, number, review).ToObservable();
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public IObservable<PullRequestReview> Create(long repositoryId, int number, Pull
public IObservable<Unit> Delete(string owner, string name, int number, long reviewId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return _client.Delete(owner, name, number, reviewId).ToObservable();
}
Expand Down Expand Up @@ -94,7 +94,7 @@ public IObservable<Unit> Delete(long repositoryId, int number, long reviewId)
public IObservable<PullRequestReview> Dismiss(string owner, string name, int number, long reviewId, PullRequestReviewDismiss dismissMessage)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(dismissMessage, nameof(dismissMessage));

return _client.Dismiss(owner, name, number, reviewId, dismissMessage).ToObservable();
Expand Down Expand Up @@ -125,7 +125,7 @@ public IObservable<PullRequestReview> Dismiss(long repositoryId, int number, lon
public IObservable<PullRequestReview> GetAll(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return GetAll(owner, name, number, ApiOptions.None);
}
Expand All @@ -152,7 +152,7 @@ public IObservable<PullRequestReview> GetAll(long repositoryId, int number)
public IObservable<PullRequestReview> GetAll(string owner, string name, int number, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<PullRequestReview>(ApiUrls.PullRequestReviews(owner, name, number), null, null, options);
Expand Down Expand Up @@ -183,7 +183,7 @@ public IObservable<PullRequestReview> GetAll(long repositoryId, int number, ApiO
public IObservable<PullRequestReview> Get(string owner, string name, int number, long reviewId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

return _client.Get(owner, name, number, reviewId).ToObservable();
}
Expand Down Expand Up @@ -212,7 +212,7 @@ public IObservable<PullRequestReview> Get(long repositoryId, int number, long re
public IObservable<PullRequestReview> Submit(string owner, string name, int number, long reviewId, PullRequestReviewSubmit submitMessage)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(submitMessage, nameof(submitMessage));

return _client.Submit(owner, name, number, reviewId, submitMessage).ToObservable();
Expand Down Expand Up @@ -269,7 +269,7 @@ public IObservable<PullRequestReviewComment> GetAllComments(long repositoryId, i
public IObservable<PullRequestReviewComment> GetAllComments(string owner, string name, int number, long reviewId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name,nameof(name));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number, reviewId), options);
Expand All @@ -286,7 +286,7 @@ public IObservable<PullRequestReviewComment> GetAllComments(long repositoryId, i
{
Ensure.ArgumentNotNull(options, nameof(options));

return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(repositoryId, number, reviewId),options);
return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(repositoryId, number, reviewId), options);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public async Task CanRemoveOutsideCollaborator()
[OrganizationTest]
public async Task CannotRemoveMemberOfOrganizationAsOutsideCollaborator()
{
var ex = await Assert.ThrowsAsync<UserIsOrganizationMemberException>(()
var ex = await Assert.ThrowsAsync<UserIsOrganizationMemberException>(()
=> _gitHub.Organization.OutsideCollaborator.Delete(Helper.Organization, Helper.UserName));

Assert.True(string.Equals(
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Tests.Integration/Clients/ProjectsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task GetsAllFilteredProjectsForRepository()
{
var project1 = await CreateRepositoryProjectHelper(_github, _context.RepositoryId);
var project2 = await CreateRepositoryProjectHelper(_github, _context.RepositoryId);

// Make 2nd project closed
var result = await _github.Repository.Project.Update(project2.Id, new ProjectUpdate { State = ItemState.Closed });

Expand Down Expand Up @@ -236,7 +236,7 @@ public async Task GetsAllProjects()
public async Task GetsAllFilteredProjectsForRepository()
{
var project = await CreateOrganizationProjectHelper(_github, Helper.Organization);

// Make project closed
var result = await _github.Repository.Project.Update(project.Id, new ProjectUpdate { State = ItemState.Closed });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public async Task GetsRequestsWithRepositoryId()
public async Task ReturnsCorrectCountOfReviewRequestsWithStart()
{
var number = await CreateTheWorld(_github, _context);

var options = new ApiOptions
{
PageSize = 1,
Expand All @@ -107,7 +107,7 @@ public async Task ReturnsCorrectCountOfReviewRequestsWithStartWithRepositoryId()
var options = new ApiOptions
{
PageSize = 1,
PageCount = 2,
PageCount = 1,
StartPage = 2
};
var reviewRequests = await _client.GetAll(_context.RepositoryId, number, options);
Expand All @@ -119,7 +119,7 @@ public async Task ReturnsCorrectCountOfReviewRequestsWithStartWithRepositoryId()
public async Task ReturnsDistinctResultsBasedOnStartPage()
{
var number = await CreateTheWorld(_github, _context);

var startOptions = new ApiOptions
{
PageSize = 1,
Expand All @@ -144,7 +144,7 @@ public async Task ReturnsDistinctResultsBasedOnStartPage()
public async Task ReturnsDistinctResultsBasedOnStartPageWithRepositoryId()
{
var number = await CreateTheWorld(_github, _context);

var startOptions = new ApiOptions
{
PageSize = 1,
Expand Down Expand Up @@ -172,7 +172,7 @@ public class TheDeleteMethod : PullRequestReviewRequestClientTestsBase
public async Task DeletesRequests()
{
var number = await CreateTheWorld(_github, _context);

var reviewRequestsBeforeDelete = await _client.GetAll(_context.RepositoryOwner, _context.RepositoryName, number);
var reviewRequestToCreate = new PullRequestReviewRequest(_collaboratorLogins);
await _client.Delete(_context.RepositoryOwner, _context.RepositoryName, number, reviewRequestToCreate);
Expand All @@ -186,11 +186,11 @@ public async Task DeletesRequests()
public async Task DeletesRequestsWithRepositoryId()
{
var number = await CreateTheWorld(_github, _context);
var reviewRequestsBeforeDelete = await _client.GetAll(_context.RepositoryId, number);

var reviewRequestsBeforeDelete = await _client.GetAll(_context.RepositoryId, number);
var reviewRequestToCreate = new PullRequestReviewRequest(_collaboratorLogins);
await _client.Delete(_context.RepositoryId, number, reviewRequestToCreate);
var reviewRequestsAfterDelete = await _client.GetAll(_context.RepositoryId, number);
var reviewRequestsAfterDelete = await _client.GetAll(_context.RepositoryId, number);

Assert.NotEmpty(reviewRequestsBeforeDelete);
Assert.Empty(reviewRequestsAfterDelete);
Expand Down
6 changes: 4 additions & 2 deletions Octokit.Tests.Integration/Clients/ReleasesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public async Task CanDeleteAsset()

await _releaseClient.DeleteAsset(_context.RepositoryOwner, _context.RepositoryName, result.Id);

await Assert.ThrowsAsync<NotFoundException>(async () => await _releaseClient.DeleteAsset(_context.RepositoryOwner, _context.RepositoryName, result.Id));
await Assert.ThrowsAsync<NotFoundException>(async () => await _releaseClient.GetAsset(_context.RepositoryOwner, _context.RepositoryName, result.Id));
}

[IntegrationTest]
Expand All @@ -806,7 +806,9 @@ public async Task CanDeleteAssetWithRepositoryId()

Assert.NotNull(asset);

await Assert.ThrowsAsync<NotFoundException>(async () => await _releaseClient.DeleteAsset(_context.Repository.Id, result.Id));
await _releaseClient.DeleteAsset(_context.Repository.Id, result.Id);

await Assert.ThrowsAsync<NotFoundException>(async () => await _releaseClient.GetAsset(_context.Repository.Id, result.Id));
}
}

Expand Down
8 changes: 4 additions & 4 deletions Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,9 @@ public async Task ReturnsForkedRepository()
{
var github = Helper.GetAuthenticatedClient();

var repository = await github.Repository.Get("haacked", "libgit2sharp");
var repository = await github.Repository.Get("octokitnet-test1", "octokit.net");

Assert.Equal("https://github.com/Haacked/libgit2sharp.git", repository.CloneUrl);
Assert.Equal("https://github.com/octokitnet-test1/octokit.net.git", repository.CloneUrl);
Assert.True(repository.Fork);
}

Expand All @@ -711,9 +711,9 @@ public async Task ReturnsForkedRepositoryWithRepositoryId()
{
var github = Helper.GetAuthenticatedClient();

var repository = await github.Repository.Get(4550038);
var repository = await github.Repository.Get(100559458);

Assert.Equal("https://github.com/Haacked/libgit2sharp.git", repository.CloneUrl);
Assert.Equal("https://github.com/octokitnet-test1/octokit.net.git", repository.CloneUrl);
Assert.True(repository.Fork);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public async Task ReturnsNonePermissionForPrivateRepository()
var fixture = github.Repository.Collaborator;

var permission = await fixture.ReviewPermission(context.RepositoryOwner, context.RepositoryName, "octokitnet-test1");

Assert.Equal(PermissionLevel.None, permission.Permission);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TheMarkAsReadMethod
public async Task MarksNotificationsRead()
{
var client = new ObservableGitHubClient(Helper.GetAuthenticatedClient());

await client.Activity.Notifications.MarkAsRead();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task GetsAllFilteredProjectsForRepository()
{
var project1 = await CreateRepositoryProjectHelper(_github, _context.RepositoryId);
var project2 = await CreateRepositoryProjectHelper(_github, _context.RepositoryId);

// Make 2nd project closed
var result = await _github.Repository.Project.Update(project2.Id, new ProjectUpdate { State = ItemState.Closed });

Expand Down Expand Up @@ -238,7 +238,7 @@ public async Task GetsAllProjects()
public async Task GetsAllFilteredProjectsForRepository()
{
var project = await CreateOrganizationProjectHelper(_github, Helper.Organization);

// Make project closed
var result = await _github.Repository.Project.Update(project.Id, new ProjectUpdate { State = ItemState.Closed });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ public async Task ReturnsTrueIfUserIsCollaborator()
}
public class TheReviewPermissionMethod
{

[IntegrationTest]
public async Task ReturnsReadPermissionForNonCollaborator()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public void RequestsTheCorrectUrl()
client.Delete("org", "user");

connection.Connection.Received().Delete(
Arg.Is<Uri>(u => u.ToString() == "orgs/org/outside_collaborators/user"),
Arg.Any<object>(),
Arg.Is<Uri>(u => u.ToString() == "orgs/org/outside_collaborators/user"),
Arg.Any<object>(),
"application/vnd.github.korra-preview+json");
}

Expand All @@ -150,7 +150,7 @@ public async Task EnsuresNonNullArguments()

await Assert.ThrowsAsync<ArgumentNullException>(() => client.Delete(null, "user"));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Delete("org", null));

await Assert.ThrowsAsync<ArgumentException>(() => client.Delete("", "user"));
await Assert.ThrowsAsync<ArgumentException>(() => client.Delete("org", ""));
}
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Tests/Clients/ProjectCardsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public async Task PostsToCorrectURL()
newCard,
"application/vnd.github.inertia-preview+json");
}

[Fact]
public async Task EnsuresNonNullArguments()
{
Expand Down Expand Up @@ -151,7 +151,7 @@ public async Task PostsToCorrectURL()
public async Task EnsuresNonNullArguments()
{
var client = new ProjectCardsClient(Substitute.For<IApiConnection>());

await Assert.ThrowsAsync<ArgumentNullException>(() => client.Move(1, null));
}
}
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Tests/Clients/ProjectsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public async Task PostsToCorrectURL()
public async Task EnsuresNonNullArguments()
{
var client = new ProjectsClient(Substitute.For<IApiConnection>());

await Assert.ThrowsAsync<ArgumentNullException>(() => client.Update(1, null));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void PostsToCorrectUrl()
var connection = Substitute.For<IApiConnection>();
var client = new PullRequestReviewRequestsClient(connection);

IReadOnlyList<string> fakeReviewers = new List<string> { "zxc", "asd"};
IReadOnlyList<string> fakeReviewers = new List<string> { "zxc", "asd" };
var pullRequestReviewRequest = new PullRequestReviewRequest(fakeReviewers);

client.Create("fakeOwner", "fakeRepoName", 13, pullRequestReviewRequest);
Expand Down
13 changes: 5 additions & 8 deletions Octokit.Tests/Clients/PullRequestReviewsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void PostsToCorrectUrl()
{
var connection = Substitute.For<IApiConnection>();
var client = new PullRequestReviewsClient(connection);

var comment = new DraftPullRequestReviewComment("Comment content", "file.css", 7);

var review = new PullRequestReviewCreate()
Expand Down Expand Up @@ -240,7 +240,7 @@ public async Task EnsuresNonNullArguments()
await Assert.ThrowsAsync<ArgumentException>(() => client.Create("fakeOwner", "", 1, review));
}
}

public class TheDeleteMethod
{
[Fact]
Expand All @@ -257,7 +257,6 @@ public async Task PostsToCorrectUrl()
[Fact]
public async Task PostsToCorrectUrlWithRepositoryId()
{

var connection = Substitute.For<IApiConnection>();
var client = new PullRequestReviewsClient(connection);

Expand Down Expand Up @@ -285,7 +284,6 @@ public class TheDismissMethod
[Fact]
public async Task PostsToCorrectUrl()
{

var connection = Substitute.For<IApiConnection>();
var client = new PullRequestReviewsClient(connection);

Expand All @@ -301,7 +299,6 @@ public async Task PostsToCorrectUrl()
[Fact]
public async Task PostsToCorrectUrlWithRepositoryId()
{

var connection = Substitute.For<IApiConnection>();
var client = new PullRequestReviewsClient(connection);

Expand Down Expand Up @@ -341,7 +338,7 @@ public async Task RequestsCorrectUrl()
{
var connection = Substitute.For<IApiConnection>();
var client = new PullRequestReviewsClient(connection);

await client.GetAllComments("owner", "name", 13, 13);

connection.Received().GetAll<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/name/pulls/13/reviews/13/comments"), null, Args.ApiOptions);
Expand Down Expand Up @@ -399,7 +396,7 @@ public async Task EnsuresNonNullArguments()
{
var connection = Substitute.For<IApiConnection>();
var client = new PullRequestReviewsClient(connection);

await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllComments(null, "name", 1, 1));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllComments("owner", null, 1, 1));

Expand All @@ -418,7 +415,7 @@ public async Task PostsToCorrectUrl()

var submitMessage = new PullRequestReviewSubmit()
{
Body = "string",
Body = "string",
Event = PullRequestReviewEvent.Approve
};
await client.Submit("owner", "name", 13, 13, submitMessage);
Expand Down
Loading

0 comments on commit 5e89232

Please sign in to comment.