fix(changelog): break infinite regenerate self-trigger loop - #988
Merged
Merged
Conversation
Surfaced by maa-framework#219: the changelog-reusable workflow was opening an unending chain of PRs (#199, #202–#219, ...) because each squash-merge of a changelog PR added a new conventional commit (`chore(changelog): regenerate from conventional commits (#NNN)`) which git-cliff picked up under Chores, producing a fresh diff and opening the next PR. Two complementary guards added: 1. templates/cliff.toml — add a skip = true commit_parser for the bot's own `chore(changelog): regenerate ...` subjects, placed BEFORE the generic ^chore matcher (commit_parsers is first-match-wins). This is the primary fix because it survives GitHub's squash-merge (which uses the PR title as the new subject on main). 2. changelog-reusable.yml — add a `guard` job that short-circuits when the triggering HEAD commit already carries a [skip changelog] marker, and tag every commit/PR body the workflow produces with that marker. In pr-back mode, also close older open bot/changelog-* PRs against the same base to prevent duplicate-PR spam when pushes land between merges. Verified end-to-end against maa-framework's current HEAD: after applying the cliff.toml skip rule, re-running git-cliff produces zero diff even after a simulated squash-merge of the cleanup PR.
Contributor
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| name: Check for self-trigger loop | ||
| runs-on: ${{ inputs.runs-on }} | ||
| outputs: | ||
| skip: ${{ steps.loopguard.outputs.skip }} |
hyperpolymath
added a commit
to hyperpolymath/maa-framework
that referenced
this pull request
Sep 22, 2026
#222) One-line CHANGELOG update: adds the missing bullet for the loop-fix PR (#221) itself. ## Why this PR exists When #221 merged, its commit body contained the `[skip changelog]` marker (added by the job-level `if:` guard that broke the infinite loop), so the workflow run after merge correctly skipped itself rather than opening a regeneration PR. That was the right call for loop-prevention, but it means the fix commit itself was never recorded in the changelog. This PR adds that one bullet. ## Why this is the LAST changelog PR Merging this PR will NOT open another changelog PR, because: 1. The PR title matches the subject-matcher skip rule in the local `cliff.toml` override (`^chore\\(changelog\\):\\s*regenerate from conventional commits`), so git-cliff will skip this commit when computing the next CHANGELOG. 2. The commit body (and this PR body) carry `[skip changelog]`, which triggers both the caller's job-level `if:` guard and the body-matcher skip rule in cliff.toml. The canonical fix in [standards#988](hyperpolymath/standards#988) applies the same skip rules to all estate repos. Once that merges, the local `cliff.toml` in this repo should be deleted in a follow-up. [skip changelog] Co-authored-by: hyperpolymath-bot <github-actions[bot]@users.noreply.github.com>
hyperpolymath
added a commit
to hyperpolymath/maa-framework
that referenced
this pull request
Sep 22, 2026
…rged (#223) ## Summary Follow-up to #221 / standards#988. The local `cliff.toml` was added as an emergency hotfix for the infinite changelog loop. The canonical fix has now landed in [hyperpolymath/standards#988](hyperpolymath/standards#988): the canonical `templates/cliff.toml` at `standards@main` contains the same `chore(changelog): regenerate …` subject-matcher skip rule. ## Verification - `git-cliff --config <canonical cliff.toml>` against current `main` produces byte-identical `CHANGELOG.md` — no changelog drift, no CHANGELOG.md update needed in this PR. - Returns the repo to the documented convention stated in `changelog.yml`: "no local cliff.toml by design — one config for the estate". - The reusable workflow checks out cliff.toml from `standards@main` at runtime (not from the SHA-pinned reusable), so future canonical updates continue to propagate immediately to this repo. [skip changelog] Co-authored-by: hyperpolymath-bot <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Fixes the infinite-changelog-PR loop surfaced by maa-framework#219: merging one changelog PR added a new
chore(changelog): regenerate from conventional commits (#NNN)commit that git-cliff picked up under Chores, producing a fresh diff and opening the next PR. maa-framework accumulated 21 such commits in its last 50 before being detected.What changed
Two complementary guards:
templates/cliff.toml— primary fix. Add askip = trueparser for the bot's ownchore(changelog): regenerate from conventional commitssubjects, placed before the generic^chorematcher (commit_parsersis first-match-wins). The regex matches both the branch commit subject and the default GitHub squash-merge subject (... (#NNN)), which is essential because inpr-backmode the squash-merge subject — not the branch commit body — is what lands onmain..github/workflows/changelog-reusable.yml— defense-in-depth:guardjob short-circuits the entiregeneratejob when the triggering HEAD commit message already contains[skip changelog].[skip changelog]marker, so the guard fires on commit-back's direct push and (if the PR description is preserved) on squash-merge of pr-back PRs.pr-backmode, older openbot/changelog-*PRs against the same base are closed when a newer regeneration is pushed, preventing PR-spam when pushes land faster than merges.Verification
Verified locally against current maa-framework
main:Regenerate from conventional commitsbullets.Rollout
This fix is backward-compatible: because
changelog-reusable.ymlchecks out cliff.toml fromstandards@mainat runtime (not from the pinned SHA), merging this PR will immediately fix the loop for every caller (commit-back and pr-back) on their next run, with no caller-side SHA bump required.Maa-framework PR #219 and any other currently-open
bot/changelog-*PRs should be closed before this merges (they were opened by the buggy config and will produce spam if merged). After merge, the next push to any affected caller'smain(or a manual workflow re-run) will produce one final cleanup PR with the spammy bullets stripped; merging that cleanup PR produces no further PRs.