in modules/core/src/main/scala/org/scalasteward/core/forge/data/NewPullRequestData.scala [275:324]
def from(
data: UpdateData,
branchName: String,
edits: List[EditAttempt] = List.empty,
artifactIdToUrl: Map[String, Uri] = Map.empty,
artifactIdToUpdateInfoUrls: Map[String, List[UpdateInfoUrl]] = Map.empty,
filesWithOldVersion: List[String] = List.empty,
addLabels: Boolean = false,
labels: List[String] = List.empty,
maximumPullRequestLength: Int = 65536
): NewPullRequestData =
NewPullRequestData(
title = CommitMsg
.replaceVariables(data.repoConfig.commitsOrDefault.messageOrDefault)(
data.update,
data.repoData.repo.branch
)
.title,
body = bodyFor(
data.update,
edits,
artifactIdToUrl,
artifactIdToUpdateInfoUrls,
filesWithOldVersion,
data.repoData.cache.maybeRepoConfigParsingError,
labels,
maximumPullRequestLength
),
head = branchName,
base = data.baseBranch,
labels = if (addLabels) labels else List.empty,
assignees = data.repoConfig.assigneesOrDefault,
reviewers = data.repoConfig.reviewersOrDefault
)
def updateTypeLabels(anUpdate: Update): List[String] = {
def forUpdate(update: Update.Single) = {
val dependencies = update.dependencies
if (dependencies.forall(_.configurations.contains("test")))
"test-library-update"
else if (dependencies.forall(_.configurations.contains("scalafix-rule")))
"scalafix-rule-update"
else if (dependencies.forall(_.sbtVersion.isDefined))
"sbt-plugin-update"
else
"library-update"
}
anUpdate.on(u => List(forUpdate(u)), _.updates.map(forUpdate).distinct)
}