Conversation
There was a problem hiding this comment.
Pull request overview
Adds a manually triggered GitHub Actions workflow intended to automate release documentation updates by running a Python script and opening a PR in this docs repository.
Changes:
- Introduces a new
workflow_dispatchworkflow with inputs (component, release type, version, release date, instructions, draft PR). - Sets up Python, installs the Anthropic SDK, runs a docs update script, and opens a PR via
peter-evans/create-pull-request.
|
Newest code from mattermost has been published to preview environment for Git SHA bf7c558 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Newest code from mattermost has been published to preview environment for Git SHA 836a331 |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces automated documentation update tooling. A new GitHub Actions workflow accepts release metadata (component, version, release type, and optional instructions) and triggers a Python script that regenerates documentation files via the Anthropic API, then creates a pull request with the updates. ChangesAutomated Documentation Updates
Sequence DiagramsequenceDiagram
actor User
participant GitHub as GitHub Actions
participant Script as update_docs.py
participant Anthropic as Anthropic API
participant FileSystem as File System
User->>GitHub: Trigger workflow_dispatch<br/>(component, version, release_type, etc.)
GitHub->>GitHub: Checkout repo<br/>Setup Python 3.11<br/>Install anthropic package
GitHub->>Script: Run with env vars<br/>(ANTHROPIC_API_KEY, metadata)
Script->>FileSystem: Read file list<br/>for component & release_type
loop For each documentation file
Script->>FileSystem: Read file content
Script->>Script: Build user prompt<br/>(metadata + content)
Script->>Anthropic: Call Messages API<br/>(system + user prompt)
Anthropic->>Anthropic: Generate updated docs
Anthropic-->>Script: Return response.content[0].text
Script->>Script: Validate safety checks<br/>(length, non-empty, changed)
Script->>FileSystem: Write updated file<br/>(if safe)
end
Script-->>GitHub: Exit with status
GitHub->>GitHub: Create PR<br/>docs/$component-v$version<br/>with generated title/body
GitHub-->>User: PR created (draft or ready)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Newest code from mattermost has been published to preview environment for Git SHA 2eed2fe |
|
Newest code from mattermost has been published to preview environment for Git SHA cb4dc94 |
|
Newest code from mattermost has been published to preview environment for Git SHA 8b3f734 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/update-docs.yml (1)
58-59: ⚡ Quick winPin the Anthropic SDK version for reproducible workflow runs.
Installing
anthropicwithout a version can pull breaking changes and make the automation flaky over time. The latest stable version is 0.97.0 and is compatible with Python 3.11.Suggested fix
- - name: Install dependencies - run: pip install anthropic + - name: Install dependencies + run: pip install -r .github/scripts/update-docs-requirements.txt# .github/scripts/update-docs-requirements.txt anthropic==0.97.0🤖 Prompt for 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. In @.github/workflows/update-docs.yml around lines 58 - 59, Replace the unpinned pip install in the "Install dependencies" workflow step by pinning the Anthropic SDK to 0.97.0: create a requirements file named .github/scripts/update-docs-requirements.txt containing anthopic==0.97.0 and change the step that currently runs "pip install anthropic" to "pip install -r .github/scripts/update-docs-requirements.txt" so the workflow uses the fixed anthropic==0.97.0 release for reproducible runs.
🤖 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/update_docs.py:
- Around line 138-140: The current handlers in update_docs.py (including the
except FileNotFoundError block and the other early-return sites around where
errors/warnings are logged) log problems then return, allowing main() to exit
success; change those returns to fail-fast behavior by raising or exiting
non‑zero (e.g., raise RuntimeError or call sys.exit(1)) so the workflow fails
when safety checks reject an update; update the except FileNotFoundError handler
and the two locations that log error/warning (the blocks referenced around lines
152–163) to propagate a non‑zero failure instead of returning normally.
- Line 142: The print statements using f-strings with no placeholders (e.g.,
print(f" Sending to Claude...") and the similar print at line 183) should be
converted to plain strings; locate the print calls in update_docs.py (look for
the exact message " Sending to Claude..." and the other analogous message) and
change them from f-strings to normal string literals (remove the leading f) so
they are simple print(" Sending to Claude...") calls.
In @.github/workflows/update-docs.yml:
- Line 75: Sanitize the free-form inputs.version before using it in the branch
ref: replace or remove characters that can make invalid Git branch names
(spaces, slashes, colons, parentheses, and other non-alphanumeric characters
except dot and dash), collapse consecutive separators to a single dash, trim
leading/trailing separators, and normalize case; then use that sanitized value
instead of inputs.version in the branch expression (replace branch: docs/${{
inputs.component }}-v${{ inputs.version }} with branch: docs/${{
inputs.component }}-v${{ steps.sanitize-version.outputs.version }} and add a
short step named sanitize-version that computes and outputs the cleaned version
string).
---
Nitpick comments:
In @.github/workflows/update-docs.yml:
- Around line 58-59: Replace the unpinned pip install in the "Install
dependencies" workflow step by pinning the Anthropic SDK to 0.97.0: create a
requirements file named .github/scripts/update-docs-requirements.txt containing
anthopic==0.97.0 and change the step that currently runs "pip install anthropic"
to "pip install -r .github/scripts/update-docs-requirements.txt" so the workflow
uses the fixed anthropic==0.97.0 release for reproducible runs.
🪄 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: dde1a4b0-2311-4c59-9766-35b752c87527
📒 Files selected for processing (2)
.github/scripts/update_docs.py.github/workflows/update-docs.yml
|
Newest code from mattermost has been published to preview environment for Git SHA 36da96b |
|
Newest code from mattermost has been published to preview environment for Git SHA 121da36 |
Full spec doc: https://mattermost.atlassian.net/wiki/spaces/Security/pages/4518772760/Automation+-+Release+Docs+Update+GitHub+Actions+Workflow.
Adds a GitHub Actions workflow that automates docs updates for Mattermost releases. Instead of manually opening a GitHub issue, tagging claude, and pasting file URLs each time, you go to Actions → Update Docs → Run workflow and fill in four fields:
The workflow then automatically selects the right set of files for that component and release type, sends each one to Claude via the Anthropic API with the release context, and opens a PR with all the updated files — no issue, no copy-pasting URLs, no manual file list.