Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return the old path when next is missing from the url #13078

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

jordojordo
Copy link
Member

@jordojordo jordojordo commented Jan 13, 2025

Summary

Fixes #12542

This PR resolves the issue with old links (e.g., /extensions/extensions-getting-started) not properly redirecting to the latest version (/extensions/next/extensions-getting-started) for versioned extensions documentation.

Occurred changes and/or fixed issues

  • Fixed the createRedirects function to handle unversioned routes (/extensions/...) and redirect them to the latest version (/extensions/next/...).
  • Scoped the redirect logic to only affect unversioned routes (/extensions/...) and not interfere with existing versioned routes such as /extensions/v2/....

Technical notes summary

The createRedirects logic checks for routes under /extensions/next/ and generates redirects for their unversioned counterparts (/extensions/...). This ensures that unversioned links point to the latest version (v3) without impacting v2 or other explicitly versioned routes.

Areas or cases that should be tested

  • Test unversioned links (e.g. /extensions/extensions-getting-started) and confirm they redirect to /extensions/next/extensions-getting-started.
  • Test versioned links (/extensions/v2/extensions-getting-started) and confirm they load directly without being redirected.

Areas which could experience regressions

  • Existing routes under /extensions/v2/... should be verified to ensure they are not unintentionally redirected.

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

Copy link
Member

@aalves08 aalves08 left a comment

Choose a reason for hiding this comment

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

LGTM

@jordojordo jordojordo merged commit 1621fe5 into rancher:master Jan 13, 2025
32 checks passed
@jordojordo jordojordo deleted the docs-redirect branch January 13, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support old links on extensions docs
2 participants