diff --git a/cli/release-automation/internal/automation/release_pr_body.go b/cli/release-automation/internal/automation/release_pr_body.go index c95ba8b19..b8e23cdff 100644 --- a/cli/release-automation/internal/automation/release_pr_body.go +++ b/cli/release-automation/internal/automation/release_pr_body.go @@ -69,48 +69,39 @@ func clarifyReleasePRCheckComponentHeadingBlock(block string) (string, bool) { component := matches[1] version := matches[2] - changed := false + displaySlug, found := releasePRCheckComponentDisplaySlug(component) + if !found { + return block, false + } - if summarySlug, found := releasePRCheckComponentSummarySlug(component); found { - clarifiedSummary := "
" + summarySlug + ": " + version + "" + changed := false + if displaySlug != component { + clarifiedSummary := "
" + displaySlug + ": " + version + "" block = strings.Replace(block, matches[0], clarifiedSummary, 1) changed = true } - displayName, found := releasePRCheckComponentDisplayName(component) - if !found { - return block, changed - } - heading := "## [" + version + "](" if !strings.Contains(block, heading) { return block, changed } - clarifiedHeading := "## [" + displayName + " " + version + "](" + clarifiedHeading := "## [" + displaySlug + ": " + version + "](" return strings.Replace(block, heading, clarifiedHeading, 1), true } -// releasePRCheckComponentSummarySlug renames component summary labels whose -// release-please component id lacks the uloop prefix. The release tag keeps -// the bare component id, so consumers that resolve tags from summaries must -// also accept the renamed slug (see release_tag_from_body in +// releasePRCheckComponentDisplaySlug labels both the collapsible summary and +// the changelog heading of a component block with the same slug. The +// dispatcher slug gains the uloop prefix for display, while its release tag +// keeps the bare component id, so consumers that resolve tags from summaries +// must also accept the renamed slug (see release_tag_from_body in // scripts/sync-published-release-pr-labels.sh). -func releasePRCheckComponentSummarySlug(component string) (string, bool) { - if component == "dispatcher" { - return "uloop-dispatcher", true - } - return "", false -} - -func releasePRCheckComponentDisplayName(component string) (string, bool) { +func releasePRCheckComponentDisplaySlug(component string) (string, bool) { switch component { - case "unity-package": - return "Unity Package", true + case "unity-package", "uloop-project-runner": + return component, true case "dispatcher", "uloop-dispatcher": - return "uloop Dispatcher", true - case "uloop-project-runner": - return "uloop Project Runner", true + return "uloop-dispatcher", true default: return "", false } diff --git a/cli/release-automation/internal/automation/release_pr_checks_test.go b/cli/release-automation/internal/automation/release_pr_checks_test.go index 55d700bd0..b04438ec3 100644 --- a/cli/release-automation/internal/automation/release_pr_checks_test.go +++ b/cli/release-automation/internal/automation/release_pr_checks_test.go @@ -76,9 +76,9 @@ func TestReleasePRCheckComponentHeadingsAreClarified(t *testing.T) { if !changed { t.Fatal("expected component release headings to change") } - assertReleasePRCheckLogContains(t, clarifiedBody, "## [Unity Package 3.0.0-beta.48](https://example.test/compare/v3.0.0-beta.47...v3.0.0-beta.48) (2026-07-01)") - assertReleasePRCheckLogContains(t, clarifiedBody, "## [uloop Dispatcher 3.0.1-beta.13](https://example.test/compare/dispatcher-v3.0.1-beta.12...dispatcher-v3.0.1-beta.13) (2026-07-11)") - assertReleasePRCheckLogContains(t, clarifiedBody, "## [uloop Project Runner 3.0.0-beta.45](https://example.test/compare/uloop-project-runner-v3.0.0-beta.44...uloop-project-runner-v3.0.0-beta.45) (2026-07-01)") + assertReleasePRCheckLogContains(t, clarifiedBody, "## [unity-package: 3.0.0-beta.48](https://example.test/compare/v3.0.0-beta.47...v3.0.0-beta.48) (2026-07-01)") + assertReleasePRCheckLogContains(t, clarifiedBody, "## [uloop-dispatcher: 3.0.1-beta.13](https://example.test/compare/dispatcher-v3.0.1-beta.12...dispatcher-v3.0.1-beta.13) (2026-07-11)") + assertReleasePRCheckLogContains(t, clarifiedBody, "## [uloop-project-runner: 3.0.0-beta.45](https://example.test/compare/uloop-project-runner-v3.0.0-beta.44...uloop-project-runner-v3.0.0-beta.45) (2026-07-01)") assertReleasePRCheckLogContains(t, clarifiedBody, "
uloop-dispatcher: 3.0.1-beta.13") assertReleasePRCheckLogContains(t, clarifiedBody, "
unity-package: 3.0.0-beta.48") assertReleasePRCheckLogContains(t, clarifiedBody, "
uloop-project-runner: 3.0.0-beta.45") @@ -87,7 +87,7 @@ func TestReleasePRCheckComponentHeadingsAreClarified(t *testing.T) { // Verifies an already clarified dispatcher block stays unchanged on a second clarification pass. func TestReleasePRCheckClarifiedDispatcherBlockIsStable(t *testing.T) { body := "
uloop-dispatcher: 3.0.1-beta.13\n\n" + - "## [uloop Dispatcher 3.0.1-beta.13](https://example.test/compare/dispatcher-v3.0.1-beta.12...dispatcher-v3.0.1-beta.13) (2026-07-11)\n" + + "## [uloop-dispatcher: 3.0.1-beta.13](https://example.test/compare/dispatcher-v3.0.1-beta.12...dispatcher-v3.0.1-beta.13) (2026-07-11)\n" + "
\n" clarifiedBody, changed := clarifyReleasePRCheckComponentLabels(body)