From 7affdd9165abea70d8550fa8b8989dcceedb7153 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 01:24:37 +0000 Subject: [PATCH 1/6] Bump RabbitMQ.Client from 6.8.1 to 7.0.0 in /src/backend Bumps [RabbitMQ.Client](https://github.com/rabbitmq/rabbitmq-dotnet-client) from 6.8.1 to 7.0.0. - [Release notes](https://github.com/rabbitmq/rabbitmq-dotnet-client/releases) - [Changelog](https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/rabbitmq/rabbitmq-dotnet-client/compare/v6.8.1...v7.0.0) --- updated-dependencies: - dependency-name: RabbitMQ.Client dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- src/backend/WebApi/WebApi.csproj | 2 +- src/backend/WebApi/packages.lock.json | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/backend/WebApi/WebApi.csproj b/src/backend/WebApi/WebApi.csproj index 6166efe..ab0f222 100644 --- a/src/backend/WebApi/WebApi.csproj +++ b/src/backend/WebApi/WebApi.csproj @@ -24,7 +24,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/backend/WebApi/packages.lock.json b/src/backend/WebApi/packages.lock.json index 900def0..c4ebaf9 100644 --- a/src/backend/WebApi/packages.lock.json +++ b/src/backend/WebApi/packages.lock.json @@ -111,12 +111,12 @@ }, "RabbitMQ.Client": { "type": "Direct", - "requested": "[6.8.1, )", - "resolved": "6.8.1", - "contentHash": "jNsmGgmCNw2S/NzskeN2ijtGywtH4Sk/G6jWUTD5sY9SrC27Xz6BsLIiB8hdsfjeyWCa4j4GvCIGkpE8wrjU1Q==", + "requested": "[7.0.0, )", + "resolved": "7.0.0", + "contentHash": "8YJz22mOSMtkbIVuVSz2HbJwbpKwRoXQ1uqbczDUt1w1Ds8dxFs6dkV/oZ8AlTmkErZjtQelHv+oBu52ud00WA==", "dependencies": { - "System.Memory": "4.5.5", - "System.Threading.Channels": "7.0.0" + "System.IO.Pipelines": "8.0.0", + "System.Threading.RateLimiting": "8.0.0" } }, "SauceControl.InheritDoc": { @@ -736,13 +736,13 @@ }, "System.IO.Pipelines": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "ryTgF+iFkpGZY1vRQhfCzX0xTdlV3pyaTTqRu2ETbEv+HlV7O6y7hyQURnghNIXvctl5DuZ//Dpks6HdL/Txgw==" + "resolved": "8.0.0", + "contentHash": "FHNOatmUq0sqJOkTx+UF/9YK1f180cnW5FVqnQMvYUN0elp6wFzbtPSiqbo1/ru8ICp43JM1i7kKkk6GsNGHlA==" }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" }, "System.Memory.Data": { "type": "Transitive", @@ -853,8 +853,13 @@ }, "System.Threading.Channels": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "qmeeYNROMsONF6ndEZcIQ+VxR4Q/TX/7uIVLJqtwIWL7dDWeh0l1UIqgo4wYyjG//5lUNhwkLDSFl+pAWO6oiA==" + "resolved": "6.0.0", + "contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q==" + }, + "System.Threading.RateLimiting": { + "type": "Transitive", + "resolved": "8.0.0", + "contentHash": "7mu9v0QDv66ar3DpGSZHg9NuNcxDaaAcnMULuZlaTpP9+hwXhrxNGsF5GmLkSHxFdb5bBc1TzeujsRgTrPWi+Q==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", From 7b1e2dc8c5675263e283b15d5b954235f64ac597 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Wed, 6 Nov 2024 01:25:00 +0000 Subject: [PATCH 2/6] Update lockfiles --- tests/backend/WebApi.Tests/packages.lock.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/backend/WebApi.Tests/packages.lock.json b/tests/backend/WebApi.Tests/packages.lock.json index b377daf..8899387 100644 --- a/tests/backend/WebApi.Tests/packages.lock.json +++ b/tests/backend/WebApi.Tests/packages.lock.json @@ -774,11 +774,11 @@ }, "RabbitMQ.Client": { "type": "Transitive", - "resolved": "6.8.1", - "contentHash": "jNsmGgmCNw2S/NzskeN2ijtGywtH4Sk/G6jWUTD5sY9SrC27Xz6BsLIiB8hdsfjeyWCa4j4GvCIGkpE8wrjU1Q==", + "resolved": "7.0.0", + "contentHash": "8YJz22mOSMtkbIVuVSz2HbJwbpKwRoXQ1uqbczDUt1w1Ds8dxFs6dkV/oZ8AlTmkErZjtQelHv+oBu52ud00WA==", "dependencies": { - "System.Memory": "4.5.5", - "System.Threading.Channels": "7.0.0" + "System.IO.Pipelines": "8.0.0", + "System.Threading.RateLimiting": "8.0.0" } }, "SharpZipLib": { @@ -898,8 +898,8 @@ }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" + "resolved": "4.5.4", + "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" }, "System.Memory.Data": { "type": "Transitive", @@ -1005,10 +1005,10 @@ "resolved": "4.7.2", "contentHash": "TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==" }, - "System.Threading.Channels": { + "System.Threading.RateLimiting": { "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "qmeeYNROMsONF6ndEZcIQ+VxR4Q/TX/7uIVLJqtwIWL7dDWeh0l1UIqgo4wYyjG//5lUNhwkLDSFl+pAWO6oiA==" + "resolved": "8.0.0", + "contentHash": "7mu9v0QDv66ar3DpGSZHg9NuNcxDaaAcnMULuZlaTpP9+hwXhrxNGsF5GmLkSHxFdb5bBc1TzeujsRgTrPWi+Q==" }, "System.Threading.Tasks.Extensions": { "type": "Transitive", @@ -1048,7 +1048,7 @@ "OpenTelemetry.Instrumentation.AspNetCore": "[1.9.0, )", "OpenTelemetry.Instrumentation.Http": "[1.9.0, )", "OpenTelemetry.Instrumentation.Runtime": "[1.9.0, )", - "RabbitMQ.Client": "[6.8.1, )", + "RabbitMQ.Client": "[7.0.0, )", "Swashbuckle.AspNetCore": "[6.9.0, )", "Swashbuckle.AspNetCore.ReDoc": "[6.9.0, )" } From ad964737e1f8f6f03ea679bf42668f638b260d3c Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Wed, 6 Nov 2024 19:51:47 +0100 Subject: [PATCH 3/6] Fix Migration to RabbitMQ 7 async pattern and IChannel --- .../Controllers/SendMessageController.cs | 8 +++--- .../WebApi/Messaging/MessageReceiver.cs | 25 ++++++++++++------- src/backend/WebApi/Messaging/MessageSender.cs | 25 +++++++++++-------- .../WebApi/Messaging/RabbitMqHelper.cs | 19 +++++++------- .../Controllers/SendMessageControllerTests.cs | 4 +-- .../WebApi.Tests/Messaging/RabbitMqTests.cs | 10 ++++---- 6 files changed, 51 insertions(+), 40 deletions(-) diff --git a/src/backend/WebApi/Controllers/SendMessageController.cs b/src/backend/WebApi/Controllers/SendMessageController.cs index 8de718e..a43af6e 100644 --- a/src/backend/WebApi/Controllers/SendMessageController.cs +++ b/src/backend/WebApi/Controllers/SendMessageController.cs @@ -23,9 +23,9 @@ public class SendMessageController(IMessageSender messageSender) : ControllerBas /// /// A string indicating the result of the message sending operation. [HttpGet] - public Task>> Get() => - Task.FromResult>>(Ok(new GenericValue + public async Task>> Get() => + Ok(new GenericValue { - Value = messageSender.SendMessage() - })); + Value = await messageSender.SendMessageAsync() + }); } \ No newline at end of file diff --git a/src/backend/WebApi/Messaging/MessageReceiver.cs b/src/backend/WebApi/Messaging/MessageReceiver.cs index 58bd459..1e5e001 100644 --- a/src/backend/WebApi/Messaging/MessageReceiver.cs +++ b/src/backend/WebApi/Messaging/MessageReceiver.cs @@ -22,7 +22,7 @@ public sealed class MessageReceiver : IDisposable private readonly ILogger _logger; private readonly IConnection _connection; - private readonly IModel _channel; + private readonly IChannel _channel; /// /// Initializes a new instance of the class, creating a connection to RabbitMQ @@ -32,8 +32,13 @@ public sealed class MessageReceiver : IDisposable public MessageReceiver(ILogger logger) { _logger = logger; - _connection = RabbitMqHelper.CreateConnection(); - _channel = RabbitMqHelper.CreateModelAndDeclareTestQueue(_connection); + _connection = RabbitMqHelper.CreateConnectionAsync() + .GetAwaiter() + .GetResult(); + + _channel = RabbitMqHelper.CreateModelAndDeclareTestQueueAsync(_connection) + .GetAwaiter() + .GetResult(); } /// @@ -48,9 +53,9 @@ public void Dispose() /// /// Starts the message consumer which listens for messages on the declared queue and processes them. /// - public void StartConsumer() + public async Task StartConsumerAsync() { - RabbitMqHelper.StartConsumer(_channel, ReceiveMessage); + await RabbitMqHelper.StartConsumerAsync(_channel, ReceiveMessageAsync); } /// @@ -59,7 +64,7 @@ public void StartConsumer() /// duration. /// /// The event arguments containing the message and metadata. - public void ReceiveMessage(BasicDeliverEventArgs ea) + public Task ReceiveMessageAsync(BasicDeliverEventArgs ea) { // Extract the PropagationContext of the upstream parent from the message headers. var parentContext = Propagator.Extract(default, ea.BasicProperties, ExtractTraceContextFromBasicProperties); @@ -74,7 +79,7 @@ public void ReceiveMessage(BasicDeliverEventArgs ea) { var message = Encoding.UTF8.GetString(ea.Body.Span.ToArray()); - _logger.LogInformation($"Message received: [{message}]"); + _logger.LogInformation("Message received: [{Message}]", message); activity?.SetTag("message", message); @@ -89,13 +94,15 @@ public void ReceiveMessage(BasicDeliverEventArgs ea) { _logger.LogError(ex, "Message processing failed."); } + + return Task.CompletedTask; } - private IEnumerable ExtractTraceContextFromBasicProperties(IBasicProperties props, string key) + private IEnumerable ExtractTraceContextFromBasicProperties(IReadOnlyBasicProperties props, string key) { try { - if (props.Headers.TryGetValue(key, out var value) && value is byte[] bytes) + if (props.Headers != null && props.Headers.TryGetValue(key, out var value) && value is byte[] bytes) return [ Encoding.UTF8.GetString(bytes) diff --git a/src/backend/WebApi/Messaging/MessageSender.cs b/src/backend/WebApi/Messaging/MessageSender.cs index 03ce49d..5b99d09 100644 --- a/src/backend/WebApi/Messaging/MessageSender.cs +++ b/src/backend/WebApi/Messaging/MessageSender.cs @@ -21,7 +21,7 @@ public sealed class MessageSender : IMessageSender, IDisposable private readonly ILogger _logger; private readonly IConnection _connection; - private readonly IModel _channel; + private readonly IChannel _channel; /// /// Initializes a new instance of the class, establishing a connection and channel to @@ -31,8 +31,13 @@ public sealed class MessageSender : IMessageSender, IDisposable public MessageSender(ILogger logger) { _logger = logger; - _connection = RabbitMqHelper.CreateConnection(); - _channel = RabbitMqHelper.CreateModelAndDeclareTestQueue(_connection); + _connection = RabbitMqHelper.CreateConnectionAsync() + .GetAwaiter() + .GetResult(); + + _channel = RabbitMqHelper.CreateModelAndDeclareTestQueueAsync(_connection) + .GetAwaiter() + .GetResult(); } /// @@ -46,7 +51,7 @@ public void Dispose() /// /// Including propagating the OpenTelemetry trace context. - public string SendMessage() + public async Task SendMessageAsync() { try { @@ -55,7 +60,7 @@ public string SendMessage() var activityName = $"{RabbitMqHelper.TestQueueName} send"; using var activity = ActivitySource.StartActivity(activityName, ActivityKind.Producer); - var props = _channel.CreateBasicProperties(); + var props = new BasicProperties(); // Depending on Sampling (and whether a listener is registered or not), the // activity above may not be created. @@ -77,13 +82,14 @@ public string SendMessage() var body = $"Published message: DateTime.Now = {DateTime.Now}."; - _channel.BasicPublish( + await _channel.BasicPublishAsync( RabbitMqHelper.DefaultExchangeName, RabbitMqHelper.TestQueueName, + true, props, Encoding.UTF8.GetBytes(body)); - _logger.LogInformation($"Message sent: [{body}]"); + _logger.LogInformation("Message sent: [{Body}]", body); return body; } @@ -104,8 +110,7 @@ private void InjectTraceContextIntoBasicProperties(IBasicProperties props, strin { try { - if (props.Headers == null) - props.Headers = new Dictionary(); + props.Headers ??= new Dictionary(); props.Headers[key] = value; } @@ -126,5 +131,5 @@ public interface IMessageSender /// Sends a message to a RabbitMQ queue /// /// A string representing the message that was sent. - public string SendMessage(); + public Task SendMessageAsync(); } \ No newline at end of file diff --git a/src/backend/WebApi/Messaging/RabbitMqHelper.cs b/src/backend/WebApi/Messaging/RabbitMqHelper.cs index 221d30f..96138e7 100644 --- a/src/backend/WebApi/Messaging/RabbitMqHelper.cs +++ b/src/backend/WebApi/Messaging/RabbitMqHelper.cs @@ -42,23 +42,22 @@ public static class RabbitMqHelper /// Creates and returns a new RabbitMQ connection using the configured ConnectionFactory. /// /// A new IConnection instance for interacting with RabbitMQ. - public static IConnection CreateConnection() => ConnectionFactory.CreateConnection(); + public static async Task CreateConnectionAsync() => await ConnectionFactory.CreateConnectionAsync(); /// /// Creates a new channel from the given connection, and declares a test queue for message delivery. /// /// The RabbitMQ connection to use for creating the channel and declaring the queue. /// A new IModel instance representing the channel with the declared queue. - public static IModel CreateModelAndDeclareTestQueue(IConnection connection) + public static async Task CreateModelAndDeclareTestQueueAsync(IConnection connection) { - var channel = connection.CreateModel(); + var channel = await connection.CreateChannelAsync(); - channel.QueueDeclare( + await channel.QueueDeclareAsync( TestQueueName, false, false, - false, - null); + false); return channel; } @@ -68,13 +67,13 @@ public static IModel CreateModelAndDeclareTestQueue(IConnection connection) /// /// The channel to start the consumer on. /// The callback to invoke for each received message. - public static void StartConsumer(IModel channel, Action processMessage) + public static async Task StartConsumerAsync(IChannel channel, Func processMessage) { - var consumer = new EventingBasicConsumer(channel); + var consumer = new AsyncEventingBasicConsumer(channel); - consumer.Received += (bc, ea) => processMessage(ea); + consumer.ReceivedAsync += (bc, ea) => processMessage(ea); - channel.BasicConsume(TestQueueName, true, consumer); + await channel.BasicConsumeAsync(TestQueueName, true, consumer); } /// diff --git a/tests/backend/WebApi.Tests/Controllers/SendMessageControllerTests.cs b/tests/backend/WebApi.Tests/Controllers/SendMessageControllerTests.cs index 151e5e7..b9fe418 100644 --- a/tests/backend/WebApi.Tests/Controllers/SendMessageControllerTests.cs +++ b/tests/backend/WebApi.Tests/Controllers/SendMessageControllerTests.cs @@ -22,8 +22,8 @@ public void SetUp() public async Task Get_ReturnsOkResult() { // Arrange - _messageSenderMock.Setup(static messageSender => messageSender.SendMessage()) - .Returns("Message sent"); + _messageSenderMock.Setup(static messageSender => messageSender.SendMessageAsync()) + .ReturnsAsync("Message sent"); // Act var result = await _controller.Get(); diff --git a/tests/backend/WebApi.Tests/Messaging/RabbitMqTests.cs b/tests/backend/WebApi.Tests/Messaging/RabbitMqTests.cs index edc1ccc..0e46996 100644 --- a/tests/backend/WebApi.Tests/Messaging/RabbitMqTests.cs +++ b/tests/backend/WebApi.Tests/Messaging/RabbitMqTests.cs @@ -31,7 +31,7 @@ public async Task DisposeAsync() [Test] [Order(1)] - public void IsOpen_ReturnsTrue() + public async Task IsOpen_ReturnsTrue() { // Given var connectionFactory = new ConnectionFactory @@ -40,7 +40,7 @@ public void IsOpen_ReturnsTrue() }; // When - using var connection = connectionFactory.CreateConnection(); + await using var connection = await connectionFactory.CreateConnectionAsync(); // Then Assert.That(connection.IsOpen); @@ -48,7 +48,7 @@ public void IsOpen_ReturnsTrue() [Test] [Order(2)] - public void MessageSender_SendsMessage() + public async Task MessageSender_SendsMessage() { // Given var connectionFactory = new ConnectionFactory @@ -66,8 +66,8 @@ public void MessageSender_SendsMessage() using var messageReceiver = new MessageReceiver(messageReceiverLogger.Object); // When - messageSender.SendMessage(); - messageReceiver.ReceiveMessage(new BasicDeliverEventArgs()); + await messageSender.SendMessageAsync(); + await messageReceiver.ReceiveMessageAsync(new BasicDeliverEventArgs("consumerTag", ulong.MinValue, false, "exchange", "channel", new BasicProperties(), ReadOnlyMemory.Empty)); // Then messageSenderLogger.VerifyLog(LogLevel.Information, Times.Once(), "Message sent:"); From 994554ebba5066289072e300f32c4565365d5706 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Wed, 6 Nov 2024 19:52:11 +0100 Subject: [PATCH 4/6] Add support for fixing dependabot branches in githooks --- .githooks/commit-msg | 4 ++++ .githooks/pre-commit | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.githooks/commit-msg b/.githooks/commit-msg index a2bd0fe..b5d16e7 100644 --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -22,6 +22,10 @@ MAIN_BRANCH="main" current_branch="$(git rev-parse --abbrev-ref HEAD)" +if [[ $current_branch =~ dependabot/.* ]]; then + exit 0 +fi + case "$current_branch" in $DEV_BRANCH) error_msg="Aborting commit. Please use the following format: " diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 9670954..fe52b0e 100644 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -10,7 +10,7 @@ source .githooks/config.sh local_branch="$(git rev-parse --abbrev-ref HEAD)" # valid_branch_regex="^(feature|bugfix|improvement|library|prerelease|release|hotfix)\/[a-z0-9._-]+$" -valid_branch_regex="^(main|qa|test|dev|${BRANCH_PREFIXES}\/${JIRA_TAG}-[0-9]+-[A-Za-z0-9-]+)$" +valid_branch_regex="^(main|qa|test|dev|${BRANCH_PREFIXES}\/${JIRA_TAG}-[0-9]+-[A-Za-z0-9-]+|dependabot/.*)$" message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again." From 9691279093d2805ac4c905111417e16f174c8aaa Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Wed, 6 Nov 2024 20:05:32 +0100 Subject: [PATCH 5/6] Add extra conditions to stryker and ReSharper inspect code steps --- .github/workflows/backend-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index b59e951..e945a15 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -197,6 +197,7 @@ jobs: - name: Stryker id: stryker + if: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }} run: | dotnet stryker --reporter "html" --reporter "json" --reporter "markdown" --solution Backend.sln --output StrykerOutput cp -r StrykerOutput/reports StrykerReports @@ -206,13 +207,14 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v4 + if: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }} with: name: StrykerReports path: ${{ env.BACKEND_SOLUTION_PATH }}/StrykerReports - name: "Create or Update PR Comment" uses: im-open/update-pr-comment@v1.2.2 - if: ${{ always() && github.event_name == 'pull_request' }} + if: ${{ always() && github.event_name == 'pull_request' && github.base_ref == 'dev' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-Stryker" @@ -220,7 +222,7 @@ jobs: - name: Inspect code uses: muno92/resharper_inspectcode@v1 - if: ${{ github.event_name == 'pull_request' }} + if: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }} with: workingDirectory: ${{ env.BACKEND_SOLUTION_PATH }} solutionPath: Backend.sln From 98f0d5171efc53c69e6757699d9e249c84887de6 Mon Sep 17 00:00:00 2001 From: Hans Christian Winther-Sorensen Date: Wed, 6 Nov 2024 20:06:47 +0100 Subject: [PATCH 6/6] Fix target branch should be main to reduce run times --- .github/workflows/backend-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index e945a15..8007368 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -197,7 +197,7 @@ jobs: - name: Stryker id: stryker - if: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }} + if: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' }} run: | dotnet stryker --reporter "html" --reporter "json" --reporter "markdown" --solution Backend.sln --output StrykerOutput cp -r StrykerOutput/reports StrykerReports @@ -207,14 +207,14 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@v4 - if: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }} + if: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' }} with: name: StrykerReports path: ${{ env.BACKEND_SOLUTION_PATH }}/StrykerReports - name: "Create or Update PR Comment" uses: im-open/update-pr-comment@v1.2.2 - if: ${{ always() && github.event_name == 'pull_request' && github.base_ref == 'dev' }} + if: ${{ always() && github.event_name == 'pull_request' && github.base_ref == 'main' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-Stryker" @@ -222,7 +222,7 @@ jobs: - name: Inspect code uses: muno92/resharper_inspectcode@v1 - if: ${{ github.event_name == 'pull_request' && github.base_ref == 'dev' }} + if: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' }} with: workingDirectory: ${{ env.BACKEND_SOLUTION_PATH }} solutionPath: Backend.sln