Skip to content

Update generate_changelog.py#8949

Open
amyblais wants to merge 4 commits into
masterfrom
amyblais-changelogfixes2
Open

Update generate_changelog.py#8949
amyblais wants to merge 4 commits into
masterfrom
amyblais-changelogfixes2

Conversation

@amyblais
Copy link
Copy Markdown
Member

Changelog automation script fixes.

Copilot AI review requested due to automatic review settings May 11, 2026 10:41
@amyblais amyblais added the 1: Dev Review Requires review by a core commiter label May 11, 2026
@amyblais amyblais requested a review from NARSimoes May 11, 2026 10:41
@github-actions
Copy link
Copy Markdown
Contributor

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 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 59 minutes and 58 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: b4eba58e-ffe2-40f0-86a8-8266e326f275

📥 Commits

Reviewing files that changed from the base of the PR and between ecd58fc and 5918800.

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

Walkthrough

Updated the changelog generation system prompt to enforce stricter section structure with a fixed hierarchy, defined top-level categories, and specific formatting constraints. Refactored changelog insertion to use a static header marker for reliable splicing. Removed explicit timeout from the milestone API request.

Changes

Changelog Generation and Insertion

Layer / File(s) Summary
AI Prompt: Section Structure and Categories
.github/scripts/generate_changelog.py
SYSTEM_PROMPT now specifies a strict ###/#### hierarchy with a fixed ordered list of top-level sections (including Open Source Components) and Upgrade Impact subsections (config.json, compatibility, improvements), requiring empty sections to be omitted.
AI Prompt: Formatting Constraints and Output Scope
.github/scripts/generate_changelog.py
SYSTEM_PROMPT formatting rules expand to prohibit horizontal rules, enforce Markdown bullet formatting, retain license and proofreading requirements, and restrict output to changelog section content only (excluding headers/intro).
Changelog Insertion with Header Marker
.github/scripts/generate_changelog.py
prepend_to_changelog is refactored to insert new release entries after a static HEADER_END_MARKER within the changelog file; falls back to insertion after the first top-level heading if the marker is not found.
Milestone Request Timeout Removal
.github/scripts/generate_changelog.py
GitHub API request in get_milestone_number no longer specifies an explicit timeout parameter.

Sequence Diagram

sequenceDiagram
  participant script as generate_changelog.py
  participant github as GitHub API
  participant claude as Claude API
  participant changelog as changelog.md
  
  script->>github: get_milestone_number() (no timeout)
  github-->>script: milestone_number
  
  script->>claude: Call with SYSTEM_PROMPT + release notes
  note over claude: Format sections as ###/#### hierarchy<br/>Include Open Source Components<br/>Detailed Upgrade Impact subsections<br/>No empty sections or horizontal rules
  claude-->>script: Formatted changelog sections
  
  script->>changelog: prepend_to_changelog()<br/>Insert after HEADER_END_MARKER
  note over changelog: New release entry spliced<br/>after static header block
  changelog-->>script: Insertion complete
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • mattermost/docs#8937: Modifies changelog parsing and section generation logic in the same script.
  • mattermost/docs#8947: Updates get_milestone_number in the same script with pagination and output changes.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Update generate_changelog.py' is vague and generic, using only the file name without describing what was actually changed or fixed in the script. Use a more descriptive title that captures the main changes, such as 'Refactor changelog generation: improve prompt structure and changelog insertion logic' or 'Fix changelog automation: update prompt directives and insertion mechanism'.
Description check ❓ Inconclusive The description 'Changelog automation script fixes' is related to the changeset but is too vague and generic to clearly convey the specific fixes and improvements made. Expand the description to outline the key changes such as: tightened SYSTEM_PROMPT formatting requirements, refactored prepend_to_changelog to use a marker-based approach, and removed timeout from GitHub milestones request.
✅ Passed checks (3 passed)
Check name Status Explanation
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-changelogfixes2

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:
- Line 103: The requests.get call that assigns resp (resp = requests.get(url,
headers=HEADERS, params=params)) lacks a timeout, which can hang the changelog
generation; update that call to include a sensible timeout (e.g., timeout=10 or
a configured TIMEOUT constant) so the HTTP request fails fast on
slow/unresponsive GitHub API responses and handle the resulting timeout
exception as appropriate in the surrounding function.
🪄 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: f8b3dba5-78f2-4b65-b4c0-a2cf3bb1506f

📥 Commits

Reviewing files that changed from the base of the PR and between d63b6e0 and ecd58fc.

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

Comment thread .github/scripts/generate_changelog.py Outdated
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

Updates the changelog automation script used to generate and insert release-note content into Mattermost changelog pages, primarily by tightening the AI formatting instructions and changing how new entries are inserted so the static changelog header is preserved.

Changes:

  • Expanded/refined the AI SYSTEM_PROMPT to enforce stricter section structure and formatting rules for generated changelog entries.
  • Updated changelog insertion logic to insert new entries after a static header marker block (instead of naïvely prepending).
  • Adjusted GitHub milestone fetching request behavior (notably removing the explicit HTTP timeout).

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

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

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