Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions scripts/check-release-consistency.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ function requireText(text, expected, path, errors) {
if (!text.includes(expected)) errors.push(`${path} is missing ${JSON.stringify(expected)}`);
}

function requireAnyText(text, expectedValues, path, errors) {
if (!expectedValues.some((expected) => text.includes(expected))) {
errors.push(`${path} is missing one of ${expectedValues.map(JSON.stringify).join(", ")}`);
}
}

function extractWorkflowJob(source, jobName, errors) {
const lines = source.split(/\r?\n/u);
const header = ` ${jobName}:`;
Expand Down Expand Up @@ -1149,9 +1155,12 @@ export function collectReleaseConsistencyErrors(files, releaseTag) {
".github/workflows/release.yml",
errors,
);
requireText(
requireAnyText(
releaseWorkflow,
"body_path: .release-source/docs/CURRENT_RELEASE_NOTES.md",
[
"body_path: docs/CURRENT_RELEASE_NOTES.md",
"body_path: .release-source/docs/CURRENT_RELEASE_NOTES.md",
],
".github/workflows/release.yml",
errors,
);
Expand Down
11 changes: 11 additions & 0 deletions scripts/check-release-consistency.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,17 @@ test("historical repair keeps trusted publication control separate from release
assert.match(verifyStep.run, /^node scripts\/reconcile-release-assets\.mjs/u);
});

test("historical release content may retain its root-relative release notes path", () => {
const historical = changed(".github/workflows/release.yml", (workflow) =>
workflow.replace(
"body_path: .release-source/docs/CURRENT_RELEASE_NOTES.md",
"body_path: docs/CURRENT_RELEASE_NOTES.md",
),
);

assert.deepEqual(collectReleaseConsistencyErrors(historical), []);
});

test("rejects published app-wire version drift until release surfaces agree", () => {
const drifted = changedRuntime("publishedAppWire", (record) => {
record.version = "0.5.1";
Expand Down
Loading