Add docs audit severities, CI report upload, and dead Pro-link cleanup#61
Add docs audit severities, CI report upload, and dead Pro-link cleanup#61
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
WalkthroughThe changes introduce a documentation audit system with severity levels into the CI workflow, execute it during builds, upload reports as artifacts, and implement a conditional quality gate for error-level findings. The audit script is refactored to emit severity-categorized findings, track line numbers while ignoring fenced code blocks, and improve detection patterns. External Pro domain links are normalized to the canonical internal route. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 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 docstrings
🧪 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 |
|
Cloudflare preview deployed. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Missing blank line between report header and body
- Added an explicit newline between the joined header and body so the Markdown section heading is separated from the first page entry by a blank line.
Or push these changes by commenting:
@cursor push 26ab85dc5e
Preview (26ab85dc5e)
diff --git a/scripts/audit-docs.mjs b/scripts/audit-docs.mjs
--- a/scripts/audit-docs.mjs
+++ b/scripts/audit-docs.mjs
@@ -309,7 +309,7 @@
})
.join("\n");
- return `${header.join("\n")}${body}`;
+ return `${header.join("\n")}\n${body}`;
}
function shouldFailAudit(pages) {7cfa4f7 to
7c5bc0c
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
scripts/prepare-docs.mjs (1)
438-439: URL normalization for OSS docs complete.The same pattern is correctly applied to non-Pro docs. Note that this replacement pattern now appears in three places (
fixKnownDocsIssues,rewriteProLinks, andrewriteFlattenedOssLinks). While idempotent, consider extracting a shared constant for the URL patterns if they need to stay synchronized. As per coding guidelines, "Ask first before making changes to build scripts (scripts/directory)."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/prepare-docs.mjs` around lines 438 - 439, The same URL-rewrite regex literals are duplicated across fixKnownDocsIssues, rewriteProLinks, and rewriteFlattenedOssLinks; extract the common patterns into a single shared constant (e.g., PRO_DOCS_REPLACEMENTS or PRO_DOCS_URL_PATTERNS) and reference that constant from each function instead of repeating the .replace() literals so updates stay synchronized; before applying the change, confirm with the team per the "ask first" guideline for edits under scripts/.prototypes/docusaurus/src/pages/pro.tsx (1)
147-147: UsedocsRoutes.proOverviewfor consistency.Line 76 already uses
docsRoutes.proOverviewfor the same/docs/proroute. Using the constant here maintains consistency and ensures route changes propagate automatically.Suggested change
- <a href="/docs/pro">the Pro docs landing page</a>. + <Link to={docsRoutes.proOverview}>the Pro docs landing page</Link>.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@prototypes/docusaurus/src/pages/pro.tsx` at line 147, Replace the hard-coded "/docs/pro" anchor href with the route constant docsRoutes.proOverview (i.e., use docsRoutes.proOverview instead of the literal string) in the <a> tag around "the Pro docs landing page"; if docsRoutes is not already imported in pro.tsx, add the appropriate import for docsRoutes so the constant is available. Ensure the anchor uses the constant value (or the Link component with docsRoutes.proOverview) so future route changes propagate automatically.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@prototypes/docusaurus/src/pages/pro.tsx`:
- Line 147: Replace the hard-coded "/docs/pro" anchor href with the route
constant docsRoutes.proOverview (i.e., use docsRoutes.proOverview instead of the
literal string) in the <a> tag around "the Pro docs landing page"; if docsRoutes
is not already imported in pro.tsx, add the appropriate import for docsRoutes so
the constant is available. Ensure the anchor uses the constant value (or the
Link component with docsRoutes.proOverview) so future route changes propagate
automatically.
In `@scripts/prepare-docs.mjs`:
- Around line 438-439: The same URL-rewrite regex literals are duplicated across
fixKnownDocsIssues, rewriteProLinks, and rewriteFlattenedOssLinks; extract the
common patterns into a single shared constant (e.g., PRO_DOCS_REPLACEMENTS or
PRO_DOCS_URL_PATTERNS) and reference that constant from each function instead of
repeating the .replace() literals so updates stay synchronized; before applying
the change, confirm with the team per the "ask first" guideline for edits under
scripts/.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 11f49eaf-d043-4081-ada1-f60eb9117452
📒 Files selected for processing (4)
.github/workflows/site-build-deploy.ymlprototypes/docusaurus/src/pages/pro.tsxscripts/audit-docs.mjsscripts/prepare-docs.mjs


Closes #12
Closes #13
Closes #59
Summary
scripts/audit-docs.mjsto support severity levels (error,warn,info)pro.reactonrails.comreferences with the canonical Pro docs destination in both prepared docs output and the site Pro pageVerification
npm run prepare && npm run audit:docs -- --output VALIDATION_REPORT_CI.md --fail-on error && npm run buildErrors: 0on the prepared docs setNote
Medium Risk
Changes the docs validation logic and makes CI fail based on new severity thresholds, which could affect build gating and allow/block deployments if misclassified.
Overview
Adds a docs audit step to the site GitHub Actions workflow that always uploads
VALIDATION_REPORT_CI.mdas an artifact and posts a short counts summary to the job summary, while failing the build only when the audit step reports blocking findings.Reworks
scripts/audit-docs.mjsto produce severity-tagged findings (error/warn/info), ignore fenced code blocks for several checks, tighten the “version floor” scan to React-on-Rails-context mentions, and support--fail-onto control when the audit exits non-zero.Cleans up dead
pro.reactonrails.comreferences by rewriting them to the canonical Pro docs URL duringprepare-docsand updating the Docusaurus Pro page CTA to point at/docs/pro.Reviewed by Cursor Bugbot for commit 7c5bc0c. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Improvements