Skip to content

[Backport to release 1.3] fix(ci): generate changelog from release tag, not from main - #2574

Merged
myasnikovdaniil merged 4 commits into
release-1.3from
backport-2530-to-release-1.3
May 6, 2026
Merged

myasnikovdaniil merged 4 commits into
release-1.3from
backport-2530-to-release-1.3

Conversation

@myasnikovdaniil

Copy link
Copy Markdown
Contributor

Backport #2530 to release-1.3

The generate-changelog job in .github/workflows/tags.yaml previously
checked out main and ran the AI agent there. The agent followed
docs/agents/changelog.md, which instructed it to compute the release
range with `git log <previous_version>..HEAD`. For minor releases
(vX.Y.0) cut from main this happens to give the right answer; for
patch releases (vX.Y.Z, Z>0) cut from a release-X.Y branch, HEAD-on-
main is a strict superset of the release tag and contains commits
that were merged to main both before and after the tag.

The v1.3.1 changelog generated by this workflow (#2480) demonstrated
the failure mode: it included 8 PRs merged to main but never shipped
in v1.3.1, 6 backport PRs that landed on release-1.3 *after* v1.3.1
was tagged, both originals and their backports as separate entries,
a hallucinated 2024 PR, and the cozystack-ci bot in the contributors
list. The corrected v1.3.1 changelog contains the single fix that
v1.3.1 actually ships.

This PR fixes the root cause and tightens the agent guardrails:

* tags.yaml: check out the release tag commit (`ref: ${{ steps.tag.
  outputs.tag }}`) instead of `main`, so HEAD == the release commit
  and `git log v<prev>..HEAD` corresponds to the actual release. The
  Create-changelog-branch step still creates the PR branch from
  origin/main, so PRs continue to merge cleanly into main.
* tags.yaml: update the AI prompt to state explicitly that HEAD is
  the release commit and that the upper bound for the release range
  is the new tag, not main.
* docs/agents/changelog.md: replace `..HEAD` with `..v<new_version>`
  in every example so the instruction is unambiguous regardless of
  which branch is checked out.
* docs/agents/changelog.md: add a hard rule that backport PRs MUST
  be merged into the original entry (single line, two PR numbers),
  never listed as a second entry. Document the edge case where the
  original PR is outside the range — drop the entry.
* docs/agents/changelog.md: forbid using the brief description
  verbatim as the detailed description, and forbid inventing entries
  for PRs that are not in the release range.
* docs/agents/changelog.md: filter bot/CI accounts (`app/*`,
  `*[bot]`, cozystack-ci, github-actions, dependabot, renovate) out
  of the human Contributors list. Bot attribution on individual
  entries is still valid.

The corresponding correction for the v1.3.1 changelog itself is in
PR #2480 on the changelog-v1.3.1 branch.

Signed-off-by: Myasnikov Daniil <[email protected]>
(cherry picked from commit 2420d89)
- Drop the "orphan backport, drop entry" rule: a backport whose original is on
  main but hasn't shipped in a stable tag is the first delivery and must stay
  in the changelog.
- Add `v` prefix to `<previous_version>`/`<new_version>` placeholders in all
  four `git log` invocations for consistency with the rest of the doc.
- Apply the bot/CI account filter to the new-contributors detection (and the
  standalone previous-contributors extraction) so bot accounts can no longer
  leak into the human Contributors list.

Assisted-By: Claude <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>
(cherry picked from commit 0f9198d)
- tags.yaml: drop "(or HEAD)" from the changelog prompt; the doc says
  "never HEAD" and the workflow now matches.
- docs/agents/changelog.md: exclude the current release file from the
  "previous contributors" set used for first-time-contributor detection.
  The previous globbing on `docs/changelogs/v*.md` swept up the file
  being generated, so `comm -23` would never report any newcomers.

Assisted-By: Claude <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>
(cherry picked from commit ce63bfc)
… gate

- tags.yaml: the check_changelog step now looks at origin/main rather than
  the working tree. After Round 2 we check out the release tag, which never
  has the changelog file (the PR opened by this job merges to main after
  the tag is cut), so the previous `[ -f ]` test always returned false and
  the gate was effectively dead on reruns.
- changelog.md: Step 6's `RELEASE_END=$(git log -1 --format=%ai HEAD)`
  (lines 179, 222) was missed in the previous "never HEAD" sweep — now
  uses v<new_version>, matching Step 5.
- changelog.md: Step 2 ("on main branch") was incompatible with the CI flow
  which now runs detached at the release tag. Relaxed it to list both
  configurations (interactive on main; CI detached at v<version>), while
  the "Scope and boundaries" section continues to forbid the agent from
  switching branches.

Assisted-By: Claude <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>
(cherry picked from commit 39605f2)
@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 36ace36f-52a1-47d0-9c21-998e64dec9d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backport-2530-to-release-1.3

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the internal documentation for generating release changelogs. The changes focus on improving the accuracy and quality of the generated output by enforcing better git practices, clarifying how to handle backports, and automating the exclusion of non-human contributors from the release notes.

Highlights

  • Changelog Generation Logic: Updated documentation to enforce using release tags instead of HEAD when generating changelogs, preventing accidental inclusion of commits from main.
  • Backport Handling: Mandated that original PRs and their backports must be combined into a single changelog entry to avoid duplicates.
  • Contributor Filtering: Added strict filtering to exclude bot and CI accounts from the human contributors list.
  • Entry Quality Standards: Added requirements to ensure brief and detailed descriptions are distinct and that all entries are verified against the actual git log range.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/tags.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions github-actions Bot added area/ci Issues or PRs related to CI workflows, GitHub Actions, automation area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files labels May 6, 2026
@dosubot dosubot Bot added the kind/backport-previous Categorizes issue or PR as requiring a backport to the previous release line label May 6, 2026
@myasnikovdaniil
myasnikovdaniil merged commit 6ca7d98 into release-1.3 May 6, 2026
10 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the backport-2530-to-release-1.3 branch May 6, 2026 05:30
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Backport failed for release-1.3, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-1.3
git worktree add -d .worktree/backport-2574-to-release-1.3 origin/release-1.3
cd .worktree/backport-2574-to-release-1.3
git switch --create backport-2574-to-release-1.3
git cherry-pick -x 7a9b451a71b2435c70608fa28eee84cd0207bd82 dbf61680836995df19b0f2e1223c60188d4317c3 e50affa58db8742c52b7a6d8eff4783dfb6bba1d 5d1300c03725a102fea83a8eb172788c3e6e49b0

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Git push to origin failed for release-1.2 with exitcode 1

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the changelog generation documentation to improve accuracy and reduce manual errors. Key changes include enforcing the use of git tags instead of HEAD for commit ranges, requiring the consolidation of backport PRs into single entries to prevent duplicates, and adding automated filtering for bot/CI accounts in the contributors list. Feedback was provided regarding the regex used for bot filtering, suggesting it be broadened to catch account variations like renovate-bot.

Comment thread docs/agents/changelog.md
# This method is simpler and more reliable than extracting from git history.
grep -oE '\[\*\*@[a-zA-Z0-9_/-]+\*\*\]' docs/changelogs/v<version>.md | \
sed -E 's|\[\*\*@||; s|\*\*\]||' | \
grep -viE '^(app/|.*\[bot\]$|cozystack-ci$|github-actions$|dependabot$|renovate$)' | \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The regex renovate$ only matches the exact string renovate. If there are other bot accounts like renovate-bot or dependabot-preview, they will not be filtered out by this regex. Consider using renovate.* to catch all variations if that is the intended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Issues or PRs related to CI workflows, GitHub Actions, automation area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/backport-previous Categorizes issue or PR as requiring a backport to the previous release line kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant