From dde36bd0cf9146ccf8d934ce919108b14e91a200 Mon Sep 17 00:00:00 2001 From: Henrique Graca <999396+hjgraca@users.noreply.github.com> Date: Thu, 18 Sep 2025 10:13:19 +0100 Subject: [PATCH 1/5] chore: update AWS SDK to v4 and other dependencis --- .../AppConfig/AppConfigProvider.cs | 3 +- libraries/src/Directory.Packages.props | 28 +++++++++---------- .../SsmProviderTest.cs | 25 +++++++++-------- libraries/tests/Directory.Packages.props | 26 ++++++++--------- .../tests/e2e/InfraShared/InfraShared.csproj | 2 +- .../e2e/functions/TestUtils/TestUtils.csproj | 4 +-- .../AOT-Function-ILogger.csproj | 4 +-- .../src/AOT-Function/AOT-Function.csproj | 4 +-- .../Function/src/Function/Function.csproj | 2 +- .../test/Function.Tests/Function.Tests.csproj | 15 ++++++---- .../src/AOT-Function/AOT-Function.csproj | 4 +-- .../Function/src/Function/Function.csproj | 2 +- .../test/Function.Tests/Function.Tests.csproj | 17 ++++++----- .../src/AOT-Function/AOT-Function.csproj | 4 +-- .../Function/src/Function/Function.csproj | 2 +- .../test/Function.Tests/Function.Tests.csproj | 15 ++++++---- .../AOT-FunctionHandlerTest.csproj | 4 +-- .../AOT-FunctionMethodAttributeTest.csproj | 4 +-- .../AOT-FunctionPayloadSubsetTest.csproj | 4 +-- .../Function/src/Function/Function.csproj | 2 +- .../test/Function.Tests/Function.Tests.csproj | 17 ++++++----- libraries/tests/e2e/infra-aot/InfraAot.csproj | 2 +- libraries/tests/e2e/infra/Infra.csproj | 2 +- 23 files changed, 103 insertions(+), 89 deletions(-) diff --git a/libraries/src/AWS.Lambda.Powertools.Parameters/AppConfig/AppConfigProvider.cs b/libraries/src/AWS.Lambda.Powertools.Parameters/AppConfig/AppConfigProvider.cs index ea5979398..0d8fc948e 100644 --- a/libraries/src/AWS.Lambda.Powertools.Parameters/AppConfig/AppConfigProvider.cs +++ b/libraries/src/AWS.Lambda.Powertools.Parameters/AppConfig/AppConfigProvider.cs @@ -421,7 +421,8 @@ await Client.GetLatestConfigurationAsync(request) .ConfigureAwait(false); result.PollConfigurationToken = response.NextPollConfigurationToken; - result.NextAllowedPollTime = _dateTimeWrapper.UtcNow.AddSeconds(response.NextPollIntervalInSeconds); + if (response.NextPollIntervalInSeconds != null) + result.NextAllowedPollTime = _dateTimeWrapper.UtcNow.AddSeconds((double)response.NextPollIntervalInSeconds); if (!string.Equals(response.ContentType, "application/json", StringComparison.CurrentCultureIgnoreCase)) throw new NotImplementedException($"Not implemented AppConfig type: {response.ContentType}"); diff --git a/libraries/src/Directory.Packages.props b/libraries/src/Directory.Packages.props index be5d56855..b05692667 100644 --- a/libraries/src/Directory.Packages.props +++ b/libraries/src/Directory.Packages.props @@ -7,25 +7,25 @@ - - - + + + - + - + - - - - - - + + + + + + - - + + - + \ No newline at end of file diff --git a/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/SimpleSystemsManagement/SsmProviderTest.cs b/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/SimpleSystemsManagement/SsmProviderTest.cs index c39b98288..eca23ce10 100644 --- a/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/SimpleSystemsManagement/SsmProviderTest.cs +++ b/libraries/tests/AWS.Lambda.Powertools.Parameters.Tests/SimpleSystemsManagement/SsmProviderTest.cs @@ -24,6 +24,7 @@ using AWS.Lambda.Powertools.Parameters.Transform; using NSubstitute; using Xunit; +#pragma warning disable CS8629 // Nullable value type may be null. namespace AWS.Lambda.Powertools.Parameters.Tests.SimpleSystemsManagement; @@ -350,7 +351,7 @@ public async Task GetAsync_WhenForceFetch_IgnoresCachedObject() await client .Received(1) .GetParameterAsync( - Arg.Is(x => x.Name == key && !x.WithDecryption), + Arg.Is(x => x.Name == key && !x.WithDecryption.Value), Arg.Any()); Assert.NotNull(result); Assert.Equal(value, result); @@ -392,7 +393,7 @@ public async Task GetAsync_WhenMaxAgeNotSet_StoresCachedObjectWithDefaultMaxAge( cacheManager.Received(1).Get(key); await client.Received(1) .GetParameterAsync(Arg.Is(x => - x.Name == key && !x.WithDecryption), Arg.Any()); + x.Name == key && !x.WithDecryption.Value), Arg.Any()); cacheManager.Received(1).Set(key, value, duration); Assert.NotNull(result); Assert.Equal(value, result); @@ -435,7 +436,7 @@ public async Task GetAsync_WhenMaxAgeClientSet_StoresCachedObjectWithDefaultMaxA cacheManager.Received(1).Get(key); await client.Received(1) .GetParameterAsync(Arg.Is(x => - x.Name == key && !x.WithDecryption), Arg.Any()); + x.Name == key && !x.WithDecryption.Value), Arg.Any()); cacheManager.Received(1).Set(key, value, duration); Assert.NotNull(result); Assert.Equal(value, result); @@ -481,7 +482,7 @@ public async Task GetAsync_WhenMaxAgeSet_StoresCachedObjectWithMaxAge() cacheManager.Received(1).Get(key); await client.Received(1) .GetParameterAsync(Arg.Is(x => - x.Name == key && !x.WithDecryption), Arg.Any()); + x.Name == key && !x.WithDecryption.Value), Arg.Any()); cacheManager.Received(1).Set(key, value, duration); Assert.NotNull(result); Assert.Equal(value, result); @@ -524,7 +525,7 @@ public async Task GetAsync_WithDecryption_CallsClientWithDecryption() cacheManager.Received(1).Get(key); await client.Received(1) .GetParameterAsync(Arg.Is(x => - x.Name == key && x.WithDecryption), Arg.Any()); + x.Name == key && x.WithDecryption.Value), Arg.Any()); Assert.NotNull(result); Assert.Equal(value, result); } @@ -918,7 +919,7 @@ public async Task GetMultipleAsync_WhenMaxAgeNotSet_StoresCachedObjectWithDefaul cacheManager.Received(1).Get(key); await client.Received(1).GetParametersByPathAsync( Arg.Is(x => - x.Path == key && !x.WithDecryption + x.Path == key && !x.WithDecryption.Value ), Arg.Any() ); @@ -980,7 +981,7 @@ public async Task GetMultipleAsync_WhenMaxAgeClientSet_StoresCachedObjectWithDef cacheManager.Received(1).Get(key); await client.Received(1).GetParametersByPathAsync( Arg.Is(x => - x.Path == key && !x.WithDecryption + x.Path == key && !x.WithDecryption.Value ), Arg.Any() ); @@ -1045,7 +1046,7 @@ public async Task GetMultipleAsync_WhenMaxAgeSet_StoresCachedObjectWithMaxAge() cacheManager.Received(1).Get(key); await client.Received(1).GetParametersByPathAsync( Arg.Is(x => - x.Path == key && !x.WithDecryption + x.Path == key && !x.WithDecryption.Value ), Arg.Any() ); @@ -1108,7 +1109,7 @@ public async Task GetMultipleAsync_WithDecryption_CallsClientWithDecryption() cacheManager.Received(1).Get(key); await client.Received(1).GetParametersByPathAsync( Arg.Is(x => - x.Path == key && x.WithDecryption + x.Path == key && x.WithDecryption.Value ), Arg.Any() ); @@ -1167,7 +1168,7 @@ public async Task GetMultipleAsync_WhenRecursive_CallsClientRecursive() cacheManager.Received(1).Get(key); await client.Received(1).GetParametersByPathAsync( Arg.Is(x => - x.Path == key && x.Recursive + x.Path == key && x.Recursive.Value ), Arg.Any() ); @@ -1241,14 +1242,14 @@ public async Task GetMultipleAsync_WhileNextToken_RetrieveAll() cacheManager.Received(1).Get(key); await client.Received(1).GetParametersByPathAsync( Arg.Is(x => - x.Path == key && x.Recursive && x.WithDecryption && string.IsNullOrEmpty(x.NextToken) + x.Path == key && x.Recursive.Value && x.WithDecryption.Value && string.IsNullOrEmpty(x.NextToken) ), Arg.Any() ); await client.Received(1).GetParametersByPathAsync( Arg.Is(x => - x.Path == key && x.Recursive && x.WithDecryption && x.NextToken == nextToken + x.Path == key && x.Recursive.Value && x.WithDecryption.Value && x.NextToken == nextToken ), Arg.Any() ); diff --git a/libraries/tests/Directory.Packages.props b/libraries/tests/Directory.Packages.props index 804b073e2..76ca70cde 100644 --- a/libraries/tests/Directory.Packages.props +++ b/libraries/tests/Directory.Packages.props @@ -4,22 +4,22 @@ - - + + - - - - - - - - - + + + + + + + + + - - + + diff --git a/libraries/tests/e2e/InfraShared/InfraShared.csproj b/libraries/tests/e2e/InfraShared/InfraShared.csproj index dc08a5e10..be451e92f 100644 --- a/libraries/tests/e2e/InfraShared/InfraShared.csproj +++ b/libraries/tests/e2e/InfraShared/InfraShared.csproj @@ -9,7 +9,7 @@ - + - + - +