fix: fix DM archive doc URL resolution#701
Open
qiancai wants to merge 4 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces specific URL resolution rules and branch alias mappings for the tidb-data-migration repository, ensuring that release branches (e.g., release-2.0) are correctly transformed into versioned URLs (e.g., v2.0). It also includes comprehensive test cases to verify these transformations across different languages and folder structures, including the handling of index files and language prefixes. A review comment suggests adding example mappings to the configuration comments to improve maintainability and consistency with existing patterns in the codebase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the broken URLs of archived data migration docs, such as https://docs-archive.pingcap.com/tidb-data-migration/v5.3/, which were reported in pingcap/docs#22867.
release-*branches to versioned archive paths such as/tidb-data-migration/v5.3/,/tidb-data-migration/v2.0/, and/tidb-data-migration/v1.0/._index.mdpages to avoid future URL collisions.Root cause
DM pages were falling through to the generic fallback rule, which drops the branch segment. As a result,
release-5.3,release-2.0, andrelease-1.0pages were generated under/tidb-data-migration/or/zh/tidb-data-migration/instead of their versioned archive paths.Affected archive links
/tidb-data-migration/v5.3//tidb-data-migration/v2.0//tidb-data-migration/v1.0//zh/tidb-data-migration/v5.3//zh/tidb-data-migration/v2.0//zh/tidb-data-migration/v1.0/Tests
NODE_PATH=/Users/grcai/Documents/GitHub/website-docs/node_modules /Users/grcai/Documents/GitHub/website-docs/node_modules/.bin/jest gatsby/url-resolver/__tests__/url-resolver.test.ts --runInBand/Users/grcai/Documents/GitHub/docs-staging/docs.jsonfor all six affected DM archive index paths and a nested DM index path.