Skip to content

Commit 0f9198d

Browse files
docs(agents): address changelog rule review feedback
- 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]>
1 parent 2420d89 commit 0f9198d

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

‎docs/agents/changelog.md‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Get the list of commits between the previous patch tag and the new tag:
112112

113113
```bash
114114
# Get all commits including merge commits (backports), bounded by the new tag
115-
git log <previous_version>..v<new_version> --pretty=format:"%h - %s (%an, %ar)"
115+
git log v<previous_version>..v<new_version> --pretty=format:"%h - %s (%an, %ar)"
116116
```
117117

118118
For example, if generating changelog for `v0.37.2`:
@@ -274,7 +274,7 @@ Cozystack release may include changes from related repositories. Check and inclu
274274

275275
```bash
276276
# Extract all PR numbers from commit messages in the release range (including merge commits)
277-
git log <previous_version>..<new_version> --format="%s%n%b" | grep -oE '#[0-9]+' | sort -u | tr -d '#'
277+
git log v<previous_version>..v<new_version> --format="%s%n%b" | grep -oE '#[0-9]+' | sort -u | tr -d '#'
278278
```
279279

280280
**⚠️ IMPORTANT: Handle backports correctly:**
@@ -283,7 +283,6 @@ git log <previous_version>..<new_version> --format="%s%n%b" | grep -oE '#[0-9]+'
283283
- For backport entries in changelog, use the original PR author (not the backport PR author)
284284
- **MUST** combine the original and backport PR into a **single changelog entry** with both PR numbers (e.g. `#1606, backport #1609`). NEVER list the original and the backport as two separate entries — that produces visible duplicates and was the primary defect that motivated this rule.
285285
- To find original PR from backport: Check the backport PR description or commit message for "Backport of #ORIGINAL_PR"
286-
- If a release range contains a backport but its original PR is **not** in the same range (because the original was merged earlier and already shipped in a previous release), drop the entry entirely — it has already been changelog'd.
287286

288287
**For each PR number, get the author:**
289288

@@ -296,7 +295,7 @@ git log <previous_version>..<new_version> --format="%s%n%b" | grep -oE '#[0-9]+'
296295
```bash
297296
# Usage: Get PR author - MANDATORY for EVERY PR
298297
# Loop through ALL PR numbers and get PR author (including backports)
299-
git log <previous_version>..<new_version> --format="%s%n%b" | grep -oE '#[0-9]+' | sort -u | tr -d '#' | while read PR_NUMBER; do
298+
git log v<previous_version>..v<new_version> --format="%s%n%b" | grep -oE '#[0-9]+' | sort -u | tr -d '#' | while read PR_NUMBER; do
300299
# Check if this is a backport PR
301300
BACKPORT_INFO=$(gh pr view "$PR_NUMBER" --json body --jq '.body' 2>/dev/null | grep -i "backport of #" || echo "")
302301
if [ -n "$BACKPORT_INFO" ]; then
@@ -512,21 +511,25 @@ Create a new changelog file in the format matching previous versions:
512511
513512
**Get all previous contributors (to identify new ones):**
514513
```bash
515-
# Extract GitHub usernames from all previous changelogs
516-
grep -hE '\[@[a-zA-Z0-9_-]+\]' docs/changelogs/v*.md | \
517-
grep -oE '@[a-zA-Z0-9_-]+' | \
514+
# Extract GitHub usernames from all previous changelogs (filtering out bot/CI accounts)
515+
grep -hoE '\[\*\*@[a-zA-Z0-9_/-]+\*\*\]' docs/changelogs/v*.md | \
516+
sed -E 's|\[\*\*@||; s|\*\*\]||' | \
517+
grep -viE '^(app/|.*\[bot\]$|cozystack-ci$|github-actions$|dependabot$|renovate$)' | \
518518
sort -u > /tmp/previous_contributors.txt
519519
```
520520
521521
**Identify new contributors (first-time contributors):**
522522
```bash
523-
# Get current release contributors from the changelog
524-
grep -oE '@[a-zA-Z0-9_-]+' docs/changelogs/v<version>.md | \
523+
# Get current release contributors from the changelog (filtering out bot/CI accounts)
524+
grep -oE '\[\*\*@[a-zA-Z0-9_/-]+\*\*\]' docs/changelogs/v<version>.md | \
525+
sed -E 's|\[\*\*@||; s|\*\*\]||' | \
526+
grep -viE '^(app/|.*\[bot\]$|cozystack-ci$|github-actions$|dependabot$|renovate$)' | \
525527
sort -u > /tmp/current_contributors.txt
526528
527-
# Get all previous contributors
528-
grep -hE '@[a-zA-Z0-9_-]+' docs/changelogs/v*.md | \
529-
grep -oE '@[a-zA-Z0-9_-]+' | \
529+
# Get all previous contributors (filtering out bot/CI accounts)
530+
grep -hoE '\[\*\*@[a-zA-Z0-9_/-]+\*\*\]' docs/changelogs/v*.md | \
531+
sed -E 's|\[\*\*@||; s|\*\*\]||' | \
532+
grep -viE '^(app/|.*\[bot\]$|cozystack-ci$|github-actions$|dependabot$|renovate$)' | \
530533
sort -u > /tmp/all_previous_contributors.txt
531534
532535
# Find new contributors (those in current but not in previous)

0 commit comments

Comments
 (0)