-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branch selection #1469
Closed
Closed
Branch selection #1469
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
614ae93
adding selected branch to model
pk044 bf146e5
regex fix
pk044 2b491e4
adding more asserts for decoding repos
pk044 54d9c6a
adding branch to Repo, modifying regex
pk044 40af7af
scala regexes require passing nulls when pattern matching on optional…
pk044 77ec802
check out from base branch before creating a PR + prepend base branch…
pk044 ce01940
including branch name in Repo key encoding
pk044 2dbb90f
adjusting tests for checking branch names
pk044 30fe4d8
adjust tests
pk044 5a8ec70
adjusting tests
pk044 def6ec9
adjust tests
pk044 1b055b0
add selected branch tests for bitbucket
pk044 702cc5a
adding github tests for selected branch
pk044 2d9588e
adjust tests
pk044 45e6636
revert repos.md
pk044 b99e114
run scalafmt
pk044 2ad6983
run scalafmt
pk044 4c35076
run scalafmt
pk044 e9f5d59
use default parameters
pk044 b12912a
mention base branch in PR title
pk044 4d14b59
add Iterators to adopters :)
pk044 48684da
formatting
pk044 de5400a
checkout to default branch if selected branch was not specified
pk044 ee1b9a5
Merge remote-tracking branch 'fork/branch-selection' into branch-sele…
pk044 6983396
modify branch naming convention
pk044 a01709b
pass baseBranch to branchFor only if it's not default
pk044 ccc3772
Merge branch 'master' of https://github.com/scala-steward-org/scala-s…
pk044 4a3c6d3
condition fix
pk044 84247d3
formatting
pk044 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,17 +21,18 @@ import org.scalasteward.core.repoconfig.CommitsConfig | |
import org.scalasteward.core.update.show | ||
|
||
package object git { | ||
def branchFor(update: Update): Branch = | ||
Branch(s"update/${update.name}-${update.nextVersion}") | ||
def branchFor(update: Update, baseBranch: Branch): Branch = | ||
Branch(s"update/${baseBranch.name}/${update.name}-${update.nextVersion}") | ||
|
||
def commitMsgFor(update: Update, commitsConfig: CommitsConfig): String = { | ||
def commitMsgFor(update: Update, commitsConfig: CommitsConfig, branch: Branch): String = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only stylistic, but can we mention the branch only if it is not the default? |
||
val artifact = show.oneLiner(update) | ||
val defaultMessage = s"Update $artifact to ${update.nextVersion}" | ||
val defaultMessage = s"Update $artifact to ${update.nextVersion} (${branch.name})" | ||
commitsConfig.messageOrDefault | ||
.replace("${default}", defaultMessage) | ||
.replace("${artifactName}", artifact) | ||
.replace("${currentVersion}", update.currentVersion) | ||
.replace("${nextVersion}", update.nextVersion) | ||
.replace("${branchName}", branch.name) | ||
} | ||
|
||
// man 7 gitrevisions: | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
branchFor
is used invcs.listingBranch
to create thehead
parameter forVCSApiAlg#listPullRequests
which is used to find already existing Scala Steward PRs. If we change this for PRs that target the default branch, Scala Steward will not find older PRs it already created and will create new ones. I guess this could result in thousands new but duplicated PRs by @scala-steward.Can we make this optional and only pass it if
baseBranch
is not the default branch?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure! i'll push a fix soon:)