Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for RTM #547

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.13" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.18" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.6" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0-alpha.1" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" GeneratePathProperty="true" />
<PackageReference Include="Nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public Task Handle(TriggerMessage message, IMessageHandlerContext context)
}
});

session.AddRange(new List<TransactWriteItem>
{
session.AddRange(
[
new TransactWriteItem
{
Put = new Put
Expand Down Expand Up @@ -143,7 +143,7 @@ public Task Handle(TriggerMessage message, IMessageHandlerContext context)
}
}
}
});
]);

testContext.MessageReceived = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.13" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.18" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="9.0.0-alpha.9" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0-alpha.1" />
<PackageReference Include="NServiceBus.PersistenceTests.Sources" Version="9.0.0" />
<PackageReference Include="Nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.13" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.18" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0-alpha.6" GeneratePathProperty="true" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0-alpha.1" />
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.0.0" GeneratePathProperty="true" />
<PackageReference Include="Nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.13" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.6" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0-alpha.1" />
<PackageReference Include="Particular.Approvals" Version="0.6.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.18" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NServiceBus.Testing" Version="9.0.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ public async Task Should_return_record_even_if_metadata_and_transport_operations
{ "PK", new AttributeValue("OUTBOX#endpointIdentifier#someMessageId")},
{ "SK", new AttributeValue("OUTBOX#OPERATION#someMessageId#0000")},
{ "MessageId", new AttributeValue(Guid.NewGuid().ToString())},
{ "Properties", new AttributeValue { M = new Dictionary<string, AttributeValue>(0)} },
{ "Headers", new AttributeValue { M = new Dictionary<string, AttributeValue>(0)} },
{ "Properties", new AttributeValue { M = []} },
{ "Headers", new AttributeValue { M = []} },
{ "Body", new AttributeValue { B = new MemoryStream() } }
}
}
Expand Down Expand Up @@ -267,8 +267,8 @@ public void Should_throw_when_transport_operations_not_complete_even_when_paging
{ "PK", new AttributeValue("OUTBOX#endpointIdentifier#someMessageId")},
{ "SK", new AttributeValue("OUTBOX#OPERATION#someMessageId#0000")},
{ "MessageId", new AttributeValue(Guid.NewGuid().ToString())},
{ "Properties", new AttributeValue { M = new Dictionary<string, AttributeValue>(0)} },
{ "Headers", new AttributeValue { M = new Dictionary<string, AttributeValue>(0)} },
{ "Properties", new AttributeValue { M = []} },
{ "Headers", new AttributeValue { M = []} },
{ "Body", new AttributeValue { B = new MemoryStream() } }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ namespace NServiceBus.TransactionalSession.AcceptanceTests;
public class TransactionSessionDefaultServer : IEndpointSetupTemplate
{
public virtual async Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescriptor,
EndpointCustomizationConfiguration endpointConfiguration,
EndpointCustomizationConfiguration endpointCustomization,
Func<EndpointConfiguration, Task> configurationBuilderCustomization)
{
var builder = new EndpointConfiguration(endpointConfiguration.EndpointName);
var endpointConfiguration = new EndpointConfiguration(endpointCustomization.EndpointName);

builder.UseTransport<LearningTransport>();
endpointConfiguration.UseSerialization<SystemJsonSerializer>();
endpointConfiguration.UseTransport<LearningTransport>();

builder.Recoverability()
endpointConfiguration.Recoverability()
.Delayed(delayed => delayed.NumberOfRetries(0))
// due to read-committed isolation level we allow retries for partial results on the outbox get
.Immediate(immediate => immediate.NumberOfRetries(1));
builder.SendFailedMessagesTo("error");

// scan types at the end so that all types used by the configuration have been loaded into the AppDomain
builder.TypesToIncludeInScan(endpointConfiguration.GetTypesScopedByTestClass());
endpointConfiguration.TypesToIncludeInScan(endpointCustomization.GetTypesScopedByTestClass());

var persistence = builder.UsePersistence<DynamoPersistence>();
var persistence = endpointConfiguration.UsePersistence<DynamoPersistence>();
persistence.DynamoClient(SetupFixture.DynamoDBClient);
persistence.UseSharedTable(SetupFixture.TableConfiguration);
persistence.EnableTransactionalSession();

builder.RegisterStartupTask(sp => new CaptureServiceProviderStartupTask(sp, runDescriptor.ScenarioContext));
endpointConfiguration.RegisterStartupTask(sp => new CaptureServiceProviderStartupTask(sp, runDescriptor.ScenarioContext));

await configurationBuilderCustomization(builder).ConfigureAwait(false);
await configurationBuilderCustomization(endpointConfiguration).ConfigureAwait(false);

return builder;
return endpointConfiguration;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@

<ItemGroup>
<ProjectReference Include="..\NServiceBus.Persistence.DynamoDB.TransactionalSession\NServiceBus.Persistence.DynamoDB.TransactionalSession.csproj" />
<ProjectReference Include="..\NServiceBus.Persistence.DynamoDB\NServiceBus.Persistence.DynamoDB.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.13" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.18" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0-alpha.9" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0" />
<PackageReference Include="Nunit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
using PublicApiGenerator;

[TestFixture]
public class ApiApprovals
public class APIApprovals
{
[Test]
public void Approve()
{
var publicApi = typeof(DynamoOpenSessionOptions).Assembly.GeneratePublicApi(new ApiGeneratorOptions
{
ExcludeAttributes = new[] { "System.Runtime.Versioning.TargetFrameworkAttribute", "System.Reflection.AssemblyMetadataAttribute" }
ExcludeAttributes = ["System.Runtime.Versioning.TargetFrameworkAttribute", "System.Reflection.AssemblyMetadataAttribute"]
});
Approver.Verify(publicApi);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="Particular.Approvals" Version="0.6.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.301.18" />
<PackageReference Include="NServiceBus" Version="9.0.0" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0" />
<PackageReference Include="Particular.Approvals" Version="1.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus.TransactionalSession" Version="3.0.0-alpha.1" />
<PackageReference Include="Particular.Packaging" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="NServiceBus.TransactionalSession" Version="[3.0.0, 4.0.0)" />
<PackageReference Include="Particular.Packaging" Version="4.1.0" PrivateAssets="All" />
</ItemGroup>

</Project>
4 changes: 3 additions & 1 deletion src/NServiceBus.Persistence.DynamoDB.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Persistence.Dyn
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C4C88BE6-36A9-4F37-B9C6-3FEAD151C836}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
Custom.Build.props = Custom.Build.props
..\.github\workflows\release.yml = ..\.github\workflows\release.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Persistence.DynamoDB.AcceptanceTests", "NServiceBus.Persistence.DynamoDB.AcceptanceTests\NServiceBus.Persistence.DynamoDB.AcceptanceTests.csproj", "{134F5B2E-35A0-41A0-9806-B763FCD918F3}"
Expand All @@ -22,7 +24,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Persistence.Dyn
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Persistence.DynamoDB.TransactionalSession.AcceptanceTests", "NServiceBus.Persistence.DynamoDB.TransactionalSession.AcceptanceTests\NServiceBus.Persistence.DynamoDB.TransactionalSession.AcceptanceTests.csproj", "{D77F739B-53C7-4271-8552-4AE6CACACF6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Persistence.DynamoDB.TransactionalSession.Tests", "NServiceBus.Persistence.DynamoDB.TransactionalSession.Tests\NServiceBus.Persistence.DynamoDB.TransactionalSession.Tests.csproj", "{EB66E88B-5B05-4D26-8FEF-739E325A14D6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Persistence.DynamoDB.TransactionalSession.Tests", "NServiceBus.Persistence.DynamoDB.TransactionalSession.Tests\NServiceBus.Persistence.DynamoDB.TransactionalSession.Tests.csproj", "{EB66E88B-5B05-4D26-8FEF-739E325A14D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
namespace NServiceBus.Persistence.DynamoDB;

using System;
using Amazon.DynamoDBv2;

sealed class DynamoClientProvidedByConfigurationProvider : IDynamoClientProvider
{
public DynamoClientProvidedByConfigurationProvider(IAmazonDynamoDB client)
{
Guard.ThrowIfNull(client);
ArgumentNullException.ThrowIfNull(client);

Client = client;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace NServiceBus;

using System;
using Amazon.DynamoDBv2;
using Configuration.AdvancedExtensibility;
using Persistence.DynamoDB;
Expand All @@ -15,8 +16,8 @@ public static class DynamoPersistenceConfigExtensions
/// <remarks>The lifetime of the provided client is assumed to be controlled by the caller of this method and thus the client will not be disposed.</remarks>
public static PersistenceExtensions<DynamoPersistence> DynamoClient(this PersistenceExtensions<DynamoPersistence> persistenceExtensions, IAmazonDynamoDB dynamoClient)
{
Guard.ThrowIfNull(persistenceExtensions);
Guard.ThrowIfNull(dynamoClient);
ArgumentNullException.ThrowIfNull(persistenceExtensions);
ArgumentNullException.ThrowIfNull(dynamoClient);

persistenceExtensions.GetSettings().Set<IDynamoClientProvider>(new DynamoClientProvidedByConfigurationProvider(dynamoClient));
return persistenceExtensions;
Expand All @@ -27,8 +28,8 @@ public static PersistenceExtensions<DynamoPersistence> DynamoClient(this Persist
/// </summary>
public static PersistenceExtensions<DynamoPersistence> UseSharedTable(this PersistenceExtensions<DynamoPersistence> persistenceExtensions, TableConfiguration sharedTableConfiguration)
{
Guard.ThrowIfNull(persistenceExtensions);
Guard.ThrowIfNull(sharedTableConfiguration);
ArgumentNullException.ThrowIfNull(persistenceExtensions);
ArgumentNullException.ThrowIfNull(sharedTableConfiguration);

persistenceExtensions.GetSettings().GetOrCreate<SagaPersistenceConfiguration>().Table = sharedTableConfiguration with { };
persistenceExtensions.GetSettings().GetOrCreate<OutboxPersistenceConfiguration>().Table = sharedTableConfiguration with { };
Expand All @@ -40,7 +41,7 @@ public static PersistenceExtensions<DynamoPersistence> UseSharedTable(this Persi
/// </summary>
public static void DisableTablesCreation(this PersistenceExtensions<DynamoPersistence> persistenceExtensions)
{
Guard.ThrowIfNull(persistenceExtensions);
ArgumentNullException.ThrowIfNull(persistenceExtensions);

persistenceExtensions.GetSettings().GetOrCreate<SagaPersistenceConfiguration>().CreateTable = false;
persistenceExtensions.GetSettings().GetOrCreate<OutboxPersistenceConfiguration>().CreateTable = false;
Expand Down
3 changes: 0 additions & 3 deletions src/NServiceBus.Persistence.DynamoDB/FodyWeavers.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -9,15 +9,12 @@
</PropertyGroup>

<ItemGroup Label="Public dependencies">
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.6" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="[3.7.201.7, 4.0.0)" />
<PackageReference Include="System.Text.Json" Version="8.0.1" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="[3.7.301.18, 4.0.0)" />
<PackageReference Include="NServiceBus" Version="[9.0.0, 10.0.0)" />
</ItemGroup>

<ItemGroup Label="Private dependencies">
<PackageReference Include="Obsolete.Fody" Version="5.3.0" PrivateAssets="All" />
<PackageReference Include="Particular.Packaging" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
<PackageReference Include="Particular.Packaging" Version="4.1.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System;
using Configuration.AdvancedExtensibility;
using Outbox;
using Persistence.DynamoDB;

/// <summary>
/// Outbox configuration extensions for DynamoDB persistence.
Expand All @@ -15,8 +14,8 @@ public static class DynamoOutboxConfigurationExtensions
/// </summary>
public static OutboxSettings UseTable(this OutboxSettings outboxSettings, TableConfiguration tableConfiguration)
{
Guard.ThrowIfNull(outboxSettings);
Guard.ThrowIfNull(tableConfiguration);
ArgumentNullException.ThrowIfNull(outboxSettings);
ArgumentNullException.ThrowIfNull(tableConfiguration);

outboxSettings.GetSettings().GetOrCreate<OutboxPersistenceConfiguration>().Table = tableConfiguration;
return outboxSettings;
Expand All @@ -27,7 +26,7 @@ public static OutboxSettings UseTable(this OutboxSettings outboxSettings, TableC
/// </summary>
public static OutboxSettings SetTimeToKeepDeduplicationData(this OutboxSettings outboxSettings, TimeSpan timeToKeepDeduplicationData)
{
Guard.ThrowIfNegativeOrZero(timeToKeepDeduplicationData);
ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(timeToKeepDeduplicationData, TimeSpan.Zero);

outboxSettings.GetSettings().GetOrCreate<OutboxPersistenceConfiguration>().TimeToKeepDeduplicationData = timeToKeepDeduplicationData;
return outboxSettings;
Expand All @@ -38,7 +37,7 @@ public static OutboxSettings SetTimeToKeepDeduplicationData(this OutboxSettings
/// </summary>
public static OutboxSettings CreateTable(this OutboxSettings outboxSettings, bool createTable)
{
Guard.ThrowIfNull(outboxSettings);
ArgumentNullException.ThrowIfNull(outboxSettings);

outboxSettings.GetSettings().GetOrCreate<OutboxPersistenceConfiguration>().CreateTable = createTable;
return outboxSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static Dictionary<string, AttributeValue> SerializeStringDictionary(Dictionary<s
{
if (value == null)
{
return new Dictionary<string, AttributeValue>(0);
return [];
}

var attributeValues = new Dictionary<string, AttributeValue>(value.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace NServiceBus.Persistence.DynamoDB;
using Amazon.DynamoDBv2.Model;
using NServiceBus.Logging;

// While this class looks like it has some generic helper flavour it was deliberately kept as close
// While this class looks like it has some generic helper flavor it was deliberately kept as close
// as possible to the requirements of the outbox persister and can only be used in that context.
// Otherwise some significant refactoring would be required.
static class WriteRequestBatchExecutionExtensions
Expand Down
Loading