Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions hack/tools/release/notes/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ import (
)

const (
missingAreaLabelPrefix = "MISSING_AREA"
areaLabelPrefix = "area/"
multipleAreaLabelsPrefix = "MULTIPLE_AREAS["
documentationArea = "Documentation"
missingAreaLabelPrefix = "MISSING_AREA"
areaLabelPrefix = "area/"
documentationArea = "Documentation"
)

var (
Expand Down Expand Up @@ -200,11 +199,27 @@ func (g prEntriesProcessor) generateNoteEntry(p *pr) *notesEntry {
}

entry.prNumber = fmt.Sprintf("%d", p.number)
entry.title = updateTitle(entry.title)
entry.title = formatPREntry(entry.title, entry.prNumber)

return entry
}

// UpdateTitle updates a title by removing the multiple colons(:).
func updateTitle(input string) string {
Copy link
Member

@sbueringer sbueringer Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What cases are we fixing here? Let's please add unit test coverage

Copy link
Member

@sbueringer sbueringer Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these colons coming from? (would be good to have an example to understand why we need this)

// Remove the extra colons from the title
colonCount := strings.Count(input, ":")
if colonCount == 2 {
// Find the position of the first colon
firstColonIndex := strings.Index(input, ":")
// Extract the part after the first colon and remove any leading spaces
partAfterColon := strings.TrimSpace(input[firstColonIndex+1:])
// Replace the first colon with "/"
input = input[:firstColonIndex] + "/" + partAfterColon
}
return input
}

// extractArea processes the PR labels to extract the area.
func (g prEntriesProcessor) extractArea(pr *pr) string {
var areaLabels []string
Expand All @@ -226,7 +241,7 @@ func (g prEntriesProcessor) extractArea(pr *pr) string {
case 1:
return areaLabels[0]
default:
return multipleAreaLabelsPrefix + strings.Join(areaLabels, "/") + "]"
return strings.Join(areaLabels, "/")
}
}

Expand Down