Repository navigation
ci(docs-preview): decouple preview pruning, fix removal on close, scope preview paths - #181
Conversation
…pe preview paths Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe workflows now build preview artifacts under a shared directory, deploy or remove PR previews with corresponding comments, and prune older preview directories through a separate cleanup workflow. ChangesDocs preview lifecycle
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant PostBuild as Docs Preview Post-Build
participant Cleanup as Cleanup workflow
participant Pages as gh-pages
participant PR as Pull request
PostBuild->>Cleanup: Workflow completion triggers cleanup
Cleanup->>Pages: Fetch latest state and identify previews beyond retention limit
loop Up to five attempts when push fails
Cleanup->>Pages: Remove old preview directories and push changes
end
opt Previews were successfully removed
Cleanup->>PR: Update or create preview removal comment
end
Merge Risk: ⚪ Minimal · up to The preview build, removal, and cleanup paths show no identified merge-blocking issue. Normal workflow checks remain appropriate. Architecture SummaryArchitecture risk: 🔵 Low · up to The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency. Changed systems: None identified. Architecture concerns Review detailsBefore / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
🧹 Preview removed because the pull request was closed. |
Summary
Brings this repository's docs-preview workflows in line with meshery-extensions/tcslabs-academy#72. Pruning old previews is now a separate cleanup workflow, previews are removed reliably when a PR is closed, and the build only triggers on paths that affect the Hugo site.
Changes
Build (
build-docs-preview.yml)closedevents the job still runs but skips setup and build. Previously the whole job was skipped, so no PR metadata reached the post-build workflow and closed PRs kept their previews.preview/directory, so the artifact has the same layout whether or notpublic/exists.pathsfilter covers the Hugo directories this repository uses (content,layouts,assets,static,data,i18nwhere present) and the build inputs (hugo.yaml,go.mod,go.sum,package.json,package-lock.json,postcss.config.js).Post-build (
deploy-docs-preview.yml)actions/download-artifactis pinned to a commit SHA.Cleanup (
cleanup-docs-preview.yml, new)gh-pagesand removes the rest.retentioninput.gh-pagesare retried with backoff against the latest remote state, so concurrent preview runs don't fail the job.How to verify
gh-pagesand a removal comment is posted.retention: excess previews are pruned and their PRs get a comment.Signed commits
Summary by CodeRabbit