Skip to content

Properly handle merges by the service, fix scenario test#5437

Merged
dkurepa merged 8 commits intodotnet:mainfrom
dkurepa:dkurepa/FixFFTest
Nov 6, 2025
Merged

Properly handle merges by the service, fix scenario test#5437
dkurepa merged 8 commits intodotnet:mainfrom
dkurepa:dkurepa/FixFFTest

Conversation

@dkurepa
Copy link
Copy Markdown
Member

@dkurepa dkurepa commented Nov 6, 2025

dkurepa and others added 3 commits July 15, 2025 10:37
…t#5043)

<!-- Link the GitHub or AzDO issue this pull request is associated with.
Please copy and paste the full URL rather than using the
dotnet/arcade-services# syntax -->
dotnet#5030

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Adam <[email protected]>
Stop ForwardFlow updates if they'd overwrite manual PR changes (dotnet#5043)
Copilot AI review requested due to automatic review settings November 6, 2025 13:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors pull request handling logic to eliminate code duplication and improves test coverage for code flow scenarios. The changes extract common PR merge/close handling into a reusable method while adding a test step to verify PR commenting behavior.

  • Extracted duplicate code handling merged/closed PRs into a new HandleMergedOrClosedPr method
  • Added test step to re-trigger subscription for verifying PR comments after merge
  • Minor indentation fix in test code

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/ProductConstructionService.ScenarioTests/ScenarioTests/ScenarioTests_CodeFlow.cs Adds re-trigger of subscription in test to verify comment posting behavior after PR merge
src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs Refactors duplicate PR merge/close handling code into a new HandleMergedOrClosedPr method; adds unused import
Comments suppressed due to low confidence (1)

src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs:6

  • The LibGit2Sharp namespace is imported but not used anywhere in this file. This import should be removed as it's unnecessary. The LibGit2Sharp types are abstracted behind the ILocalLibGit2Client interface used in this class.
using Maestro.Data.Models;

pr.Url);
}

_logger.LogInformation("PR {url} has been manually {action}. Stopping tracking it", pr.Url, prInfo.Status.ToString().ToLowerInvariant());
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log message says 'manually' but this is incorrect when the reason is DependencyFlowEventReason.AutomaticallyMerged. The log message should be conditional or changed to be accurate for both manual and automatic actions.

Suggested change
_logger.LogInformation("PR {url} has been manually {action}. Stopping tracking it", pr.Url, prInfo.Status.ToString().ToLowerInvariant());
string mergeType = reason == DependencyFlowEventReason.AutomaticallyMerged ? "automatically" : "manually";
_logger.LogInformation("PR {url} has been {mergeType} {action}. Stopping tracking it", pr.Url, mergeType, prInfo.Status.ToString().ToLowerInvariant());

Copilot uses AI. Check for mistakes.
…enarioTests_CodeFlow.cs

Co-authored-by: Přemek Vysoký <[email protected]>
@dkurepa dkurepa merged commit 1ee2cae into dotnet:main Nov 6, 2025
8 of 9 checks passed
@dkurepa dkurepa deleted the dkurepa/FixFFTest branch November 6, 2025 13:48
dkurepa added a commit to dkurepa/arcade-services that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants