Skip to content

Commit

Permalink
Merge pull request #9071 from g-gaston/release-notes-mutliple-areas-subs
Browse files Browse the repository at this point in the history
🌱 Improve multiple areas PRs with user friendly subs
  • Loading branch information
k8s-ci-robot authored Aug 8, 2023
2 parents a847308 + 333b213 commit a3c7805
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions hack/tools/release/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ func getAreaLabel(merge string) (string, error) {
var areaLabels []string
for _, label := range pr.Labels {
if area, ok := trimAreaLabel(label.Name); ok {
if userFriendlyArea, ok := userFriendlyAreas[area]; ok {
area = userFriendlyArea
}

areaLabels = append(areaLabels, area)
}
}
Expand All @@ -183,13 +187,9 @@ func getAreaLabel(merge string) (string, error) {
case 0:
return missingAreaLabelPrefix, nil
case 1:
area := areaLabels[0]
if userFriendlyArea, ok := userFriendlyAreas[area]; ok {
area = userFriendlyArea
}
return area, nil
return areaLabels[0], nil
default:
return multipleAreaLabelsPrefix + strings.Join(areaLabels, "|") + "]", nil
return multipleAreaLabelsPrefix + strings.Join(areaLabels, "/") + "]", nil
}
}

Expand Down Expand Up @@ -371,6 +371,7 @@ func run() int {
str2 := strings.ToLower(mergeslice[j])
return str1 < str2
})

for _, merge := range mergeslice {
fmt.Println(merge)
}
Expand Down

0 comments on commit a3c7805

Please sign in to comment.