From f068d5eb7f6fcf41b4fcc2672f581c3e53c26436 Mon Sep 17 00:00:00 2001 From: xdustinface Date: Sun, 1 Nov 2026 16:25:24 +1000 Subject: [PATCH 1/3] ci: stop feature PRs from editing the changelog Every feature PR appending to the shared `## Unreleased` section conflicts with every other open PR. The changelog is generated from merged PR titles at release time, so feature PRs no longer edit it. - `AGENTS.md` and `CLAUDE.md` drop the "update CHANGELOG" instruction and say not to edit it - new `changelog-guard.yml` fails any PR touching a `CHANGELOG.md` unless it carries the `release` label --- .github/workflows/changelog-guard.yml | 20 ++++++++++++++++++++ AGENTS.md | 3 ++- CLAUDE.md | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/changelog-guard.yml diff --git a/.github/workflows/changelog-guard.yml b/.github/workflows/changelog-guard.yml new file mode 100644 index 000000000..350e5b928 --- /dev/null +++ b/.github/workflows/changelog-guard.yml @@ -0,0 +1,20 @@ +name: Changelog Guard + +on: + pull_request: + types: [opened, synchronize, reopened, labeled, unlabeled] + paths: + - '**/CHANGELOG.md' + +permissions: {} + +jobs: + changelog-guard: + # Every feature PR appending to the same changelog section conflicts with every other open PR. + if: ${{ !contains(github.event.pull_request.labels.*.name, 'release') }} + runs-on: ${{ vars.DASH_LIGHT_RUNNER || 'ubuntu-latest' }} + steps: + - name: Reject changelog edits outside release PRs + run: | + echo "::error file=CHANGELOG.md::CHANGELOG.md is written when a release is cut. Revert the changelog edit, or add the 'release' label if this is a release PR." + exit 1 diff --git a/AGENTS.md b/AGENTS.md index c7f4a96df..1a2cf7d3d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,7 +27,8 @@ ## Commit & Pull Request Guidelines - Prefer Conventional Commits: `feat:`, `fix:`, `refactor:`, `chore:`, `docs:`. Keep subject ≤72 chars with clear scope and rationale. - Target branches: feature work to `dev` (development), hotfixes/docs to `main` unless directed otherwise. -- Pre‑PR checks: `cargo fmt`, `cargo clippy`, `cargo test` (workspace). Update docs/CHANGELOG if user-facing. +- Pre‑PR checks: `cargo fmt`, `cargo clippy`, `cargo test` (workspace). Update docs if user-facing. +- Do not edit `CHANGELOG.md` in feature PRs. It is written from the merged PR titles when a release is cut, and CI fails a PR that touches it unless a maintainer adds the `release` label. - Include in PRs: description, linked issues, test evidence (commands/output), and notes on features/FFI impacts. ## Security & Configuration Tips diff --git a/CLAUDE.md b/CLAUDE.md index 274cc1301..39d579313 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -182,6 +182,7 @@ cargo doc --open - Default branch: `dev` (active development, target for new PRs) - Stable branch: `main` (tracks latest tagged release) - Release branches: `chore/release-vX.Y.Z` (short-lived, cut from `dev` per release) +- `CHANGELOG.md` is written when a release is cut. Do not edit it in feature PRs. CI fails a PR that touches it unless it carries the `release` label. ## Current Status From df1cac8fc5eaaa4157843c3b8e8a314fa4a77bf7 Mon Sep 17 00:00:00 2001 From: xdustinface Date: Sun, 1 Nov 2026 17:11:53 +1000 Subject: [PATCH 2/3] ci: watch `Changelog Guard` in the ready-for-review gate Addresses CodeRabbit review comment on PR #1268 https://github.com/dashpay/rust-dashcore/pull/1268#discussion_r4434725566 --- .github/workflows/ready-for-review.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ready-for-review.yml b/.github/workflows/ready-for-review.yml index 65dcf926e..18a5ef380 100644 --- a/.github/workflows/ready-for-review.yml +++ b/.github/workflows/ready-for-review.yml @@ -12,6 +12,7 @@ on: - "Pre-commit Checks" - "Sanitizer" - "Ready for Review Trigger" + - "Changelog Guard" types: [completed] concurrency: From a7574f7bf0e42134ef4d5212de6e5eef7ac0bea2 Mon Sep 17 00:00:00 2001 From: xdustinface Date: Sun, 1 Nov 2026 17:11:54 +1000 Subject: [PATCH 3/3] ci: rerun the changelog guard when a PR is edited Addresses CodeRabbit review comment on PR #1268 https://github.com/dashpay/rust-dashcore/pull/1268#discussion_r4434725568 --- .github/workflows/changelog-guard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog-guard.yml b/.github/workflows/changelog-guard.yml index 350e5b928..754f15026 100644 --- a/.github/workflows/changelog-guard.yml +++ b/.github/workflows/changelog-guard.yml @@ -2,7 +2,7 @@ name: Changelog Guard on: pull_request: - types: [opened, synchronize, reopened, labeled, unlabeled] + types: [opened, edited, synchronize, reopened, labeled, unlabeled] paths: - '**/CHANGELOG.md'