Fix how we work with PR branch SHA#5304
Merged
premun merged 7 commits intodotnet:mainfrom Sep 24, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors how pull request branch SHA values are handled by introducing a dedicated HeadBranchSha field to properly track the PR head branch SHA separately from the source SHA. Previously, the SourceSha field was being overloaded to store both the build commit SHA and the PR head branch SHA in different contexts.
Key changes:
- Added
HeadBranchShaproperty toInProgressPullRequestmodel with proper documentation - Updated PR creation and state management to populate and use the dedicated head branch SHA field
- Simplified conflict detection logic by comparing SHA values directly instead of making additional Git API calls
- Updated all test files to use the new field structure
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/Model/InProgressPullRequest.cs | Added HeadBranchSha property with documentation to track PR head branch SHA separately |
| src/ProductConstructionService/ProductConstructionService.DependencyFlow/PullRequestUpdater.cs | Updated PR handling logic to use dedicated head branch SHA field and simplified conflict detection |
| test/ProductConstructionService.DependencyFlow.Tests/UpdateAssetsForCodeFlowTests.cs | Updated test data to include HeadBranchSha field |
| test/ProductConstructionService.DependencyFlow.Tests/PullRequestUpdaterTests.cs | Updated test setup and mocking to handle new SHA field structure |
| test/ProductConstructionService.DependencyFlow.Tests/PullRequestCommentBuilderTests.cs | Updated test PR objects to separate head branch SHA from source SHA |
| test/ProductConstructionService.DependencyFlow.Tests/PendingCodeFlowUpdatesTests.cs | Updated test parameter names and removed unused import |
| test/ProductConstructionService.DependencyFlow.Tests/MergePolicyEvaluationTests.cs | Updated merge policy tests to use head branch SHA and removed unused import |
adamzip
reviewed
Sep 24, 2025
adamzip
previously approved these changes
Sep 24, 2025
Contributor
adamzip
left a comment
There was a problem hiding this comment.
approving with 1 minor suggestion
adamzip
approved these changes
Sep 24, 2025
premun
added a commit
to premun/arcade-services
that referenced
this pull request
Sep 25, 2025
Got introduced in dotnet#5304
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#5046