Repository navigation
DOC-7155 Preserve existing aliases across RedisVL docs syncs - #4217
Merged
Merged
Conversation
write_to_destination() rmtrees the latest RedisVL tree and format_page() writes fresh frontmatter carrying only the computed /integrate/redisvl/... alias, so every other alias was deleted on each sync. That fought the alias_check workflow (DOC-6951): it re-adds aliases for the pages that moved from user_guide/ to user_guide/how_to_guides/ (#3815, #3856, #3959), and the next sync (#3781 for 0.25.1, #4186 for 0.27.2) deleted the same 20 again. alias_check was right; the old URLs really do 404 without them, so excluding the tree from alias_check was rejected -- it ends the loop by breaking URLs. The sync now collects the aliases of each page the staged tree will overwrite before the rmtree, and merges the missing ones back after the copy, computed alias first, deduplicated, so a re-sync is byte-identical. Pages whose aliases are not a block list are warned about and left alone rather than guessed at. Versioned trees are unchanged (no aliases by design). Verified by replaying #4186's real 0.27.2 output against main's tree: all 44 pages come out with aliases identical to main (64; the raw sync output has 44). A full sync could not run locally (sandbox blocks PyPI), so the first CI sync is the first end-to-end run. Not fixed here: redisvl_docs_sync.yaml does `git checkout -f` onto an existing sync branch, discarding fresh output, so #4186 will never pick up this fix. After merge, close #4186, delete redisvl_docs_sync_0.27.2, and re-dispatch the workflow. Learned: the sync script needs Python 3.11+ (tomllib) plus packaging; /usr/local/bin/python3.12 here has both and pytest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 1cd39e6 |
paoloredis
approved these changes
Oct 6, 2026
Contributor
Author
|
Thanks @paoloredis ! |
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.
Fixes the loop behind the alias deletions in #4186.
What was happening
alias_check(DOC-6951) adds aliases for pages git recorded as moved. It added 20 for the RedisVL pages that moved fromuser_guide/touser_guide/how_to_guides/(Add aliases for pages that moved without one #3959, merged 2026-10-01).build/redisvl_docs_sync.pydeletes the latest RedisVL tree and rewrites each page's frontmatter with only its computed/integrate/redisvl/...alias, so every other alias is dropped. update for redisvl 0.25.1 #3781 (0.25.1) deleted them once, and update for redisvl 0.27.2 #4186 (0.27.2) deletes the same 20 again.alias_checkis correct here, because the old URLs 404 without these aliases. The fix belongs in the sync script.Change
write_to_destination()(latest version only) now reads the aliases of each page it is about to overwrite, before deleting the tree. After the copy, it adds back any that the new page lacks. The computed alias stays first and duplicates are skipped, so running the sync again produces the same file. If a page's aliases aren't a block list, the script warns and leaves them alone rather than guessing. Versioned trees are unchanged.New tests are in
build/test_redisvl_docs_sync.py(pytest build/test_redisvl_docs_sync.py; needs Python 3.11+ andpackaging).Verification
After merge
#4186 won't pick up this fix. When a sync branch already exists,
redisvl_docs_sync.yamlrunsgit checkout -fonto it, which discards the new output. So:redisvl_docs_sync_0.27.2.redisvl_docs_sync. The new 0.27.2 PR shouldn't delete any aliases.The
checkout -fbehavior is a separate issue, and this PR leaves it alone.🤖 Generated with Claude Code
Note
Low Risk
Build-time docs sync and frontmatter parsing only; versioned doc trees are unchanged and failures degrade to warnings without guessing at alias formats.
Overview
Fixes DOC-7155: the RedisVL docs sync was wiping frontmatter aliases that
alias_check(or manual edits) had added when pages moved, becauseformat_pageonly emits the computed/integrate/redisvl/...path.For latest content only,
write_to_destinationnow snapshots block-list aliases on destination pages before the tree is replaced, then merges any missing entries back after the staged copy—computed alias stays first, no duplicates, idempotent re-syncs. Non–block-listaliasesshapes are warned and skipped rather than parsed unsafely.Adds
build/test_redisvl_docs_sync.pywith pytest coverage for survival, ordering, idempotency, new pages, and edge cases.Reviewed by Cursor Bugbot for commit 1cd39e6. Bugbot is set up for automated code reviews on this repo. Configure here.