Skip to content

Changelog automation fixes#8988

Merged
amyblais merged 10 commits into
masterfrom
amyblais-changelogfixes5
May 22, 2026
Merged

Changelog automation fixes#8988
amyblais merged 10 commits into
masterfrom
amyblais-changelogfixes5

Conversation

@amyblais
Copy link
Copy Markdown
Member

@amyblais amyblais commented May 19, 2026

Minor improvements to the changelog generation automation.

  • "UI" → "user interface" — added as a dedicated Terminology rule in the system prompt.
  • Feature vs ESR releases — new release_type dropdown input (feature/esr). Feature releases generate (release-v11.7)= / ## Release v11.7; ESR releases keep the Extended Support Release link. Defaults to feature.
  • No blank lines between headers and bullets — explicitly stated in the rules.
  • Indented bullets — system prompt now specifies - item (2-space indent) for all bullet points.
  • "Fixed a bug" → "Fixed an issue" — added to sentence patterns and rules.
  • Go Version section always included — new go_version workflow input. Script builds the section from the input (Updated to go1.22.5.) or falls back to "Go version is the same as in the previous release.". The section is injected by replacing the AI's ### Go Version placeholder, or appended if the AI omitted it.
  • Open Source Components format — system prompt now specifies the exact format.
  • Fixed some cases where release notes may not get pulled from dev PRs:
    • Heading variation: Added a secondary scan of the entire PR body for release-note blocks. If no #### Release Note section is found, the script now picks up any release-note blocks wherever they appear, matching the format you showed.
    • Null merged_at: For any PR where merged_at is unexpectedly null, the script now makes a direct call to the Pulls API (/repos/{owner}/{repo}/pulls/{number}) to verify the merged flag before skipping it.
    • Rate limiting: Replaced all requests.get() calls with a new make_github_request() helper that reads the X-RateLimit-Reset header and sleeps until the window resets before retrying, up to 3 retries.

Copilot AI review requested due to automatic review settings May 19, 2026 09:54
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 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 20 minutes and 56 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: 4fe11ba5-2317-4000-b191-1b958a1a01e1

📥 Commits

Reviewing files that changed from the base of the PR and between 04af83e and 44329b5.

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

Walkthrough

The PR extends the changelog generation workflow and script to accept release_type (feature/ESR) and go_version parameters, adds GitHub API retry resilience via a shared session, refines Claude's system prompt for stricter formatting rules, implements two-phase release notes extraction with fallback, enhances PR merge verification, and generates/injects a Go Version section into the changelog based on the release type.

Changes

Changelog Workflow and Script Updates

Layer / File(s) Summary
Workflow dispatch inputs and environment wiring
.github/workflows/generate-changelog.yml
The workflow gains release_type (choice: feature/esr) and go_version (optional string) as dispatch inputs, which are passed to the changelog script via RELEASE_TYPE and GO_VERSION environment variables.
GitHub API retry configuration and session setup
.github/scripts/generate_changelog.py
The script imports HTTPAdapter and Retry, configures a resilient retry strategy for transient errors, creates a shared requests.Session, and wires it into API calls (get_milestone_number, get_merged_prs) to enable automatic retries.
AI system prompt refinements
.github/scripts/generate_changelog.py
The script header documents RELEASE_TYPE and GO_VERSION environment variables; the system prompt enforces "user interface" (no abbreviation), mandates top-level sections (### Go Version, ### Open Source Components, ### Security), and tightens Markdown formatting rules for bullet lists and spacing.
Release notes extraction with fallback
.github/scripts/generate_changelog.py
The extract_release_notes function now uses two-stage extraction: first parse content under #### Release Note(s) for fenced code blocks, then scan the entire PR body for ```release-note blocks as fallback if the primary path yields nothing; HTML comments are stripped in both paths.
PR merge verification enhancement
.github/scripts/generate_changelog.py
When a PR's merged_at is null, the script now makes an additional Pulls API call to verify the PR is actually merged before including it in the changelog.
Environment variables and Go Version section injection
.github/scripts/generate_changelog.py
The script reads RELEASE_TYPE and GO_VERSION, generates the appropriate release heading based on release type, constructs a ### Go Version subsection (provided or "same as previous release"), and injects or appends it into the final changelog output; when no notes exist, the placeholder "No other release notes for this version." is used.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • mattermost/docs#8949: Both PRs modify .github/scripts/generate_changelog.py by updating the Claude SYSTEM_PROMPT and reworking changelog entry formatting/assembly logic.
  • mattermost/docs#8937: Both PRs adjust release-notes extraction logic targeting #### Release Notes/#### Release Note(s) handling.
  • mattermost/docs#8947: Both PRs touch milestone/PR retrieval logic; this PR adds a retrying shared session while #8947 paginates milestone lookup.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Changelog automation fixes' is related to the changeset but is overly broad and vague, referring only to the general category of fixes rather than highlighting the main specific improvements made. Consider a more specific title that highlights the primary improvement, such as 'Improve changelog generation with release type, Go version, and extraction robustness' or focus on the most significant change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is well-structured and directly related to the changeset, covering all major improvements including terminology changes, release type handling, formatting rules, Go version section, and release note extraction robustness.
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-changelogfixes5

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

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 updates the changelog generation workflow to collect additional release metadata for generated Mattermost documentation changelog entries.

Changes:

  • Adds a release_type workflow input with feature and esr options.
  • Adds a go_version workflow input.
  • Passes both new inputs into the changelog generation step environment.

Comment thread .github/workflows/generate-changelog.yml
Comment thread .github/workflows/generate-changelog.yml
@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

@amyblais amyblais changed the title Update generate-changelog.yml Changelog automation fixes May 19, 2026
@amyblais amyblais added the 1: Dev Review Requires review by a core commiter label May 19, 2026
@amyblais
Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

✅ Actions performed

Full review triggered.

@amyblais amyblais requested a review from NARSimoes May 19, 2026 10:00
@github-actions
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@NARSimoes NARSimoes left a comment

Choose a reason for hiding this comment

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

Thanks @amyblais , just one minor point to clarifications.

Comment thread .github/scripts/generate_changelog.py Outdated
@amyblais amyblais requested a review from NARSimoes May 21, 2026 09:21
@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

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: 2

🤖 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 356-362: The current replacement only swaps the "### Go Version"
heading and can leave Claude's body text intact; update the logic that uses the
polished and go_section variables so when "### Go Version" exists you replace
the entire section from the "### Go Version" heading up to (but not including)
the next "### " heading or end-of-string in one operation (use a single regex
replace for the whole section) and otherwise append go_section as before.
- Line 345: The go_section assignment uses an unnecessary f-string literal;
update the go_section variable (symbol: go_section) to use a plain string
literal (remove the leading "f") since there are no placeholders, ensuring the
line becomes a normal string to satisfy Ruff F541.
🪄 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: cf28a56c-0b4c-4e75-b234-4ffebbdabec4

📥 Commits

Reviewing files that changed from the base of the PR and between 9d8485c and ab4f6d5.

📒 Files selected for processing (2)
  • .github/scripts/generate_changelog.py
  • .github/workflows/generate-changelog.yml

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 6aa3881

Copy link
Copy Markdown
Contributor

@NARSimoes NARSimoes left a comment

Choose a reason for hiding this comment

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

Thanks @amyblais

Comment thread .github/scripts/generate_changelog.py Outdated
@amyblais amyblais removed the 1: Dev Review Requires review by a core commiter label May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

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

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 355-366: The current else branch always appends go_section to
polished, which puts the Go Version at the end even when later top-level
headings like "### Security" or "### Open Source Components" exist; update the
logic so that if no "### Go Version" heading is found but polished contains a
later top-level section (match e.g. r"(?m)^### (Security|Open Source
Components)\b"), insert go_section immediately before the first such matched
heading, otherwise fall back to appending to the end; reference the variables
polished and go_section and the existing regex search for "### Go Version" to
locate where to modify the insertion behavior.
🪄 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: 3ddab4aa-8632-441c-ab9d-65588686b22b

📥 Commits

Reviewing files that changed from the base of the PR and between ab4f6d5 and 04af83e.

📒 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

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

@amyblais amyblais merged commit 46527e4 into master May 22, 2026
6 checks passed
@amyblais amyblais deleted the amyblais-changelogfixes5 branch May 22, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants