Skip to content

fix DM archive URL resolution#698

Open
qiancai wants to merge 1 commit intopingcap:masterfrom
qiancai:fix-dm-archive-urls
Open

fix DM archive URL resolution#698
qiancai wants to merge 1 commit intopingcap:masterfrom
qiancai:fix-dm-archive-urls

Conversation

@qiancai
Copy link
Copy Markdown
Collaborator

@qiancai qiancai commented May 6, 2026

Summary

Fix the broken URL of archived data migration docs such as https://docs-archive.pingcap.com/tidb-data-migration/v5.3/

  • 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 6, 2026

@qiancai is attempting to deploy a commit to the test-vi Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@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 URL resolution rules and branch alias mappings for the tidb-data-migration repository, along with unit tests to verify language prefix handling and version aliasing (mapping release-* to v*). A review comment suggests adding a specific rule for _index.md files within subfolders to prevent potential URL collisions, ensuring folder structures are preserved in the generated URLs as seen in other repository configurations.

Comment thread gatsby/url-resolver/config.ts
@qiancai qiancai force-pushed the fix-dm-archive-urls branch from b4d12d5 to 7baa094 Compare May 6, 2026 02:49
@qiancai qiancai force-pushed the fix-dm-archive-urls branch from 7baa094 to c0dfed4 Compare May 6, 2026 02:53
@qiancai qiancai marked this pull request as ready for review May 6, 2026 02:55
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