From 964400061d0afedf12ef3be495f665c3a1db7241 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 11 Dec 2023 13:08:02 -0500 Subject: [PATCH 1/7] Allow the constructor for `ProductHeaderValue` to accept a framework version of the object (#2821) --- Octokit/Http/ProductHeaderValue.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Octokit/Http/ProductHeaderValue.cs b/Octokit/Http/ProductHeaderValue.cs index 2879adf940..6d8cd32258 100644 --- a/Octokit/Http/ProductHeaderValue.cs +++ b/Octokit/Http/ProductHeaderValue.cs @@ -1,4 +1,6 @@ -namespace Octokit +using System; + +namespace Octokit { /// /// Represents a product header value. This is used to generate the User Agent string sent with each request. The @@ -38,9 +40,16 @@ public ProductHeaderValue(string name, string version) { } - ProductHeaderValue(System.Net.Http.Headers.ProductHeaderValue productHeader) + /// + /// Initializes a new instance of the class. + /// + /// + /// See more information regarding User-Agent requirements here: https://developer.github.com/v3/#user-agent-required + /// + /// The . + public ProductHeaderValue(System.Net.Http.Headers.ProductHeaderValue productHeader) { - _productHeaderValue = productHeader; + _productHeaderValue = productHeader ?? throw new ArgumentNullException(nameof(productHeader)); } /// From a74efefdc44c9202358badef51ce517a3d694656 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Mon, 11 Dec 2023 16:23:24 -0600 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=9A=A7=20Workflows=20have=20changed?= =?UTF-8?q?=20(#2830)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates for workflows --- .github/workflows/immediate-response.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/immediate-response.yml b/.github/workflows/immediate-response.yml index d3a3cda456..4bb10f5ef3 100644 --- a/.github/workflows/immediate-response.yml +++ b/.github/workflows/immediate-response.yml @@ -6,7 +6,7 @@ on: issues: types: - opened - pull_request: + pull_request_target: types: - opened jobs: From 849be93056f01453763f49cf57914b27e7791651 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 11:13:55 -0800 Subject: [PATCH 3/7] build(deps): bump xunit.runner.visualstudio from 2.5.4 to 2.5.5 (#2831) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.4 to 2.5.5. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.4...2.5.5) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj | 2 +- Octokit.Tests.Integration/Octokit.Tests.Integration.csproj | 2 +- Octokit.Tests/Octokit.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj index a5da79ef59..51fc496f67 100644 --- a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj +++ b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj @@ -35,7 +35,7 @@ - + diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index fa32b45329..07f35a4481 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -37,7 +37,7 @@ - + diff --git a/Octokit.Tests/Octokit.Tests.csproj b/Octokit.Tests/Octokit.Tests.csproj index 76c9045c59..24a43b13c4 100644 --- a/Octokit.Tests/Octokit.Tests.csproj +++ b/Octokit.Tests/Octokit.Tests.csproj @@ -36,7 +36,7 @@ - + From c895ac8efbab6eb9ff03319c3bce8a068e0d326d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:07:52 -0800 Subject: [PATCH 4/7] build(deps): bump xunit from 2.6.1 to 2.6.3 (#2834) * build(deps): bump xunit from 2.6.1 to 2.6.3 Bumps [xunit](https://github.com/xunit/xunit) from 2.6.1 to 2.6.3. - [Commits](https://github.com/xunit/xunit/compare/2.6.1...2.6.3) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Add required async/awaits * public async void --> public async Task --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Keegan Campbell --- .../Octokit.Tests.Conventions.csproj | 2 +- .../Clients/ReleasesClientTests.cs | 2 +- .../Octokit.Tests.Integration.csproj | 2 +- Octokit.Tests/AsyncEnumerableExtensionTests.cs | 6 +++--- Octokit.Tests/Caching/CachingHttpClientTests.cs | 4 ++-- Octokit.Tests/Clients/LicensesClientTests.cs | 4 ++-- .../Clients/MiscellaneousClientTests.cs | 4 ++-- .../Clients/OrganizationHooksClientTest.cs | 16 ++++++++-------- Octokit.Tests/Octokit.Tests.csproj | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj index 51fc496f67..be7afe6880 100644 --- a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj +++ b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj @@ -34,7 +34,7 @@ - + diff --git a/Octokit.Tests.Integration/Clients/ReleasesClientTests.cs b/Octokit.Tests.Integration/Clients/ReleasesClientTests.cs index 10b6cd08d8..9e5efcf461 100644 --- a/Octokit.Tests.Integration/Clients/ReleasesClientTests.cs +++ b/Octokit.Tests.Integration/Clients/ReleasesClientTests.cs @@ -61,7 +61,7 @@ public async Task CreateReleaseAsLatest() var firstReleaseRequest = new NewRelease("0.1") { MakeLatest = MakeLatestQualifier.False }; await _releaseClient.Create(_context.Repository.Id, firstReleaseRequest); - Assert.ThrowsAsync(async () => await _releaseClient.GetLatest(_context.RepositoryOwner, _context.RepositoryName)); + await Assert.ThrowsAsync(async () => await _releaseClient.GetLatest(_context.RepositoryOwner, _context.RepositoryName)); var secondReleaseRequest = new NewRelease("0.2") { MakeLatest = MakeLatestQualifier.True }; var secondRelease = await _releaseClient.Create(_context.Repository.Id, secondReleaseRequest); diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index 07f35a4481..aecef629b1 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -36,7 +36,7 @@ - + diff --git a/Octokit.Tests/AsyncEnumerableExtensionTests.cs b/Octokit.Tests/AsyncEnumerableExtensionTests.cs index 77d5196196..4db7505200 100644 --- a/Octokit.Tests/AsyncEnumerableExtensionTests.cs +++ b/Octokit.Tests/AsyncEnumerableExtensionTests.cs @@ -13,11 +13,11 @@ public class AsyncEnumerableExtensionTests public class ThePaginatedList { [Fact] - public void RejectsInvalidValues() + public async Task RejectsInvalidValues() { var client = Substitute.For(); - Assert.ThrowsAsync(() => client.GetAllForOrgAsync("octokit")[-1]); + await Assert.ThrowsAsync(() => client.GetAllForOrgAsync("octokit")[-1]); } [Fact] @@ -72,7 +72,7 @@ public class ThePaginationOverloads public void RejectInvalidValues() { var client = Substitute.For(); - + Assert.Throws(() => client.GetAllForUserAsync("fake", -1)); Assert.Throws(() => client.GetAllForUserAsync("fake", 0)); } diff --git a/Octokit.Tests/Caching/CachingHttpClientTests.cs b/Octokit.Tests/Caching/CachingHttpClientTests.cs index b5bcb69b8d..688766e055 100644 --- a/Octokit.Tests/Caching/CachingHttpClientTests.cs +++ b/Octokit.Tests/Caching/CachingHttpClientTests.cs @@ -20,7 +20,7 @@ public class CachingHttpClientTests public class TheSendMethod { [Fact] - public void EnsuresNonNullArguments() + public async Task EnsuresNonNullArguments() { // arrange var underlyingClient = Substitute.For(); @@ -29,7 +29,7 @@ public void EnsuresNonNullArguments() var cachingHttpClient = new CachingHttpClient(underlyingClient, responseCache); // act + assert - Assert.ThrowsAsync(() => cachingHttpClient.Send(null, CancellationToken.None)); + await Assert.ThrowsAsync(() => cachingHttpClient.Send(null, CancellationToken.None)); } [Theory] diff --git a/Octokit.Tests/Clients/LicensesClientTests.cs b/Octokit.Tests/Clients/LicensesClientTests.cs index 852c50d9ec..9e05e7f31d 100644 --- a/Octokit.Tests/Clients/LicensesClientTests.cs +++ b/Octokit.Tests/Clients/LicensesClientTests.cs @@ -21,11 +21,11 @@ public void EnsuresNonNullArguments() public class TheGetAllLicensesMethod { [Fact] - public void EnsuresNonNullArguments() + public async Task EnsuresNonNullArguments() { var client = new LicensesClient(Substitute.For()); - Assert.ThrowsAsync(() => client.GetAllLicenses(null)); + await Assert.ThrowsAsync(() => client.GetAllLicenses(null)); } [Fact] diff --git a/Octokit.Tests/Clients/MiscellaneousClientTests.cs b/Octokit.Tests/Clients/MiscellaneousClientTests.cs index 4253eb8e54..2a13efdb6c 100644 --- a/Octokit.Tests/Clients/MiscellaneousClientTests.cs +++ b/Octokit.Tests/Clients/MiscellaneousClientTests.cs @@ -207,11 +207,11 @@ public void EnsuresNonNullArguments() public class TheGetAllLicensesMethod { [Fact] - public void EnsuresNonNullArguments() + public async Task EnsuresNonNullArguments() { var client = new MiscellaneousClient(Substitute.For()); - Assert.ThrowsAsync(() => client.GetAllLicenses(null)); + await Assert.ThrowsAsync(() => client.GetAllLicenses(null)); } [Fact] diff --git a/Octokit.Tests/Clients/OrganizationHooksClientTest.cs b/Octokit.Tests/Clients/OrganizationHooksClientTest.cs index 577fee7860..fa9a593c49 100644 --- a/Octokit.Tests/Clients/OrganizationHooksClientTest.cs +++ b/Octokit.Tests/Clients/OrganizationHooksClientTest.cs @@ -123,11 +123,11 @@ public async Task EnsuresNonNullArguments() } [Fact] - public void EnsuresNonEmptyArguments() + public async Task EnsuresNonEmptyArguments() { var client = new OrganizationsClient(Substitute.For()); var config = new Dictionary { { "url", "" } }; - Assert.ThrowsAsync(() => client.Hook.Create("", new NewOrganizationHook("name", config))); + await Assert.ThrowsAsync(() => client.Hook.Create("", new NewOrganizationHook("name", config))); } [Fact] @@ -167,10 +167,10 @@ public async Task EnsuresNonNullArguments() } [Fact] - public void EnsuresNonEmptyArguments() + public async Task EnsuresNonEmptyArguments() { var client = new OrganizationsClient(Substitute.For()); - Assert.ThrowsAsync(() => client.Hook.Edit("", 123, new EditOrganizationHook())); + await Assert.ThrowsAsync(() => client.Hook.Edit("", 123, new EditOrganizationHook())); } [Fact] @@ -197,10 +197,10 @@ public async Task EnsuresNonNullArguments() } [Fact] - public void EnsuresNonEmptyArguments() + public async Task EnsuresNonEmptyArguments() { var client = new OrganizationsClient(Substitute.For()); - Assert.ThrowsAsync(() => client.Hook.Ping("", 123)); + await Assert.ThrowsAsync(() => client.Hook.Ping("", 123)); } [Fact] @@ -237,10 +237,10 @@ public async Task EnsuresNonNullArguments() } [Fact] - public void EnsuresNonEmptyArguments() + public async Task EnsuresNonEmptyArguments() { var client = new OrganizationsClient(Substitute.For()); - Assert.ThrowsAsync(() => client.Hook.Delete("", 123)); + await Assert.ThrowsAsync(() => client.Hook.Delete("", 123)); } } diff --git a/Octokit.Tests/Octokit.Tests.csproj b/Octokit.Tests/Octokit.Tests.csproj index 24a43b13c4..c36069b39d 100644 --- a/Octokit.Tests/Octokit.Tests.csproj +++ b/Octokit.Tests/Octokit.Tests.csproj @@ -35,7 +35,7 @@ - + From 7b7cfd3ea05fe4e00acb1ba93f763c5f2050cb6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:47:36 -0800 Subject: [PATCH 5/7] build(deps): bump Cake.Frosting from 2.3.0 to 4.0.0 in /build (#2814) * build(deps): bump Cake.Frosting from 2.3.0 to 4.0.0 in /build Bumps [Cake.Frosting](https://github.com/cake-build/cake) from 2.3.0 to 4.0.0. - [Release notes](https://github.com/cake-build/cake/releases) - [Changelog](https://github.com/cake-build/cake/blob/develop/ReleaseNotes.md) - [Commits](https://github.com/cake-build/cake/compare/v2.3.0...v4.0.0) --- updated-dependencies: - dependency-name: Cake.Frosting dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Lifetime.cs#Setup inheritance fixed --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Co-authored-by: Keegan Campbell --- build/Build.csproj | 4 ++-- build/Lifetime.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/Build.csproj b/build/Build.csproj index d4b3d7b05f..8cd2ea40d8 100644 --- a/build/Build.csproj +++ b/build/Build.csproj @@ -1,4 +1,4 @@ - + Exe @@ -9,7 +9,7 @@ - + diff --git a/build/Lifetime.cs b/build/Lifetime.cs index 9ca63e0557..21078a25f3 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -8,7 +8,7 @@ public class Lifetime : FrostingLifetime { - public override void Setup(Context context) + public override void Setup(Context context, ISetupContext setupContext) { context.Target = context.Argument("target", "Default"); context.Configuration = context.Argument("configuration", "Release"); From 4c5edf57f1f451f218fdb0a25a73c68b32ea738d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 14:41:11 -0600 Subject: [PATCH 6/7] build(deps): bump xunit from 2.6.3 to 2.6.4 (#2841) Bumps [xunit](https://github.com/xunit/xunit) from 2.6.3 to 2.6.4. - [Commits](https://github.com/xunit/xunit/compare/2.6.3...2.6.4) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj | 2 +- Octokit.Tests.Integration/Octokit.Tests.Integration.csproj | 2 +- Octokit.Tests/Octokit.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj index be7afe6880..91219a5e77 100644 --- a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj +++ b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj @@ -34,7 +34,7 @@ - + diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index aecef629b1..e1e28162e7 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -36,7 +36,7 @@ - + diff --git a/Octokit.Tests/Octokit.Tests.csproj b/Octokit.Tests/Octokit.Tests.csproj index c36069b39d..075d2ced30 100644 --- a/Octokit.Tests/Octokit.Tests.csproj +++ b/Octokit.Tests/Octokit.Tests.csproj @@ -35,7 +35,7 @@ - + From 0e386621d1f4e82229a4fd62e1bdbfbba7d9b86b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 14:50:31 -0600 Subject: [PATCH 7/7] build(deps): bump xunit.runner.visualstudio from 2.5.5 to 2.5.6 (#2840) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.5 to 2.5.6. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.5...2.5.6) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj | 2 +- Octokit.Tests.Integration/Octokit.Tests.Integration.csproj | 2 +- Octokit.Tests/Octokit.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj index 91219a5e77..37bdc6834f 100644 --- a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj +++ b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj @@ -35,7 +35,7 @@ - + diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index e1e28162e7..c482dbeac0 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -37,7 +37,7 @@ - + diff --git a/Octokit.Tests/Octokit.Tests.csproj b/Octokit.Tests/Octokit.Tests.csproj index 075d2ced30..6d6ec2035e 100644 --- a/Octokit.Tests/Octokit.Tests.csproj +++ b/Octokit.Tests/Octokit.Tests.csproj @@ -36,7 +36,7 @@ - +