Update Previews - #392
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds GitHub Actions workflows that build and publish pull request documentation previews, maintain preview status comments, and remove preview directories and update comments when pull requests close. ChangesPull request preview lifecycle
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PullRequest
participant GitHubActions
participant Jekyll
participant GhPages
participant PreviewComment
PullRequest->>GitHubActions: Trigger preview workflow
GitHubActions->>Jekyll: Build site with PR base URL
Jekyll-->>GitHubActions: Generate _site
GitHubActions->>GhPages: Publish pr-previews/<PR_NUMBER>
GitHubActions->>PreviewComment: Create or update preview comment
PullRequest->>GitHubActions: Trigger cleanup on close
GitHubActions->>GhPages: Remove pr-previews/<PR_NUMBER>
GitHubActions->>PreviewComment: Mark preview as removed
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ 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: 4
🧹 Nitpick comments (1)
.github/workflows/pr-preview.yml (1)
42-43: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueMissing
apt-get updatebefore install.
sudo apt-get install -y asciidoctorruns without a precedingapt-get update, which can occasionally fail with stale/missing package indexes on the runner image. Also note the Gemfile already includes theasciidoctorRuby gem, so this system package may be redundant forjekyll-asciidoc.🤖 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/pr-preview.yml around lines 42 - 43, Update the “Install system dependencies” workflow step to run apt-get update before installing asciidoctor, or remove the system package installation if the existing Gemfile dependency fully provides the required functionality. Keep the preview workflow’s dependency setup correct and avoid retaining a redundant installation.
🤖 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/pr-preview.yml:
- Around line 126-130: Update the comment lookups in
.github/workflows/pr-preview.yml lines 126-130 and
.github/workflows/pr-preview-cleanup.yml lines 52-56 to use github.paginate with
github.rest.issues.listComments and the existing owner, repo, and issue_number
parameters before searching for the marker, so both workflows inspect all
comment pages.
- Around line 54-93: Serialize all shared gh-pages deployments by adding the
same job/workflow-level concurrency group, gh-pages-deploy, to
.github/workflows/pr-preview.yml lines 54-93 and
.github/workflows/pr-preview-cleanup.yml lines 24-37. In both workflows, update
the git push logic to fetch the current gh-pages branch, rebase the local
commit, and retry on non-fast-forward failure before failing; apply the
equivalent change in each site so build and cleanup pushes self-heal
consistently.
- Around line 3-22: Update .github/workflows/pr-preview.yml lines 3-22 and
.github/workflows/pr-preview-cleanup.yml lines 3-9 to explicitly handle fork
pull requests: either restrict preview deployment and cleanup to same-repository
branches, or split fork handling into an untrusted artifact-producing job and a
trusted job that performs gh-pages pushes and PR comment operations with
elevated permissions.
- Around line 30-34: Make credential persistence explicit in the checkout steps:
add persist-credentials: true to the checkout action in
.github/workflows/pr-preview.yml lines 30-34 and
.github/workflows/pr-preview-cleanup.yml lines 17-22, preserving the later git
push authentication; no other changes are required.
---
Nitpick comments:
In @.github/workflows/pr-preview.yml:
- Around line 42-43: Update the “Install system dependencies” workflow step to
run apt-get update before installing asciidoctor, or remove the system package
installation if the existing Gemfile dependency fully provides the required
functionality. Keep the preview workflow’s dependency setup correct and avoid
retaining a redundant installation.
🪄 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 Plus
Run ID: d15c4e59-c914-4c6f-b849-5883314bc4be
📒 Files selected for processing (2)
.github/workflows/pr-preview-cleanup.yml.github/workflows/pr-preview.yml
vashirova
left a comment
There was a problem hiding this comment.
@anarnold97 LGTM, thank you.
|
LGTM |
Summary by CodeRabbit
New Features
Bug Fixes
To Do
Two one-time settings steps in GitHub:
Settings→Actions→General→Workflow permissions→ select "Read and write permissions" → check "Allow GitHub Actions to create and approve pull requests" →SaveSettings→Pages→Source→ "Deploy from a branch" → Branch: gh-pages, folder: / (root) → SaveThe gh-pages branch won't exist yet — the first PR preview run creates it automatically. Come back and do
step 2after that first run completes.Once both are done, open any PR that touches a file in
docs/,assemblies/, ortopics/and we should see the preview workflow trigger and a bot comment appear with the link.Summary by CodeRabbit
New Features
Bug Fixes