fix: createPullRequest target branch handling#857
Open
PRAteek-singHWY wants to merge 1 commit intoOWASP:mainfrom
Open
fix: createPullRequest target branch handling#857PRAteek-singHWY wants to merge 1 commit intoOWASP:mainfrom
PRAteek-singHWY wants to merge 1 commit intoOWASP:mainfrom
Conversation
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.
Note
This is a small, scoped helper bugfix with targeted regression tests.
Given the limited scope, no separate issue was opened to avoid extra triage overhead.
Summary
This PR fixes base-branch selection in the GitHub PR helper.
createPullRequest(...)accepted atargetBranchargument, but the implementation always usedbase="master".As a result, callers could not control the PR target branch.
Issue
application/utils/git.pycreatePullRequest(...)ignored the providedtargetBranchScope
Changes
application/utils/git.py:create_pull(..., base="master")->create_pull(..., base=targetBranch)application/tests/git_utils_test.pyTest File
application/tests/git_utils_test.pyTest Description
The new test file validates both explicit and default behavior:
test_create_pull_request_uses_target_branchcreatePullRequest(..., targetBranch="main")repo.create_pull(...)is called withbase="main"test_create_pull_request_defaults_to_mastercreatePullRequest(...)withouttargetBranchrepo.create_pull(...)is called withbase="master"Validation
Ran:
./venv/bin/python -m pytest application/tests/git_utils_test.py -qResult:
2 passed