Skip to content

Conversation

@joalves
Copy link
Collaborator

@joalves joalves commented Jan 26, 2026

Summary

  • Consolidate server redirects using Netlify splat patterns (~75 rules vs 169 individual rules)
  • Make anchor redirects case-insensitive to avoid duplication
  • Add anchor redirects for pages with changed section headings
  • Remove case-only redirects that could cause infinite loops
  • Update test script with comprehensive redirect tests

Test plan

  • Run node test-all-urls.js <deploy-preview-url> to verify all redirects work
  • Manually test sample redirects in browser

Summary by CodeRabbit

  • Bug Fixes

    • Expanded and normalised anchor and path redirects so many legacy documentation and API URLs now resolve correctly and case‑insensitively.
  • Improvements

    • Consolidated redirect rules using broader wildcard/splat patterns and unified lowercase matching to simplify and standardise redirect behaviour.
  • Tests

    • Broadened and throttled redirect and page tests to validate many more variants, follow final destinations, and report detailed outcomes.
  • Documentation

    • Removed multiple SDK/API reference pages from the docs site.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 2026

Walkthrough

The PR expands anchor redirect mappings (stored in ANCHOR_REDIRECTS), normalises path matching to lowercase, and adjusts redirect construction for relative anchor targets. It replaces many explicit static/_redirects entries with splat-based redirect rules. test-all-urls.js was extended with many more redirect cases, added throttling, case-insensitive final-URL checks, and richer logging. Several SDK-API MDX documentation pages and a sidebar export were removed.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇 I hopped the links from old to new,

Lowercased paths and followed through,
I paused my paws so tests could breathe,
Splat rules stitch paths that used to leave,
A little rabbit cheers each redirect true.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: improving redirects through splat patterns and case-insensitive matching, which aligns with the primary objectives of consolidating server redirects and making anchor redirects case-insensitive.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@netlify
Copy link

netlify bot commented Jan 26, 2026

Deploy Preview for absmartly-docs ready!

Name Link
🔨 Latest commit 460d8a2
🔍 Latest deploy log https://app.netlify.com/projects/absmartly-docs/deploys/6979069efc8c260008b69ae9
😎 Deploy Preview https://deploy-preview-246--absmartly-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…hing

- Consolidate server redirects using Netlify splat patterns (~75 rules vs 169)
- Make anchor redirects case-insensitive to avoid duplication
- Add anchor redirects for pages with changed section headings
- Remove case-only redirects that could cause infinite loops
- Update test script with comprehensive redirect tests
@joalves joalves force-pushed the new-kb-rebased-from-dev branch from 41574d6 to 4a5c824 Compare January 26, 2026 15:30
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test-all-urls.js (1)

22-40: Align throttling docs with the configured delay.
The header says 200ms but THROTTLE_MS is 25ms. Please align the comment or the constant to avoid confusion when tuning rate limits.

📝 Example fix (if 25ms is intended)
- * 5. Throttles requests (200ms delay) to avoid rate limiting
+ * 5. Throttles requests (25ms delay) to avoid rate limiting
🤖 Fix all issues with AI agents
In `@static/_redirects`:
- Around line 9-13: The splat redirect rules for `/docs/SDK-Documentation/*` and
`/docs/sdk-documentation/*` don't catch the bare base paths without trailing
slashes; add explicit redirect lines for `/docs/SDK-Documentation` ->
`/docs/APIs-and-SDKs/SDK-Documentation 302` and `/docs/sdk-documentation` ->
`/docs/APIs-and-SDKs/SDK-Documentation 302` (and also add explicit
`/docs/SDK-Documentation/Advanced` ->
`/docs/APIs-and-SDKs/SDK-Documentation/Advanced 302` and
`/docs/sdk-documentation/advanced` ->
`/docs/APIs-and-SDKs/SDK-Documentation/Advanced 302` if you want the Advanced
base paths covered) so the base paths are redirected in addition to the existing
splat rules.
🧹 Nitpick comments (1)
test-all-urls.js (1)

498-525: Treat non‑2xx final responses as redirect failures.
At the moment, a redirect that lands on a 404 can still pass if the final path matches. Folding the final status into match avoids false positives, especially when running with --only-failed.

✅ Proposed adjustment
-    const finalUrl = page.url();
-    const finalPath = finalUrl.replace(BASE_URL, '');
+    const finalUrl = page.url();
+    const finalPath = finalUrl.replace(BASE_URL, '');
+    const statusCode = response.status();
+    const ok = statusCode >= 200 && statusCode < 300;

-    // Case-insensitive comparison (Netlify may lowercase URLs)
-    const match = normalizedFinal === normalizedExpected;
+    // Case-insensitive comparison (Netlify may lowercase URLs)
+    const match = ok && normalizedFinal === normalizedExpected;

     return {
-      success: true,
+      success: ok,
       match,
       fromPath,
       expectedPath: expectedToPath,
       finalPath,
-      statusCode: response.status()
+      statusCode
     };

The files were incorrectly copied instead of renamed during a previous
merge. Removing the old docs/SDK-API/ directory so redirects work properly.
Files already exist in docs/APIs-and-SDKs/SDK-API/.
Splat patterns (/*) don't match bare paths without trailing slash.
Added explicit redirects for:
- /docs/SDK-Documentation and /docs/SDK-Documentation/Advanced
- /docs/sdk-documentation and /docs/sdk-documentation/advanced
- /docs/Examples and /docs/examples
- /docs/API, /docs/sdk-api, /docs/SDK-API
- /docs/web-console-api and /docs/Web-Console-API
@joalves joalves merged commit 7fc4082 into development Jan 27, 2026
6 checks passed
@joalves joalves deleted the new-kb-rebased-from-dev branch January 27, 2026 19:03
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