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
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ updates:
groups:
npm-minor-and-patch:
update-types: [minor, patch]
# react and react-dom serve only the e2e fixture test/fixtures/pages/react-list.html,
# which is a React 18 app on purpose (React 18's UMD builds load without a bundler;
# React 19 has none). React 19 coverage is a second fixture of its own (SCR-464), so
# these stay on 18.x and get its patches.
ignore:
- dependency-name: react
update-types: ["version-update:semver-major"]
- dependency-name: react-dom
update-types: ["version-update:semver-major"]
# The docs site (slice 44) has its own package.json and lockfile.
- package-ecosystem: npm
directory: /site
Expand Down
10 changes: 10 additions & 0 deletions scripts/release-notes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ export function checkChangelog(text, version) {
"(they're the plain-language notes learners read) in the release PR, then tag.",
);
}
// A pull request merged with a merge commit reaches release-please twice: as its commit,
// and as the merge commit, whose body is the PR's title. When the two read the same, the
// entry is listed twice (with different hashes); keep one in the release PR.
const seen = new Set();
for (const line of section.split("\n")) {
const entry = /^\* (.+?)(?: \(\[[0-9a-f]{7,40}\]\([^)]*\)\))?$/.exec(line.trim())?.[1];
if (!entry) continue;
if (seen.has(entry)) problems.push(`The ${version} section lists "${entry}" more than once. Keep one in the release PR.`);
seen.add(entry);
}
if (/^#{2,4} .*BREAKING CHANGES/m.test(section) && !/^#{2,4} Upgrade notes\b/im.test(section)) {
problems.push(
`The ${version} section has breaking changes but no "### Upgrade notes" (what changed, who is affected, the steps; slice 30 §11).`,
Expand Down
12 changes: 12 additions & 0 deletions test/unit/release-notes.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ test("tagging is refused without a section, with leftovers under Unreleased, or
assert.match(checkChangelog(RELEASED, "v0.3.0")[0], /isn't a release version/);
});

test("tagging is refused while an entry is listed twice (a PR's commit and its merge commit)", () => {
const twice = RELEASED.replace(
"* **extension:** bulk add ([ff493a9](https://github.com/ScriptKittyOS/kotiko/commit/ff493a9))",
"* **extension:** bulk add ([ff493a9](https://github.com/ScriptKittyOS/kotiko/commit/ff493a9))\n" +
"* **extension:** bulk add ([1234abc](https://github.com/ScriptKittyOS/kotiko/commit/1234abc))",
);
const problems = checkChangelog(twice, "0.3.0");
assert.equal(problems.length, 1);
assert.match(problems[0], /lists "\*\*extension:\*\* bulk add" more than once/);
assert.deepEqual(checkChangelog(RELEASED, "0.3.0"), [], "one of each passes");
});

test("release candidates are tagged before their CHANGELOG section exists", () => {
assert.deepEqual(checkChangelog("# Changelog\n\n## Unreleased\n\n- wip\n", "0.3.0-rc.1"), []);
});
Expand Down