Skip to content

fix: fix DM archive doc URL resolution#701

Open
qiancai wants to merge 4 commits into
masterfrom
fix-dm-archive-doc-urls
Open

fix: fix DM archive doc URL resolution#701
qiancai wants to merge 4 commits into
masterfrom
fix-dm-archive-doc-urls

Conversation

@qiancai
Copy link
Copy Markdown
Collaborator

@qiancai qiancai commented May 13, 2026

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.

  • Add a dedicated URL resolver rule for TiDB Data Migration release branches.
  • Map DM release-* branches to versioned archive paths such as /tidb-data-migration/v5.3/, /tidb-data-migration/v2.0/, and /tidb-data-migration/v1.0/.
  • Preserve folder paths for DM subfolder _index.md pages to avoid future URL collisions.
  • Add resolver tests for English and Chinese DM v5.3, v2.0, and v1.0 archive index paths, plus representative DM page and nested index paths.

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, and release-1.0 pages 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
  • Resolver smoke test using local /Users/grcai/Documents/GitHub/docs-staging/docs.json for all six affected DM archive index paths and a nested DM index path.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

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

Project Deployment Actions Updated (UTC)
website-docs Error Error May 14, 2026 1:58am

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread gatsby/url-resolver/config.ts
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.

1 participant