Add PR filtration by source branch#15355
Merged
mmitche merged 1 commit intodotnet:mainfrom Dec 19, 2024
f-alizada:dev/falizada/filter-by-source-branch
Merged
Add PR filtration by source branch#15355mmitche merged 1 commit intodotnet:mainfrom f-alizada:dev/falizada/filter-by-source-branch
mmitche merged 1 commit intodotnet:mainfrom
f-alizada:dev/falizada/filter-by-source-branch
Conversation
mmitche
approved these changes
Dec 19, 2024
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.
Fixes #15352
Add additional filter for fetching already existing PRs.
Context
Current filtration:
https://github.com/dotnet/arcade/blob/110ba755f2b00749b230e7f61c791f90047e170b/.github/workflows/scripts/inter-branch-merge.ps1#L158C5-L177C1
Includes every PR which is open to the destination branch and limits the results by 100. (The limit is the maximum allowed by api)
So in dotnet/sdk#45547 the logic didn't find the existing PR and force-pushed to the branch. (Force push happens if there are no open PRs and we can safely override the code, but it should not be the case with open PR )
What is changed
Adding filtration to the query (headRefName, the source branch name from where the PR is created) leaving the PR results only the list with specified branch .
The rest of the logic does not change.
Ownership of the branch will be still verified:
https://github.com/dotnet/arcade/blob/110ba755f2b00749b230e7f61c791f90047e170b/.github/workflows/scripts/inter-branch-merge.ps1#L193C4-L195C26