From 8d32c7add319438899830f4f380e836d3f63263b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 21:45:19 +0000 Subject: [PATCH 01/10] chore(deps): bump the kiota-dependencies group across 3 directories with 4 updates Bumps the kiota-dependencies group with 4 updates in the /src/Microsoft.Graph.Core directory: [Microsoft.Kiota.Abstractions](https://github.com/microsoft/kiota-dotnet), [Microsoft.Kiota.Authentication.Azure](https://github.com/microsoft/kiota-dotnet), [Microsoft.Kiota.Http.HttpClientLibrary](https://github.com/microsoft/kiota-dotnet) and [Microsoft.Kiota.Serialization.Json](https://github.com/microsoft/kiota-dotnet). Bumps the kiota-dependencies group with 4 updates in the /tests/Microsoft.Graph.DotnetCore.Core.Test directory: [Microsoft.Kiota.Abstractions](https://github.com/microsoft/kiota-dotnet), [Microsoft.Kiota.Authentication.Azure](https://github.com/microsoft/kiota-dotnet), [Microsoft.Kiota.Http.HttpClientLibrary](https://github.com/microsoft/kiota-dotnet) and [Microsoft.Kiota.Serialization.Json](https://github.com/microsoft/kiota-dotnet). Bumps the kiota-dependencies group with 4 updates in the /tests/Microsoft.Graph.DotnetCore.Core.Trimming directory: [Microsoft.Kiota.Abstractions](https://github.com/microsoft/kiota-dotnet), [Microsoft.Kiota.Authentication.Azure](https://github.com/microsoft/kiota-dotnet), [Microsoft.Kiota.Http.HttpClientLibrary](https://github.com/microsoft/kiota-dotnet) and [Microsoft.Kiota.Serialization.Json](https://github.com/microsoft/kiota-dotnet). Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Authentication.Azure` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Http.HttpClientLibrary` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Serialization.Json` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Authentication.Azure` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Http.HttpClientLibrary` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Serialization.Json` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Authentication.Azure` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Http.HttpClientLibrary` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Abstractions` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) Updates `Microsoft.Kiota.Serialization.Json` from 1.16.3 to 1.16.4 - [Release notes](https://github.com/microsoft/kiota-dotnet/releases) - [Changelog](https://github.com/microsoft/kiota-dotnet/blob/main/CHANGELOG.md) - [Commits](https://github.com/microsoft/kiota-dotnet/compare/v1.16.3...v1.16.4) --- updated-dependencies: - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Authentication.Azure dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Http.HttpClientLibrary dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Authentication.Azure dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Http.HttpClientLibrary dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Authentication.Azure dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Http.HttpClientLibrary dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Abstractions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: Microsoft.Kiota.Serialization.Json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: kiota-dependencies ... Signed-off-by: dependabot[bot] --- src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj index 24593c8cd..719f2d253 100644 --- a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj +++ b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj @@ -65,12 +65,12 @@ - - - + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive From 0d05305bd86fb1a0d19d60dea96df5e3ad13f392 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:49:58 +0000 Subject: [PATCH 02/10] chore(deps): bump the coverlet group across 2 directories with 2 updates Bumps the coverlet group with 2 updates in the / directory: [coverlet.collector](https://github.com/coverlet-coverage/coverlet) and [coverlet.msbuild](https://github.com/coverlet-coverage/coverlet). Bumps the coverlet group with 2 updates in the /tests/Microsoft.Graph.DotnetCore.Core.Test directory: [coverlet.collector](https://github.com/coverlet-coverage/coverlet) and [coverlet.msbuild](https://github.com/coverlet-coverage/coverlet). Updates `coverlet.collector` from 6.0.3 to 6.0.4 - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/compare/v6.0.3...v6.0.4) Updates `coverlet.msbuild` from 6.0.3 to 6.0.4 - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/compare/v6.0.3...v6.0.4) Updates `coverlet.collector` from 6.0.3 to 6.0.4 - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/compare/v6.0.3...v6.0.4) Updates `coverlet.msbuild` from 6.0.3 to 6.0.4 - [Release notes](https://github.com/coverlet-coverage/coverlet/releases) - [Commits](https://github.com/coverlet-coverage/coverlet/compare/v6.0.3...v6.0.4) --- updated-dependencies: - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-patch dependency-group: coverlet - dependency-name: coverlet.msbuild dependency-type: direct:production update-type: version-update:semver-patch dependency-group: coverlet - dependency-name: coverlet.collector dependency-type: direct:production update-type: version-update:semver-patch dependency-group: coverlet - dependency-name: coverlet.msbuild dependency-type: direct:production update-type: version-update:semver-patch dependency-group: coverlet ... Signed-off-by: dependabot[bot] --- .../Microsoft.Graph.DotnetCore.Core.Test.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Test/Microsoft.Graph.DotnetCore.Core.Test.csproj b/tests/Microsoft.Graph.DotnetCore.Core.Test/Microsoft.Graph.DotnetCore.Core.Test.csproj index 0e2a5acf0..c74b4dc4f 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Test/Microsoft.Graph.DotnetCore.Core.Test.csproj +++ b/tests/Microsoft.Graph.DotnetCore.Core.Test/Microsoft.Graph.DotnetCore.Core.Test.csproj @@ -25,11 +25,11 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 4865873d739c9861cbbc3400a41091c83e3a3701 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 21:44:13 +0000 Subject: [PATCH 03/10] chore(deps): bump dependabot/fetch-metadata from 2.2.0 to 2.3.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.2.0 to 2.3.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.2.0...v2.3.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/auto-merge-dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml index 3d9334e96..df4b487a7 100644 --- a/.github/workflows/auto-merge-dependabot.yml +++ b/.github/workflows/auto-merge-dependabot.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@v2.2.0 + uses: dependabot/fetch-metadata@v2.3.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" From a5b395051ea92f2b92c3fa0a758e41322ddd62c4 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 12:28:52 +0300 Subject: [PATCH 04/10] fix: fixes performance issue when using the `AddBatchRequestStepAsync` method due to the client trying to authenticate the request on conversion --- .github/workflows/validatePullRequest.yml | 4 +-- .../Microsoft.Graph.Core.csproj | 10 +++--- .../Requests/Content/BatchRequestContent.cs | 10 ++++-- .../Content/BatchRequestContentTests.cs | 33 ++++++++++++++++--- 4 files changed, 43 insertions(+), 14 deletions(-) diff --git a/.github/workflows/validatePullRequest.yml b/.github/workflows/validatePullRequest.yml index 7311379a3..37bd58919 100644 --- a/.github/workflows/validatePullRequest.yml +++ b/.github/workflows/validatePullRequest.yml @@ -65,8 +65,8 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 9.x - name: Validate Trimming warnings - run: dotnet publish -c Release -r win-x64 /p:TreatWarningsAsErrors=true /warnaserror -f net8.0 + run: dotnet publish -c Release -r win-x64 /p:TreatWarningsAsErrors=true /warnaserror -f net9.0 working-directory: ./tests/Microsoft.Graph.DotnetCore.Core.Trimming \ No newline at end of file diff --git a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj index 719f2d253..1e4fc0ece 100644 --- a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj +++ b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj @@ -62,16 +62,16 @@ - - + + - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Microsoft.Graph.Core/Requests/Content/BatchRequestContent.cs b/src/Microsoft.Graph.Core/Requests/Content/BatchRequestContent.cs index 1679a9649..cc782d4a6 100644 --- a/src/Microsoft.Graph.Core/Requests/Content/BatchRequestContent.cs +++ b/src/Microsoft.Graph.Core/Requests/Content/BatchRequestContent.cs @@ -17,6 +17,7 @@ namespace Microsoft.Graph using System.Threading; using System.Threading.Tasks; using Microsoft.Kiota.Abstractions; + using Microsoft.Kiota.Abstractions.Authentication; /// /// A implementation to handle json batch requests. @@ -71,7 +72,7 @@ public BatchRequestContent(IRequestAdapter requestAdapter, params BatchRequestSt if (batchRequestSteps == null) throw new ArgumentNullException(nameof(batchRequestSteps)); - if (batchRequestSteps.Count() > CoreConstants.BatchRequest.MaxNumberOfRequests) + if (batchRequestSteps.Length > CoreConstants.BatchRequest.MaxNumberOfRequests) throw new ArgumentException(string.Format(ErrorConstants.Messages.MaximumValueExceeded, "Number of batch request steps", CoreConstants.BatchRequest.MaxNumberOfRequests)); this.Headers.ContentType = new MediaTypeHeaderValue(CoreConstants.MimeTypeNames.Application.Json); @@ -87,7 +88,12 @@ public BatchRequestContent(IRequestAdapter requestAdapter, params BatchRequestSt AddBatchRequestStep(requestStep); } - this.RequestAdapter = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter)); + // as we only use the adapter to serialize request using the `ConvertToNativeRequestAsync` interface, + // we don't want to make extra request to the authentication provider as the request does not need the authentication header. + this.RequestAdapter = new BaseGraphRequestAdapter(new AnonymousAuthenticationProvider()) + { + BaseUrl = requestAdapter.BaseUrl + }; } /// diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs b/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs index fe798971e..9373c17bf 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs @@ -181,7 +181,7 @@ public void BatchRequestContent_RemoveBatchRequestStepWithIdForNonExistingId() Assert.False(isSuccess); Assert.True(batchRequestContent.BatchRequestSteps.Count.Equals(2)); - Assert.Same(batchRequestStep2.DependsOn.First(), batchRequestContent.BatchRequestSteps["2"].DependsOn.First()); + Assert.Same(batchRequestStep2.DependsOn[0], batchRequestContent.BatchRequestSteps["2"].DependsOn[0]); } [Fact] @@ -311,6 +311,29 @@ public async System.Threading.Tasks.Task BatchRequestContent_GetBatchRequestCont Assert.Equal(expectedContent, requestContent); } + [Fact] + public async System.Threading.Tasks.Task BatchRequestContent_GetBatchRequestContentFromRequestInformationDoesNotAddAuthHeaderAsync() + { + BatchRequestContent batchRequestContent = new BatchRequestContent(client); + RequestInformation requestInformation = new RequestInformation() { HttpMethod = Method.GET, UrlTemplate = REQUEST_URL }; + await batchRequestContent.AddBatchRequestStepAsync(requestInformation, "2"); + + string requestContent; + // We get the contents of the stream as string for comparison. + using (Stream requestStream = await batchRequestContent.GetBatchRequestContentAsync()) + using (StreamReader reader = new StreamReader(requestStream)) + { + requestContent = await reader.ReadToEndAsync(); + } + + string expectedContent = "{\"requests\":[{\"id\":\"2\",\"url\":\"/me\",\"method\":\"GET\"}]}"; //Auth Header Absent. + + Assert.NotNull(requestContent); + Assert.IsType(batchRequestContent.RequestAdapter); + Assert.True(batchRequestContent.BatchRequestSteps.Count.Equals(1)); + Assert.Equal(expectedContent, requestContent); + } + [Fact] public async System.Threading.Tasks.Task BatchRequestContent_GetBatchRequestContentSupportsNonJsonPayloadAsync() { @@ -331,7 +354,7 @@ public async System.Threading.Tasks.Task BatchRequestContent_GetBatchRequestCont string requestContent; // we do this to get a version of the json that is indented using (Stream requestStream = await batchRequestContent.GetBatchRequestContentAsync()) - using (JsonDocument jsonDocument = JsonDocument.Parse(requestStream)) + using (JsonDocument jsonDocument = await JsonDocument.ParseAsync(requestStream)) { requestContent = JsonSerializer.Serialize(jsonDocument.RootElement, new JsonSerializerOptions() { WriteIndented = true }); } @@ -409,7 +432,7 @@ public async System.Threading.Tasks.Task BatchRequestContent_GetBatchRequestCont string requestContent; // we do this to get a version of the json that is indented using (Stream requestStream = await batchRequestContent.GetBatchRequestContentAsync()) - using (JsonDocument jsonDocument = JsonDocument.Parse(requestStream)) + using (JsonDocument jsonDocument = await JsonDocument.ParseAsync(requestStream)) { requestContent = JsonSerializer.Serialize(jsonDocument.RootElement, new JsonSerializerOptions() { WriteIndented = true }); } @@ -532,7 +555,7 @@ public void BatchRequestContent_AddBatchRequestStepWithHttpRequestMessageToBatch // Assert var exception = Assert.Throws(() => batchRequestContent.AddBatchRequestStep(extraHttpRequestMessage));//Assert we throw exception on excess add - //Assert.Equal(ErrorConstants.Codes.MaximumValueExceeded, exception.Error.Code); + Assert.Equal(ErrorConstants.Messages.MaximumValueExceeded, exception.Message); Assert.NotNull(batchRequestContent.BatchRequestSteps); Assert.True(batchRequestContent.BatchRequestSteps.Count.Equals(CoreConstants.BatchRequest.MaxNumberOfRequests)); } @@ -612,7 +635,7 @@ public async Task BatchRequestContent_AddBatchRequestStepWithBaseRequestToBatchR var exception = await Assert.ThrowsAsync(() => batchRequestContent.AddBatchRequestStepAsync(extraRequestInformation)); // Assert - //Assert.Equal(ErrorConstants.Codes.MaximumValueExceeded, exception.Error.Code); + Assert.Equal(ErrorConstants.Messages.MaximumValueExceeded, exception.Message); Assert.NotNull(batchRequestContent.BatchRequestSteps); Assert.True(batchRequestContent.BatchRequestSteps.Count.Equals(CoreConstants.BatchRequest.MaxNumberOfRequests)); } From 4d80a83ac4a0efd56373b2b66704f7bd65a15cd9 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 12:32:23 +0300 Subject: [PATCH 05/10] chore: bump the trimming project version --- .../Microsoft.Graph.DotnetCore.Core.Trimming.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj index 928343674..3bfa7a49d 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj +++ b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj @@ -1,7 +1,7 @@ Exe - net8.0 + net9.0 enable enable true From 7c01730c593a425da1ae5c6bf4145d1ad363dbd5 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 12:52:03 +0300 Subject: [PATCH 06/10] update project global file --- tests/Microsoft.Graph.DotnetCore.Core.Trimming/global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/global.json b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/global.json index d251ac4e7..b81865078 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/global.json +++ b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.101", /* https://github.com/dotnet/maui/wiki/.NET-7-and-.NET-MAUI */ + "version": "9.0.102", /* https://github.com/dotnet/maui/wiki/.NET-7-and-.NET-MAUI */ "rollForward": "major" } } From 1d9446560480b989007810c1b0d0bc977ce7a9f0 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 14:15:09 +0300 Subject: [PATCH 07/10] attempt to suppress warnings --- .../Microsoft.Graph.DotnetCore.Core.Trimming.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj index 3bfa7a49d..4a99cd482 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj +++ b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj @@ -10,6 +10,7 @@ true true IL3000 + true From dc6e44c839d7a50959d7732267dbfac6e4649247 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 14:20:18 +0300 Subject: [PATCH 08/10] chore: move around supression --- src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj | 1 + .../Microsoft.Graph.DotnetCore.Core.Trimming.csproj | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj index 1e4fc0ece..465623ae7 100644 --- a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj +++ b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj @@ -35,6 +35,7 @@ true true true + true True README.md NU5048;NETSDK1202 diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj index 4a99cd482..3bfa7a49d 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj +++ b/tests/Microsoft.Graph.DotnetCore.Core.Trimming/Microsoft.Graph.DotnetCore.Core.Trimming.csproj @@ -10,7 +10,6 @@ true true IL3000 - true From 14af57e9cc4baa7a08179e26e454065a6e7fe7a8 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 14:41:08 +0300 Subject: [PATCH 09/10] chore: fix broken test --- .../Requests/Content/BatchRequestContentTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs b/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs index 9373c17bf..4ce0801fc 100644 --- a/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Core.Test/Requests/Content/BatchRequestContentTests.cs @@ -555,7 +555,7 @@ public void BatchRequestContent_AddBatchRequestStepWithHttpRequestMessageToBatch // Assert var exception = Assert.Throws(() => batchRequestContent.AddBatchRequestStep(extraHttpRequestMessage));//Assert we throw exception on excess add - Assert.Equal(ErrorConstants.Messages.MaximumValueExceeded, exception.Message); + Assert.Equal(string.Format(ErrorConstants.Messages.MaximumValueExceeded, "Number of batch request steps", CoreConstants.BatchRequest.MaxNumberOfRequests), exception.Message); Assert.NotNull(batchRequestContent.BatchRequestSteps); Assert.True(batchRequestContent.BatchRequestSteps.Count.Equals(CoreConstants.BatchRequest.MaxNumberOfRequests)); } @@ -635,7 +635,7 @@ public async Task BatchRequestContent_AddBatchRequestStepWithBaseRequestToBatchR var exception = await Assert.ThrowsAsync(() => batchRequestContent.AddBatchRequestStepAsync(extraRequestInformation)); // Assert - Assert.Equal(ErrorConstants.Messages.MaximumValueExceeded, exception.Message); + Assert.Equal(string.Format(ErrorConstants.Messages.MaximumValueExceeded, "Number of batch request steps", CoreConstants.BatchRequest.MaxNumberOfRequests), exception.Message); Assert.NotNull(batchRequestContent.BatchRequestSteps); Assert.True(batchRequestContent.BatchRequestSteps.Count.Equals(CoreConstants.BatchRequest.MaxNumberOfRequests)); } From fb3295e97b841468e25c11f105fa1a69f9a1398a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 12:07:42 +0000 Subject: [PATCH 10/10] chore(main): release 3.2.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 144739cd9..fec18303d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.2.2" + ".": "3.2.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 10e584c33..28a4df825 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project does adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.2.3](https://github.com/microsoftgraph/msgraph-sdk-dotnet-core/compare/3.2.2...3.2.3) (2025-01-28) + + +### Bug Fixes + +* fixes performance issue when using the `AddBatchRequestStepAsync` method due to the client trying to authenticate the request on conversion ([a5b3950](https://github.com/microsoftgraph/msgraph-sdk-dotnet-core/commit/a5b395051ea92f2b92c3fa0a758e41322ddd62c4)) + ## [3.2.2](https://github.com/microsoftgraph/msgraph-sdk-dotnet-core/compare/3.2.1...3.2.2) (2025-01-10) diff --git a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj index 465623ae7..6239adf04 100644 --- a/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj +++ b/src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj @@ -21,7 +21,7 @@ 35MSSharedLib1024.snk true - 3.2.2 + 3.2.3