diff --git a/.editorconfig b/.editorconfig index bb5ac78..0030b50 100644 --- a/.editorconfig +++ b/.editorconfig @@ -309,6 +309,15 @@ dotnet_diagnostic.SA1011.severity = none # MA0015: The expression does not match a parameter dotnet_diagnostic.MA0015.severity = none +# VSTHRD103: Add synchronously blocks. Await AddAsync instead. +dotnet_diagnostic.VSTHRD103.severity = none + +# S8969: Remove this null-forgiving operator; the compiler already knows this expression is not null here. +dotnet_diagnostic.S8969.severity = none + +# MA0011: Use an overload of 'Error' that has a 'System.IFormatProvider' parameter +dotnet_diagnostic.MA0011.severity = none + # The relationship defined by this property contributes to a dependency loop resharper_entity_framework_model_validation_circular_dependency_highlighting = none diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8ac6b8c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/DiplomaticMailBot.Tests.Integration/DiplomaticMailBot.Tests.Integration.csproj b/DiplomaticMailBot.Tests.Integration/DiplomaticMailBot.Tests.Integration.csproj index 365ce4d..0ad6838 100644 --- a/DiplomaticMailBot.Tests.Integration/DiplomaticMailBot.Tests.Integration.csproj +++ b/DiplomaticMailBot.Tests.Integration/DiplomaticMailBot.Tests.Integration.csproj @@ -13,7 +13,10 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -22,7 +25,10 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/DiplomaticMailBot.Tests.Integration/Services/DbContainerManager.cs b/DiplomaticMailBot.Tests.Integration/Services/DbContainerManager.cs index 360979d..eca03cb 100644 --- a/DiplomaticMailBot.Tests.Integration/Services/DbContainerManager.cs +++ b/DiplomaticMailBot.Tests.Integration/Services/DbContainerManager.cs @@ -16,9 +16,8 @@ public async Task StartAsync() var containerName = "dipmailbot_integration_test_db_" + Guid.NewGuid().ToString("D"); - var containerBuilder = new PostgreSqlBuilder() + var containerBuilder = new PostgreSqlBuilder("postgres:17-bookworm") .WithName(containerName) - .WithImage("postgres:17-bookworm") .WithExposedPort(TestDefaults.DbPort) .WithPassword(TestDefaults.DbPassword) .WithAutoRemove(true) diff --git a/DiplomaticMailBot.Tests.Integration/Tests/PollRepositoryTests.cs b/DiplomaticMailBot.Tests.Integration/Tests/PollRepositoryTests.cs index 6da29b2..9950d23 100644 --- a/DiplomaticMailBot.Tests.Integration/Tests/PollRepositoryTests.cs +++ b/DiplomaticMailBot.Tests.Integration/Tests/PollRepositoryTests.cs @@ -232,7 +232,7 @@ public async Task OpenPendingPollsAsync_WithMultipleCandidates_SendsPollAndCreat SlotInstance = slotInstance, }, }; - await dbContext.MessageCandidates.AddRangeAsync(candidates); + await dbContext.MessageCandidates.AddRangeAsync(candidates, cancellationToken); await dbContext.SaveChangesAsync(cancellationToken); var repository = new PollRepository( @@ -1476,7 +1476,7 @@ public async Task SendVoteApproachingRemindersAsync_WithMultipleChatsAndRelation new DiplomaticRelation { SourceChat = chat3, TargetChat = chat4, CreatedAt = timeProvider.GetUtcNow().UtcDateTime }, new DiplomaticRelation { SourceChat = chat4, TargetChat = chat3, CreatedAt = timeProvider.GetUtcNow().UtcDateTime }, }; - await dbContext.DiplomaticRelations.AddRangeAsync(relations); + await dbContext.DiplomaticRelations.AddRangeAsync(relations, cancellationToken); // Create some existing slot instances to verify they don't trigger reminders var existingSlots = new[] @@ -1498,7 +1498,7 @@ public async Task SendVoteApproachingRemindersAsync_WithMultipleChatsAndRelation TargetChat = chat3, }, }; - await dbContext.SlotInstances.AddRangeAsync(existingSlots); + await dbContext.SlotInstances.AddRangeAsync(existingSlots, cancellationToken); await dbContext.SaveChangesAsync(cancellationToken); var repository = new PollRepository( diff --git a/DiplomaticMailBot.Tests.Integration/Tests/RegisteredChatRepositoryTests.cs b/DiplomaticMailBot.Tests.Integration/Tests/RegisteredChatRepositoryTests.cs index 72d44b5..2016098 100644 --- a/DiplomaticMailBot.Tests.Integration/Tests/RegisteredChatRepositoryTests.cs +++ b/DiplomaticMailBot.Tests.Integration/Tests/RegisteredChatRepositoryTests.cs @@ -61,7 +61,7 @@ public async Task ListRegisteredChatsAsync_ReturnsAllChats(CancellationToken can CreatedAt = timeProvider.GetUtcNow().UtcDateTime, }, }; - await dbContext.RegisteredChats.AddRangeAsync(chats); + await dbContext.RegisteredChats.AddRangeAsync(chats, cancellationToken); await dbContext.SaveChangesAsync(cancellationToken); var repository = new RegisteredChatRepository( diff --git a/DiplomaticMailBot.Tests.Unit/DiplomaticMailBot.Tests.Unit.csproj b/DiplomaticMailBot.Tests.Unit/DiplomaticMailBot.Tests.Unit.csproj index 33ee8f7..51f7483 100644 --- a/DiplomaticMailBot.Tests.Unit/DiplomaticMailBot.Tests.Unit.csproj +++ b/DiplomaticMailBot.Tests.Unit/DiplomaticMailBot.Tests.Unit.csproj @@ -9,7 +9,10 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -20,7 +23,10 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Directory.Packages.props b/Directory.Packages.props index c5154bb..985ea7c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,76 +1,54 @@ true - true - true - + - - all - runtime; build; native; contentfiles; analyzers - - - all - runtime; build; native; contentfiles; analyzers - - - - all - runtime; build; native; contentfiles; analyzers - - - all - runtime; build; native; contentfiles; analyzers - - + + + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - - - - - - - - - - + + + + - + \ No newline at end of file