Files
copilotkit__copilotkit/scripts/release/__tests__/release-notes-committable.test.ts
T
Benjamin Taylor 476b48a7d6 fix(release): commit release-notes.md to the release branch, drop the Notion round-trip
release-notes.md and release-notes-notion.json were both gitignored, so
create-pull-request silently skipped them. The notes never reached the release
branch, the publish job's readFileSync missed, and every release since this
lane was built shipped its "Release <tag>" fallback body — v1.70.0,
channels/v0.6.0 and angular/v0.4.0 all have bodyless GitHub Releases.

The same ignore rule severed the Notion lane: without the json ref in the
checkout, publish-release could never read an edited draft back, so that path
had never run either. Remove it rather than repair it — the release PR is
already the review surface, and editing release-notes.md on the branch is a
plainer gate than a Notion page.

Guard the ignore rule with a test, since re-adding it would break the lane
again without breaking anything else.
2026-09-09 08:30:59 -05:00

43 lines
1.7 KiB
TypeScript

import { spawnSync } from "child_process";
import path from "path";
import { describe, expect, it } from "vitest";
import { ROOT } from "../lib/config.js";
/**
* `release-notes.md` is how the generated notes travel from the create-pr
* workflow to the publish job: prepare-release writes it, create-pull-request
* commits it onto the release branch, and publish-release reads it back as the
* GitHub Release body.
*
* It was gitignored, so create-pull-request silently skipped it and every
* release since the lane was built shipped the `Release <tag>` fallback body
* instead of notes. An ignore rule is the one way to break this without
* breaking any other test, hence this guard.
*/
describe("release-notes.md reaches the publish job", () => {
it("is not gitignored", () => {
const result = spawnSync("git", ["check-ignore", "release-notes.md"], {
cwd: ROOT,
encoding: "utf8",
});
// git check-ignore exits 0 when the path IS ignored, 1 when it is not.
expect(
result.status,
`release-notes.md is gitignored (matched by: ${result.stdout.trim()}), so it ` +
`cannot be committed to the release PR branch and the publish job will ` +
`fall back to a bodyless "Release <tag>" GitHub Release.`,
).not.toBe(0);
});
it("is the path both halves of the lane agree on", () => {
const prepare = path.join(ROOT, "scripts/release/prepare-release.ts");
const publish = path.join(ROOT, ".github/workflows/publish-release.yml");
const read = (p: string) =>
spawnSync("cat", [p], { encoding: "utf8" }).stdout;
expect(read(prepare)).toContain('"release-notes.md"');
expect(read(publish)).toContain('"./release-notes.md"');
});
});