Fix stable release promotion order

This commit is contained in:
vorotamoroz
2026-07-31 08:55:26 +00:00
parent 7d33613017
commit 54f0262b3f
4 changed files with 32 additions and 22 deletions
+5 -6
View File
@@ -52,15 +52,14 @@ export function renderReleasePrBody(version, baseBranch) {
: "Confirm the draft GitHub Release assets; keep stable CLI publication deferred until BRAT validation passes";
const holdInstruction = isPrerelease
? `Publishing and validating this pre-release does not unblock this pull request. Keep it in draft and unmerged, and leave ${baseBranchCode} unchanged.`
: `Publishing the GitHub pre-release does not unblock this pull request. Keep it in draft, and leave ${baseBranchCode} unchanged, until the exact published build has passed BRAT validation. Promotion remains on hold until the exact release commit has been integrated into the repository's default branch.`;
: `Publishing the GitHub pre-release does not unblock this pull request. Keep it in draft, and leave ${baseBranchCode} unchanged, until the exact published build has passed BRAT validation. Before the exact release commit reaches the repository's default branch, remove the pre-release designation and make this exact release the latest stable release so Community Directory review does not inspect a manifest version whose GitHub Release remains a pre-release.`;
const completionInstructions = isPrerelease
? [
"- [ ] Keep this pre-release pull request unmerged; close it only through a separate maintainer action",
]
? ["- [ ] Keep this pre-release pull request unmerged; close it only through a separate maintainer action"]
: [
`- [ ] After BRAT validation passes, mark this pull request ready and merge it into ${baseBranchCode} with a merge commit`,
"- [ ] After BRAT validation passes, remove the pre-release designation and make this exact release the latest stable release",
`- [ ] Confirm this exact release is no longer a pre-release, then mark this pull request ready and merge it into ${baseBranchCode} with a merge commit`,
"- [ ] Integrate the exact release commit through the reviewed branch chain into the repository's default branch",
"- [ ] Confirm the default branch contains the exact release metadata, then remove the pre-release designation and make this exact release the latest stable release",
"- [ ] Confirm the default branch contains the exact release commit and metadata",
"- [ ] Create the stable CLI tag and publish its `latest` and major-minor image tags, if selected, through a separate maintainer gate",
];
+21 -11
View File
@@ -198,7 +198,7 @@ describe("release workflow", () => {
expect(prerelease).not.toContain("Mark this pull request ready and merge it");
});
it("publishes a stable version initially as a GitHub pre-release for BRAT validation", () => {
it("promotes a validated stable release before its manifest reaches the default branch", () => {
const stable = renderReleasePrBody("1.0.0", "main");
expect(stable).toContain("prerelease=true");
@@ -207,26 +207,33 @@ describe("release workflow", () => {
"Publish the GitHub Release initially as a pre-release without replacing the latest stable release"
);
expect(stable).toContain(
"After BRAT validation passes, mark this pull request ready and merge it into `main` with a merge commit"
"After BRAT validation passes, remove the pre-release designation and make this exact release the latest stable release"
);
expect(stable).toContain(
"Confirm this exact release is no longer a pre-release, then mark this pull request ready and merge it into `main` with a merge commit"
);
expect(stable).toContain(
"Integrate the exact release commit through the reviewed branch chain into the repository's default branch"
);
expect(stable).toContain(
"Confirm the default branch contains the exact release metadata, then remove the pre-release designation and make this exact release the latest stable release"
);
expect(stable).toContain("Confirm the default branch contains the exact release commit and metadata");
expect(stable).toContain(
"Create the stable CLI tag and publish its `latest` and major-minor image tags, if selected, through a separate maintainer gate"
);
expect(stable).toContain(
"Before the exact release commit reaches the repository's default branch, remove the pre-release designation"
);
expect(stable.indexOf("After BRAT validation passes")).toBeLessThan(
stable.indexOf("Confirm this exact release is no longer a pre-release")
);
expect(stable.indexOf("Confirm this exact release is no longer a pre-release")).toBeLessThan(
stable.indexOf("Integrate the exact release commit")
);
expect(stable.indexOf("Integrate the exact release commit")).toBeLessThan(
stable.indexOf("Confirm the default branch contains the exact release metadata")
);
expect(stable.indexOf("Confirm the default branch contains the exact release metadata")).toBeLessThan(
stable.indexOf("Create the stable CLI tag")
stable.indexOf("Confirm the default branch contains the exact release commit and metadata")
);
expect(
stable.indexOf("Confirm the default branch contains the exact release commit and metadata")
).toBeLessThan(stable.indexOf("Create the stable CLI tag"));
expect(stable).not.toContain("prerelease=false");
});
@@ -238,10 +245,13 @@ describe("release workflow", () => {
"Keep the release pull request in draft and unmerged after BRAT validation; close it only through a separate maintainer action."
);
expect(workflow).toContain(
"After BRAT validation, merge the release pull request into its reviewed base branch and integrate the exact release commit into the default branch."
"After BRAT validation, remove the pre-release designation and make this exact release the latest stable release before its manifest reaches the default branch."
);
expect(workflow).toContain(
"Only after the default branch contains the exact release metadata, remove the pre-release designation and make this exact release the latest stable release."
"Confirm the release is no longer a pre-release, then merge the release pull request into its reviewed base branch and integrate the exact release commit into the default branch."
);
expect(workflow).toContain(
"This order prevents Community Directory review from inspecting a stable manifest version while the matching GitHub Release remains a pre-release."
);
expect(workflow).toContain(
'if [[ "${VERSION}" != *-* && "${PRERELEASE}" == "true" && "${PUBLISH_CLI}" == "true" ]]; then'