Skip to content

Commit

Permalink
Merge pull request #10502 from yongyiduan/pac_fix_github
Browse files Browse the repository at this point in the history
feat:流水线版本管理机制 #8161 优化stage label
  • Loading branch information
bkci-bot authored Jun 11, 2024
2 parents e237784 + 8ace8c3 commit f7ba547
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ class StageTransfer @Autowired(required = false) constructor(
)
}

private fun maskYamlStageLabel(tags: List<String>?): List<String> {
private fun maskYamlStageLabel(tags: List<String?>?): List<String> {
if (tags.isNullOrEmpty()) return emptyList()
return tags.map { StageLabel.parseById(it).value }
return tags.filterNotNull().map { StageLabel.parseById(it).value }
}

private fun getCheckInForStage(stage: Stage): PreStageCheck? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ object ScriptYmlUtils {

private fun formatStageLabel(labels: Any?): List<String> {
if (labels == null) {
return emptyList()
return listOf(StageLabel.BUILD.id)
}

val transLabels = anyToListString(labels)
Expand All @@ -586,6 +586,9 @@ object ScriptYmlUtils {
)
}
}
if (newLabels.isEmpty()) {
newLabels.add(StageLabel.BUILD.id)
}

return newLabels
}
Expand Down

0 comments on commit f7ba547

Please sign in to comment.