Skip to content

Commit 1e6d0f5

Browse files
fix(clawsweeper): address review for automerge-openclaw-openclaw-81357 (2)
1 parent abadccf commit 1e6d0f5

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Docs: https://docs.openclaw.ai
244244
- Codex app-server: keep the short post-tool completion watchdog armed across dynamic tool completion bookkeeping so embedded Codex runs fail fast and release their session lane when Codex goes quiet after a tool result. (#81697) Thanks @mbelinky.
245245
- Models: restore authenticated CLI runtime providers in the `/models` picker while keeping legacy runtime aliases hidden from setup/default model choices. Closes #81212. (#81239) Thanks @anagnorisis2peripeteia.
246246
- Agents/cron: honor a cron payload's explicit `timeoutSeconds` for the LLM idle watchdog even when it numerically equals `agents.defaults.timeoutSeconds`, preserving explicit per-run timeout intent and preventing stalled streaming replies from being cut to the implicit 120s cap. (#79426) Thanks @legolaz8451.
247-
- Changelog gates: reject bot/app handles as `Thanks` attribution and require explicit human credit for ClawSweeper-authored changelog entries. (#81357) Thanks @hxy91819.
247+
- Changelog gates: reject bot/app handles as `Thanks` attribution and require explicit human credit for bot/app-authored changelog entries. (#81357) Thanks @hxy91819.
248248

249249
### Changes
250250

scripts/check-changelog-attributions.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ export const FORBIDDEN_CHANGELOG_THANKS_HANDLES = [
1414
"openclaw-clawsweeper[bot]",
1515
];
1616
export const FORBIDDEN_CHANGELOG_THANKS_HANDLE_PREFIXES = ["app/"];
17+
export const FORBIDDEN_CHANGELOG_THANKS_HANDLE_SUFFIXES = ["[bot]"];
1718
export const CHANGELOG_THANKS_REQUIRE_HUMAN_CREDIT_HANDLES = [
1819
"clawsweeper",
1920
"openclaw-clawsweeper",
2021
"clawsweeper[bot]",
2122
"openclaw-clawsweeper[bot]",
2223
];
2324
export const CHANGELOG_THANKS_REQUIRE_HUMAN_CREDIT_HANDLE_PREFIXES = ["app/"];
25+
export const CHANGELOG_THANKS_REQUIRE_HUMAN_CREDIT_HANDLE_SUFFIXES = ["[bot]"];
2426

2527
const THANKS_PATTERN = /\bThanks\b/iu;
2628
const THANKED_HANDLE_PATTERN = /@([-_/A-Za-z0-9]+(?:\[bot\])?)/giu;
@@ -34,7 +36,8 @@ export function isForbiddenChangelogThanksHandle(handle, options = {}) {
3436
}
3537
if (
3638
FORBIDDEN_CHANGELOG_THANKS_HANDLES.includes(normalized) ||
37-
FORBIDDEN_CHANGELOG_THANKS_HANDLE_PREFIXES.some((prefix) => normalized.startsWith(prefix))
39+
FORBIDDEN_CHANGELOG_THANKS_HANDLE_PREFIXES.some((prefix) => normalized.startsWith(prefix)) ||
40+
FORBIDDEN_CHANGELOG_THANKS_HANDLE_SUFFIXES.some((suffix) => normalized.endsWith(suffix))
3841
) {
3942
return true;
4043
}
@@ -54,6 +57,9 @@ export function requiresExplicitHumanChangelogThanks(handle) {
5457
CHANGELOG_THANKS_REQUIRE_HUMAN_CREDIT_HANDLES.includes(normalized) ||
5558
CHANGELOG_THANKS_REQUIRE_HUMAN_CREDIT_HANDLE_PREFIXES.some((prefix) =>
5659
normalized.startsWith(prefix),
60+
) ||
61+
CHANGELOG_THANKS_REQUIRE_HUMAN_CREDIT_HANDLE_SUFFIXES.some((suffix) =>
62+
normalized.endsWith(suffix),
5763
)
5864
);
5965
}

test/scripts/check-changelog-attributions.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ describe("check-changelog-attributions", () => {
6565
"- Maintainer-owned fix. Thanks @steipete.",
6666
"- Mixed credit. Thanks @contributor and @OpenClaw.",
6767
"- Bot repair. Thanks @clawsweeper[bot].",
68+
"- Dependency bump. Thanks @dependabot[bot].",
6869
"- App repair. Thanks @app/clawsweeper.",
6970
].join("\n");
7071

@@ -74,7 +75,8 @@ describe("check-changelog-attributions", () => {
7475
{ line: 3, handle: "steipete", text: "- Maintainer-owned fix. Thanks @steipete." },
7576
{ line: 4, handle: "openclaw", text: "- Mixed credit. Thanks @contributor and @OpenClaw." },
7677
{ line: 5, handle: "clawsweeper[bot]", text: "- Bot repair. Thanks @clawsweeper[bot]." },
77-
{ line: 6, handle: "app/clawsweeper", text: "- App repair. Thanks @app/clawsweeper." },
78+
{ line: 6, handle: "dependabot[bot]", text: "- Dependency bump. Thanks @dependabot[bot]." },
79+
{ line: 7, handle: "app/clawsweeper", text: "- App repair. Thanks @app/clawsweeper." },
7880
]);
7981
});
8082

@@ -110,6 +112,10 @@ describe("check-changelog-attributions", () => {
110112
expect(isForbiddenChangelogThanksHandle("clawsweeper[bot]")).toBe(true);
111113
expect(isForbiddenChangelogThanksHandle("openclaw-clawsweeper")).toBe(true);
112114
expect(isForbiddenChangelogThanksHandle("openclaw-clawsweeper[bot]")).toBe(true);
115+
expect(isForbiddenChangelogThanksHandle("dependabot[bot]")).toBe(true);
116+
expect(isForbiddenChangelogThanksHandle("dependabot[bot]", { strictBotHandle: true })).toBe(
117+
true,
118+
);
113119
expect(isForbiddenChangelogThanksHandle("alice")).toBe(false);
114120
expect(isForbiddenChangelogThanksHandle("human-clawsweeper-fan")).toBe(false);
115121
expect(
@@ -118,6 +124,7 @@ describe("check-changelog-attributions", () => {
118124

119125
expect(requiresExplicitHumanChangelogThanks("clawsweeper")).toBe(true);
120126
expect(requiresExplicitHumanChangelogThanks("clawsweeper[bot]")).toBe(true);
127+
expect(requiresExplicitHumanChangelogThanks("dependabot[bot]")).toBe(true);
121128
expect(requiresExplicitHumanChangelogThanks("app/clawsweeper")).toBe(true);
122129
expect(requiresExplicitHumanChangelogThanks("human-clawsweeper-fan")).toBe(false);
123130
expect(requiresExplicitHumanChangelogThanks("steipete")).toBe(false);
@@ -129,7 +136,7 @@ describe("check-changelog-attributions", () => {
129136
try {
130137
let output = "";
131138
try {
132-
validateChangelogEntry(repo, "clawsweeper[bot]");
139+
validateChangelogEntry(repo, "dependabot[bot]");
133140
} catch (error) {
134141
output = String((error as { stdout?: unknown }).stdout ?? error);
135142
}
@@ -142,7 +149,7 @@ describe("check-changelog-attributions", () => {
142149
it("accepts explicit human thanks for bot PR changelog entries", () => {
143150
const repo = createRepoWithPrChangelogDiff("- Bot repair (#123). Thanks @alice.");
144151
try {
145-
expect(validateChangelogEntry(repo, "clawsweeper[bot]")).toContain("explicit thanks");
152+
expect(validateChangelogEntry(repo, "dependabot[bot]")).toContain("explicit thanks");
146153
} finally {
147154
rmSync(repo, { recursive: true, force: true });
148155
}

0 commit comments

Comments
 (0)