Feat/auto docs#49
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds Gemini AI configuration and styleguide, a GitHub Actions docs-preview workflow that builds/deploys MkDocs previews and comments the PR, updates docs dependencies to include mike, and applies a small typing annotation to train_test_split. ChangesGemini AI Configuration and Documentation Preview Automation
Sequence DiagramsequenceDiagram
participant PR as Pull Request
participant Runner as Actions Runner
participant Checkout as Checkout
participant Build as MkDocs Build
participant Mike as mike CLI
participant Pages as GitHub Pages
participant GH as GitHub API
PR->>Runner: trigger (paths: docs/**, ratiopath/**, mkdocs.yml, pyproject.toml)
Runner->>Checkout: checkout repository with full history
Runner->>Build: uv run --group docs mkdocs build --strict
Build->>Mike: mike deploy --push --update-aliases (PREVIEW_VERSION)
Mike->>Pages: publish preview (PREVIEW_URL)
Runner->>GH: create/update PR comment with PREVIEW_URL
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
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/workflows/docs-preview.yml:
- Around line 26-27: The checkout step ("Check out repository" using
actions/checkout@v6) currently leaves the workflow token persisted; update that
job step to include persist-credentials: false in the actions/checkout
invocation so the workflow token is not saved to local git config during
subsequent steps (i.e., add the persist-credentials: false input under the
actions/checkout@v6 step).
- Line 27: Replace tag ref usages in the workflow's `uses:` entries (e.g., the
occurrences currently using actions/checkout@v6 and the other `@v*` refs
referenced in the comment) with their corresponding immutable commit SHAs: look
up each action repository, find the commit SHA for the desired tag/version, and
update each `uses:` line to use the full SHA (repo@sha256 or repo@<commit-sha>)
instead of the tag; additionally, harden the checkout step by adding
`persist-credentials: false` to the actions/checkout invocation unless the
workflow actually requires persisted credentials.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 95efc04f-a86d-4864-8d9c-36d45d2231ad
📒 Files selected for processing (3)
.gemini/config.yaml.gemini/styleguide.md.github/workflows/docs-preview.yml
There was a problem hiding this comment.
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/workflows/docs-preview.yml:
- Around line 13-15: Current workflow grants broad repo write rights in the
global permissions block ("permissions" with "contents: write" and "issues:
write") while still running untrusted PR-controlled build steps like "mkdocs
build"; change the global permissions to least privilege (e.g., "contents:
read") and remove write scopes, then create a separate deploy job that requests
"contents: write" only for trusted runs (reference the job that runs "mkdocs
build" and the deploy job) and gate that deploy job to trusted events/branches
(e.g., only run on push to main or use a manual/approved workflow dispatch or
require github.event_name/push and github.ref checks) so PRs cannot execute code
with a write-scoped token; apply the same fix for the similar permissions block
at the other occurrence noted (lines 53-59).
- Around line 49-51: The VERSION_NAME computed from BRANCH_NAME can collide for
different branches; update the generation so it appends the PR number (use
github.event.pull_request.number or github.ref if available) to the normalized
branch slug before exporting PREVIEW_VERSION and PREVIEW_URL; ensure the same
combined value is used for both PREVIEW_VERSION and in the URL written to
GITHUB_ENV so each PR gets a unique preview path (refer to VERSION_NAME,
BRANCH_NAME, PREVIEW_VERSION, PREVIEW_URL, and GITHUB_ENV in the diff).
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8530c30c-75f5-4234-a67f-2cb6877b5e97
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
.github/workflows/docs-preview.ymlpyproject.tomlratiopath/model_selection/split.py
✅ Files skipped from review due to trivial changes (1)
- ratiopath/model_selection/split.py
Documentation PreviewPreview URL: https://RationAI.github.io/ratiopath/feat-auto-docs/ |
There was a problem hiding this comment.
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/workflows/docs-preview.yml:
- Around line 19-21: The workflow currently uses a static concurrency group
("concurrency.group") which serializes all docs-preview jobs across PRs; change
the concurrency.group to a PR-unique value (e.g., incorporate
github.event.pull_request.number, github.ref, or github.run_id) so previews for
different PRs run in parallel, and set cancel-in-progress as appropriate (or
remove the global serialization) instead of using a fixed name; leave the
existing retry logic that handles gh-pages push conflicts (the retry loop
referenced in the workflow) 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 567fd4df-b27a-4dde-83f1-1bef6fa61dfd
📒 Files selected for processing (1)
.github/workflows/docs-preview.yml
Summary by CodeRabbit
New Features
Documentation
Chores
mike.