Skip to content

Changelog automation fixes#8947

Open
amyblais wants to merge 2 commits intomasterfrom
amyblais-changelogfix2
Open

Changelog automation fixes#8947
amyblais wants to merge 2 commits intomasterfrom
amyblais-changelogfix2

Conversation

@amyblais
Copy link
Copy Markdown
Member

@amyblais amyblais commented May 8, 2026

Fix an issue where the changelog automation didn't work properly. The milestones API only returns 100 results per page, and mattermost/mattermost has been active since 2015 — it has hundreds of milestones. The script is only fetching the first page (the oldest ones), so v11.7.0 is never seen. The fix is to paginate through all milestone pages, and sort descending so recent milestones come first.

The fix:

  • Paginates through all milestone pages until it finds a match.
  • Sorts descending so the most recent milestones come first — for a repo like this, v11.7.0 will almost certainly be found on page 1 now, making it fast.
  • The "available milestones" debug line now shows the most recent ones instead of the oldest, which is much more useful if there's ever a name mismatch.

Copilot AI review requested due to automatic review settings May 8, 2026 08:59
@amyblais amyblais added the 1: Dev Review Requires review by a core commiter label May 8, 2026
@amyblais amyblais requested a review from NARSimoes May 8, 2026 08:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes changelog generation automation by updating the GitHub milestones lookup to handle repositories with more than 100 milestones, ensuring the target milestone (e.g., v11.7.0) can be found reliably.

Changes:

  • Paginate through all milestone pages until the requested milestone title is found (or no more pages remain).
  • Request milestones in descending order to bias results toward newer milestones for faster matches.
  • Improve the “available milestones” debug output to show the most recent milestone titles from page 1.

Comment thread .github/scripts/generate_changelog.py
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Newest code from mattermost has been published to preview environment for Git SHA c5d3b92

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

Warning

Rate limit exceeded

@amyblais has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 44 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0acd6b4a-71f5-4f98-ad2a-692856a4b270

📥 Commits

Reviewing files that changed from the base of the PR and between c5d3b92 and e7d7c25.

📒 Files selected for processing (1)
  • .github/scripts/generate_changelog.py
📝 Walkthrough

Walkthrough

The get_milestone_number() function in the changelog generation script now paginates through all GitHub milestones in batches of 100 instead of requesting only the first page. When a requested milestone title is not found after checking all pages, the function prints the most recent milestone titles captured from the first page, rather than an "available milestones" list.

Changes

GitHub Changelog Script Enhancement

Layer / File(s) Summary
Milestone Pagination Logic
.github/scripts/generate_changelog.py
Function introduces a pagination loop to iterate through all GitHub milestones (100 per page) until exhausted. Error reporting changes from "Available milestones" (single response) to "Most recent milestones" (first page). Returns milestone number when found, or None otherwise.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Changelog automation fixes' directly addresses the main change—fixing the changelog automation script's pagination issue with GitHub milestones.
Description check ✅ Passed The description comprehensively explains the changelog automation issue, the specific problem with pagination, and the implemented fixes related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch amyblais-changelogfix2

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/scripts/generate_changelog.py:
- Around line 91-92: The requests.get calls that assign to resp (the call "resp
= requests.get(url, headers=HEADERS, params=params)" and the similar call later)
must include an explicit timeout to avoid hanging; update both calls to pass
timeout=30 (i.e., requests.get(..., timeout=30, ...)) so network requests fail
fast on unresponsive API endpoints, leaving the rest of the parameters
(headers/params) unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9dabe30-daa1-4eac-b34a-2b64c72df18f

📥 Commits

Reviewing files that changed from the base of the PR and between 03d7946 and c5d3b92.

📒 Files selected for processing (1)
  • .github/scripts/generate_changelog.py

Comment thread .github/scripts/generate_changelog.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Newest code from mattermost has been published to preview environment for Git SHA e7d7c25

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

Labels

1: Dev Review Requires review by a core commiter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants