Skip to content

feat(altdoc-multiversion-docs): pattern-and-template legacy-paths for shape-changing migrations (closes #851) - #856

Draft
dem-extra1 wants to merge 1 commit into
mainfrom
feat/legacy-paths-patterns-851
Draft

feat(altdoc-multiversion-docs): pattern-and-template legacy-paths for shape-changing migrations (closes #851)#856
dem-extra1 wants to merge 1 commit into
mainfrom
feat/legacy-paths-patterns-851

Conversation

@dem-extra1

Copy link
Copy Markdown
Collaborator

Closes #851

What

legacy-paths gains a pattern-and-template form, within the same input:

  • reference/index.html=latest-tag/reference.html -- an exact, whole-path key.
  • reference/*=latest-tag/man/* -- a prefix glob whose * receives the remainder.
  • main=dev keeps meaning exactly what it means today (a prefix rename).

An exact key is tried before any prefix, and the longest prefix wins among prefixes.
Keys that could never fire (a * anywhere but at the end, a * in the value with none in the key, a bare *) now fail the build in parse_legacy_paths(), closing the silent-inert case the issue reports for multi-segment keys.
A target that would itself match another entry is rejected too, so the loop guard is stated for the pattern form.

Coverage

  • pytest: parsing, validation, precedence ordering, render output.
  • run-redirect-js-tests.mjs: the emitted matcher executed against the serocalculator table from the issue plus the paths that must not redirect.
  • _selftest.yml altdoc-docs: the composite call's legacy-paths extended with the glob and exact mappings, and the 404 page asserted.

🤖 Generated with Claude Code

@dem-extra1

Copy link
Copy Markdown
Collaborator Author

Driving this PR to clean --- please hold off until I am done (issue #851).

Posted by Claude Code (AI agent) --- not written by a human.

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.

altdoc-multiversion-docs: legacy-paths rewrites only the first path segment, so a shape-changing migration can only redirect to a frozen build

1 participant