Skip to content

DOC-7155 Preserve existing aliases across RedisVL docs syncs - #4217

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7155
Oct 6, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7155

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the loop behind the alias deletions in #4186.

What was happening

alias_check is 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+ and packaging).

Verification

  • 9/9 tests pass.
  • I replayed update for redisvl 0.27.2 #4186's actual 0.27.2 output against main's tree with the new collect and restore steps. All 44 pages came out with aliases identical to main (64 in total), compared with 44 in the raw sync output.
  • I couldn't run a full sync locally, so the first CI sync after merge is the first end-to-end run.

After merge

#4186 won't pick up this fix. When a sync branch already exists, redisvl_docs_sync.yaml runs git checkout -f onto it, which discards the new output. So:

  1. Close update for redisvl 0.27.2 #4186 and delete redisvl_docs_sync_0.27.2.
  2. Re-run redisvl_docs_sync. The new 0.27.2 PR shouldn't delete any aliases.

The checkout -f behavior 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, because format_page only emits the computed /integrate/redisvl/... path.

For latest content only, write_to_destination now 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-list aliases shapes are warned and skipped rather than parsed unsafely.

Adds build/test_redisvl_docs_sync.py with 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.

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>
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7155

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 1cd39e6

@andy-stark-redis andy-stark-redis self-assigned this Oct 6, 2026
@andy-stark-redis andy-stark-redis added bug Something isn't working infrastructure labels Oct 6, 2026
@andy-stark-redis

Copy link
Copy Markdown
Contributor Author

Thanks @paoloredis !

@andy-stark-redis
andy-stark-redis merged commit 0b931fb into main Oct 6, 2026
99 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7155 branch October 6, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants