From 04a1ed5e5346ecde81545d6edd07aeb0878010db Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Thu, 12 Feb 2026 18:07:57 -0500 Subject: [PATCH] chore: make changelog mandatory in PR skills --- .agents/skills/PR_WORKFLOW.md | 6 +++--- .agents/skills/prepare-pr/SKILL.md | 2 +- .agents/skills/review-pr/SKILL.md | 2 +- CHANGELOG.md | 1 + scripts/pr | 21 +++++++++------------ 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.agents/skills/PR_WORKFLOW.md b/.agents/skills/PR_WORKFLOW.md index b4de1c49ec..402dc42f1c 100644 --- a/.agents/skills/PR_WORKFLOW.md +++ b/.agents/skills/PR_WORKFLOW.md @@ -110,9 +110,9 @@ Before any substantive review or prep work, **always rebase the PR branch onto c - During `prepare-pr`, use this commit subject format: `fix: (openclaw#) thanks @`. - Group related changes; avoid bundling unrelated refactors. - Changelog workflow: keep the latest released version at the top (no `Unreleased`); after publishing, bump the version and start a new top section. -- When working on a PR: add a changelog entry with the PR number and thank the contributor. +- When working on a PR: add a changelog entry with the PR number and thank the contributor (mandatory in this workflow). - When working on an issue: reference the issue in the changelog entry. -- Pure test additions/fixes generally do **not** need a changelog entry unless they alter user-facing behavior or the user asks for one. +- In this workflow, changelog is always required even for internal/test-only changes. ## Gate policy @@ -233,7 +233,7 @@ Go or no-go checklist before merge: - All BLOCKER and IMPORTANT findings are resolved. - Verification is meaningful and regression risk is acceptably low. -- Docs and changelog are updated when required. +- Changelog is updated (mandatory) and docs are updated when required. - Required CI checks are green and the branch is not behind `main`. Expected output: diff --git a/.agents/skills/prepare-pr/SKILL.md b/.agents/skills/prepare-pr/SKILL.md index e219141eb7..95252ef061 100644 --- a/.agents/skills/prepare-pr/SKILL.md +++ b/.agents/skills/prepare-pr/SKILL.md @@ -67,7 +67,7 @@ jq -r '.findings[] | select(.severity=="BLOCKER" or .severity=="IMPORTANT") | "- Fix all required findings. Keep scope tight. -3. Update changelog/docs when required +3. Update changelog/docs (changelog is mandatory in this workflow) ```sh jq -r '.changelog' .local/review.json diff --git a/.agents/skills/review-pr/SKILL.md b/.agents/skills/review-pr/SKILL.md index 7327b34333..ab9d75d967 100644 --- a/.agents/skills/review-pr/SKILL.md +++ b/.agents/skills/review-pr/SKILL.md @@ -123,7 +123,7 @@ Minimum JSON shape: "result": "pass" }, "docs": "up_to_date|missing|not_applicable", - "changelog": "required|not_required" + "changelog": "required" } ``` diff --git a/CHANGELOG.md b/CHANGELOG.md index e2c65fbac1..6394f9c69e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ Docs: https://docs.openclaw.ai - Agents: prevent file descriptor leaks in child process cleanup. (#13565) Thanks @KyleChen26. - Agents: prevent double compaction caused by cache TTL bypassing guard. (#13514) Thanks @taw0002. - Agents: use last API call's cache tokens for context display instead of accumulated sum. (#13805) Thanks @akari-musubi. +- Agents: keep followup-runner session `totalTokens` aligned with post-compaction context by using last-call usage and shared token-accounting logic. (#14979) Thanks @shtse8. - Discord: allow channel-edit to archive/lock threads and set auto-archive duration. (#5542) Thanks @stumct. - Discord tests: use a partial @buape/carbon mock in slash command coverage. (#13262) Thanks @arosstale. - Tests: update thread ID handling in Slack message collection tests. (#14108) Thanks @swizzmagik. diff --git a/scripts/pr b/scripts/pr index 83ebe0ac75..1ceb0bce0a 100755 --- a/scripts/pr +++ b/scripts/pr @@ -344,7 +344,7 @@ EOF_MD "result": "pass" }, "docs": "not_applicable", - "changelog": "not_required" + "changelog": "required" } EOF_JSON fi @@ -411,23 +411,14 @@ review_validate_artifacts() { local changelog_status changelog_status=$(jq -r '.changelog // ""' .local/review.json) case "$changelog_status" in - "required"|"not_required") + "required") ;; *) - echo "Invalid changelog status in .local/review.json: $changelog_status" + echo "Invalid changelog status in .local/review.json: $changelog_status (must be \"required\")" exit 1 ;; esac - if [ "$changelog_status" = "required" ]; then - local changelog_finding_count - changelog_finding_count=$(jq '[.findings[]? | select(((.area // "" | ascii_downcase | contains("changelog")) or (.title // "" | ascii_downcase | contains("changelog")) or (.fix // "" | ascii_downcase | contains("changelog"))))] | length' .local/review.json) - if [ "$changelog_finding_count" -eq 0 ]; then - echo "changelog is required but no changelog-related finding exists in .local/review.json" - exit 1 - fi - fi - echo "review artifacts validated" } @@ -630,6 +621,12 @@ prepare_gates() { docs_only=true fi + # Enforce workflow policy: every prepared PR must include a changelog update. + if ! printf '%s\n' "$changed_files" | rg -q '^CHANGELOG\.md$'; then + echo "Missing CHANGELOG.md update in PR diff. This workflow requires a changelog entry." + exit 1 + fi + run_quiet_logged "pnpm build" ".local/gates-build.log" pnpm build run_quiet_logged "pnpm check" ".local/gates-check.log" pnpm check