Skip to content

Feat/auto docs#49

Merged
kisside merged 11 commits into
mainfrom
feat/auto-docs
Jun 14, 2026
Merged

Feat/auto docs#49
kisside merged 11 commits into
mainfrom
feat/auto-docs

Conversation

@kisside

@kisside kisside commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added automated documentation preview builds for pull requests, including a persistent preview-link comment and versioned deployment/cleanup.
  • Documentation

    • Introduced a Gemini PR review styleguide with clear commenting standards and a documentation checklist.
  • Chores

    • Updated Gemini review configuration defaults (including memory and code-review comment settings).
    • Expanded documentation dependencies to include mike.
    • Minor type-annotation cleanup in model-selection utilities.

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 082e538a-512b-492f-884f-bdce6c8f73d6

📥 Commits

Reviewing files that changed from the base of the PR and between 1ca64ac and baac6d3.

📒 Files selected for processing (1)
  • .github/workflows/docs-preview.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/docs-preview.yml

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Gemini AI Configuration and Documentation Preview Automation

Layer / File(s) Summary
Gemini AI review configuration
.gemini/config.yaml, .gemini/styleguide.md
Adds Gemini config (code_review enabled at MEDIUM, memory enabled, pull_request_opened flags) and a repository styleguide for PR comment and documentation review standards.
Docs preview workflow setup and dependencies
.github/workflows/docs-preview.yml (lines 1–50), pyproject.toml
Workflow triggers on doc-related changes targeting main, sets write permissions, configures job container, checkout, git author, and computes/exports PREVIEW_VERSION and PREVIEW_URL; pyproject.toml adds mike>=2.1.3 to docs dependencies.
Docs build and deploy to preview
.github/workflows/docs-preview.yml (lines 51–77)
Builds MkDocs site in strict mode for non-closed PRs and deploys versioned previews via mike deploy with up to 3 retry attempts and gh-pages refresh between attempts.
Docs preview cleanup on closed PRs
.github/workflows/docs-preview.yml (lines 78–113)
Refreshes gh-pages, checks for preview identifier with mike list, and deletes previews with mike delete using retries when present; treats missing identifier as a successful no-op.
PR comment automation for preview links
.github/workflows/docs-preview.yml (lines 114–170)
Paginates PR comments, updates or creates a single bot comment containing PREVIEW_URL with marker <!-- docs-preview-comment -->, and suppresses HTTP 403 errors while rethrowing others.
Minor typing change
ratiopath/model_selection/split.py
Adds : Any annotation to *arrays parameter in train_test_split without runtime changes.

Sequence Diagram

sequenceDiagram
  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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • JakubPekar

Poem

🐰 I hopped to tweak docs and CI delight,
Previews spin up, staging pages bright,
Gemini reads with tidy rules in hand,
A tiny typing nudge across the land,
Rabbit cheers: the previews take flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat/auto docs' clearly relates to the main changes: adding automated documentation configuration and workflow files (Gemini config, styleguide, docs-preview workflow, and mike dependency).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 feat/auto-docs

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.

@kisside kisside marked this pull request as ready for review June 8, 2026 12:30
@kisside kisside requested review from a team and matejpekar June 8, 2026 12:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/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

📥 Commits

Reviewing files that changed from the base of the PR and between 888f17d and 91dbe3c.

📒 Files selected for processing (3)
  • .gemini/config.yaml
  • .gemini/styleguide.md
  • .github/workflows/docs-preview.yml

Comment thread .github/workflows/docs-preview.yml Outdated
Comment thread .github/workflows/docs-preview.yml Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/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

📥 Commits

Reviewing files that changed from the base of the PR and between 91dbe3c and 13f7ec6.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .github/workflows/docs-preview.yml
  • pyproject.toml
  • ratiopath/model_selection/split.py
✅ Files skipped from review due to trivial changes (1)
  • ratiopath/model_selection/split.py

Comment thread .github/workflows/docs-preview.yml
Comment thread .github/workflows/docs-preview.yml
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Documentation Preview

Preview URL: https://RationAI.github.io/ratiopath/feat-auto-docs/

Adames4
Adames4 previously approved these changes Jun 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/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

📥 Commits

Reviewing files that changed from the base of the PR and between 13f7ec6 and 0fc7898.

📒 Files selected for processing (1)
  • .github/workflows/docs-preview.yml

Comment thread .github/workflows/docs-preview.yml
Adames4
Adames4 previously approved these changes Jun 9, 2026
Comment thread .github/workflows/docs-preview.yml
@kisside kisside merged commit 49892ab into main Jun 14, 2026
7 checks passed
@kisside kisside deleted the feat/auto-docs branch June 14, 2026 14:16
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