Skip to content

fix: set explicit non-permanent redirects#2238

Merged
novusnota merged 1 commit into
mainfrom
novusnota/hotfix
Jun 27, 2026
Merged

fix: set explicit non-permanent redirects#2238
novusnota merged 1 commit into
mainfrom
novusnota/hotfix

Conversation

@novusnota

@novusnota novusnota commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Updated several onboarding redirects to explicitly define their redirect type, ensuring consistent navigation behavior.
    • Added validation to catch redirects missing a required redirect type so configuration issues are flagged earlier.

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 27, 2026 9:43am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Four onboarding redirects now explicitly set permanent: false, and the redirect-check script now fails when any redirect omits or misstates the permanent boolean.

Changes

Redirect permanence enforcement

Layer / File(s) Summary
Redirect entries declare permanence
docs.json
The four onboarding redirect objects now include explicit permanent: false fields.
Redirect checker validates permanent flags
scripts/check-redirects.mjs
checkUnique now flags redirects with missing or non-boolean permanent values and adds the offending sources to the error output.

🎯 2 (Simple) | ⏱️ ~10 minutes

  • ton-org/docs#2089: Related redirect work that also uses permanent redirect entries in docs.json.

Suggested reviewers

  • aigerimu

I hopped through the redirect patch,
with false flags set in a neat batch.
No wandering hops,
no missing field flops —
just tidy paths for the docs to dispatch. 🐇

🚥 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 clearly matches the main change: making redirects explicitly non-permanent.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch novusnota/hotfix

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.

Comment thread scripts/check-redirects.mjs Dismissed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
scripts/check-redirects.mjs (1)

95-104: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Sync the shared redirect typedef with this new invariant.

scripts/common.mjs:391-407 still documents permanent as optional, but this checker now rejects any redirect without a boolean permanent. Tightening that JSDoc to permanent: boolean will keep the shared contract aligned with the runtime rule.

Suggested follow-up
 /**
  * Get redirect objects from the docs.json configuration.
  *
  * `@typedef` {{
  *   source: string;
  *   destination: string;
- *   permanent?: boolean | undefined
+ *   permanent: boolean
  * }} Redirect
  * `@param` config {DocsConfig}
  * `@returns` {Redirect[]}
  */
🤖 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 `@scripts/check-redirects.mjs` around lines 95 - 104, The redirect contract is
now stricter than the shared typedef: `check-redirects.mjs` rejects any redirect
whose `permanent` is missing or non-boolean, but `scripts/common.mjs` still
documents it as optional. Update the shared redirect JSDoc/type for the redirect
object (the `permanent` field in the common redirect schema) to require
`boolean` instead of optional, so it matches the validation enforced by
`composeErrorList` in `check-redirects.mjs`.
🤖 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.

Nitpick comments:
In `@scripts/check-redirects.mjs`:
- Around line 95-104: The redirect contract is now stricter than the shared
typedef: `check-redirects.mjs` rejects any redirect whose `permanent` is missing
or non-boolean, but `scripts/common.mjs` still documents it as optional. Update
the shared redirect JSDoc/type for the redirect object (the `permanent` field in
the common redirect schema) to require `boolean` instead of optional, so it
matches the validation enforced by `composeErrorList` in `check-redirects.mjs`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5186ec5a-8765-434c-89d4-80aae80a475e

📥 Commits

Reviewing files that changed from the base of the PR and between 8d4bc61 and e61b0d5.

📒 Files selected for processing (2)
  • docs.json
  • scripts/check-redirects.mjs

@novusnota novusnota merged commit 565a1c2 into main Jun 27, 2026
19 checks passed
@novusnota novusnota deleted the novusnota/hotfix branch June 27, 2026 09:44
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.

2 participants