Skip to content

Commit 72f6856

Browse files
committed
fix(changelog): preserve explicitly marked breaking changes
1 parent d567246 commit 72f6856

3 files changed

Lines changed: 56 additions & 11 deletions

File tree

‎.agents/skills/openclaw-changelog-update/SKILL.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,12 @@ every human `Thanks @...` attribution.
167167
prose but are never rendered as a public `#### Direct commits` dump. Add
168168
direct-commit credit to a grouped bullet only when it shares an explicit
169169
closing issue reference or at least two distinctive subject terms
170-
- the verifier rejects `docs`, `test`, `refactor`, `ci`, `build`, `chore`,
171-
and `style` PRs in Highlights, Changes, or Fixes. Keep those internal
172-
contributions in the complete PR record, but do not give them editorial
173-
release-note space
170+
- the verifier rejects ordinary `docs`, `test`, `refactor`, `ci`, `build`,
171+
`chore`, and `style` PRs in Highlights, Changes, or Fixes. An explicit
172+
Conventional Commits `!` marker makes any type editorial-eligible; include
173+
its verified user-facing breaking change and migration guidance with the
174+
original PR ref and credit. Keep other internal contributions only in the
175+
complete PR record
174176
- classify internal-only work from conventional prefixes and clear title
175177
signals such as `QA`, `test`, `docs`, `refactor`, `lint`, or `CI`; an
176178
untyped title is not automatically editorial

‎.agents/skills/openclaw-changelog-update/scripts/verify-release-notes.mjs‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,7 @@ function gitCommit(ref, required = false) {
269269

270270
function fetchGithubApi(args) {
271271
try {
272-
return JSON.parse(
273-
run("ghx", ["api", ...args], { env: { GHX_NO_CACHE: "1" } }).replace(ansiEscapePattern, ""),
274-
);
272+
return JSON.parse(run("gh", ["api", ...args]).replace(ansiEscapePattern, ""));
275273
} catch (error) {
276274
if (typeof error.stdout === "string" && error.stdout.trim() !== "") {
277275
return JSON.parse(error.stdout.replace(ansiEscapePattern, ""));
@@ -436,12 +434,16 @@ function githubHandleFromNoreply(email) {
436434
}
437435

438436
function editorialClassification(subject) {
439-
const type = subject.match(/^\s*([a-z]+)(?:\([^)]*\))?!?:/i)?.[1]?.toLowerCase();
437+
const conventional = subject.match(/^\s*([a-z]+)(?:\([^)]*\))?(!)?:/i);
438+
const type = conventional?.[1]?.toLowerCase();
440439
return {
440+
// A declared breaking API change needs migration notes even when its
441+
// conventional type describes a refactor or other internal work.
441442
editorialEligible:
442-
(Boolean(type) || editorialTitlePattern.test(subject)) &&
443-
!nonEditorialTypes.has(type) &&
444-
!nonEditorialTitlePattern.test(subject),
443+
Boolean(conventional?.[2]) ||
444+
((Boolean(type) || editorialTitlePattern.test(subject)) &&
445+
!nonEditorialTypes.has(type) &&
446+
!nonEditorialTitlePattern.test(subject)),
445447
type: type ?? "other",
446448
};
447449
}

‎test/scripts/release-notes-ledger.test.ts‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,47 @@ function contributionLedger({
5353
}
5454

5555
describe("renderContributionRecordEntry", () => {
56+
it.each([
57+
["refactor(plugins)!: remove a bundled workflow plugin", "refactor", true],
58+
["refactor!: remove the legacy setup command", "refactor", true],
59+
["REFACTOR(cli)!: rename the setup command", "refactor", true],
60+
["build!: require a supported runtime", "build", true],
61+
["refactor(plugins): simplify loader internals", "refactor", false],
62+
["test: cover breaking plugin changes!", "test", false],
63+
["fix: preserve message delivery", "fix", true],
64+
])("classifies declared breaking changes for release prose: %s", (title, type, eligible) => {
65+
const nodes = new Map([
66+
[
67+
123,
68+
{
69+
__typename: "PullRequest",
70+
author: { __typename: "User", login: "alice" },
71+
closingIssuesReferences: { nodes: [] },
72+
mergedAt: "2026-08-04T00:00:00Z",
73+
title,
74+
},
75+
],
76+
]);
77+
const result = contributionLedger({ nodes, sourcePullRequests: [123] });
78+
expect(result.pullRequests).toMatchObject([
79+
{ number: 123, type, editorialEligible: eligible, thanks: ["alice"] },
80+
]);
81+
const source = [
82+
"## 2026.8.1",
83+
"### Highlights",
84+
...[1, 2, 3, 4, 5].map((value) => `- Highlight ${value}.`),
85+
"### Changes",
86+
"- Explain the user impact. (#123) Thanks @alice.",
87+
"### Fixes",
88+
result.ledger,
89+
].join("\n");
90+
expect(ledgerChecks({ source }, result.pullRequests, nodes, [])).toEqual(
91+
eligible
92+
? []
93+
: [`editorial release prose references non-editorial ${type} PR #123 (${type})`],
94+
);
95+
});
96+
5697
it("keeps external and linked issue references without repeating PR title references", () => {
5798
expect(
5899
renderContributionRecordEntry({

0 commit comments

Comments
 (0)