DOC-6909 Teach the feed pipeline and version archiver the /content/ link form - #3796
DOC-6909 Teach the feed pipeline and version archiver the /content/ link form#3796andy-stark-redis wants to merge 1 commit into
Conversation
6ab0ad7 to
c87015c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c87015c. Configure here.
| {{- $content := .RawContent -}} | ||
| {{- $visited := .Visited | default (slice) -}} | ||
|
|
||
| {{- /* Drop HTML-comment blocks before anything else looks at the content. |
There was a problem hiding this comment.
HTML comment stripping removed
High Severity
This commit drops the line-anchored HTML-comment strip from process-markdown-content.html, so draft blocks authors park in <!-- --> now flow into the AI Markdown/JSON feed as published body text. toc-from-markdown.html still strips those comments and documents that the two must stay aligned, so TOC and body also diverge.
Reviewed by Cursor Bugbot for commit c87015c. Configure here.
| {{- /* Match non-greedily to the first ">}}": a [^>]* class is defeated by a ">" inside | ||
| an attribute value (e.g. columnNames="...<br/>...") and leaks the raw shortcode. */ -}} | ||
| {{- $content = $content | replaceRE `(?s)\{\{<\s*/?.*?>\}\}` "" -}} | ||
| {{- $content = $content | replaceRE `\{\{<\s*/?[^>]*>\}\}` "" -}} |
There was a problem hiding this comment.
Table-children expansion dropped
High Severity
The call to markdown-table-children.html (and its follow-up unescape) was removed from process-markdown-content.html, even though the partial still exists and documents that without it release-notes index bodies are emptied in the feed. Pages whose only body is a table-children shortcode lose their tables and version metadata columns.
Reviewed by Cursor Bugbot for commit c87015c. Configure here.
c87015c to
7ade771
Compare
7ade771 to
07b7c9f
Compare
07b7c9f to
b99b3a8
Compare
…ink form Prepares the two tools that read relref as a literal string, ahead of any content moving off it. Both changes are inert until content actually uses repo-root-relative links, so this is safe to land on its own. The AI-facing Markdown and JSON output rewrote only relref to absolute redis.io URLs, so a migrated page would ship raw source paths that resolve nowhere. The version archiver had the same blind spot with worse consequences: links in an archived version would keep resolving to the latest page instead of the frozen copy, silently, with no error. Both patterns anchor on a Markdown link destination rather than the bare content prefix, or they would rewrite the github.com blob URLs that legitimately embed the same path segment. The archiver shares one replace_link closure between notations so the release-notes exemption and the already-versioned guard cannot drift apart. Source-relative links need no archiver rewriting: the whole subtree is copied, so a link between two pages inside it already resolves within the version. The accompanying tests pin that, and were confirmed to fail with only the new substitution disabled. Amended after Bugbot found that the first version of this commit silently reverted two DOC-6939 improvements to the same partial. The stack was carved out of the old single PR by checking each file out wholesale from a tag, which replaces the file rather than applying a delta, so any change main had made to it in the meantime was undone: the line-anchored HTML-comment strip, the table-children expansion, and a catch-all shortcode regex that had been tightened from [^>]* to a non-greedy match. Nothing warned, because reverting those produces silently wrong feed output rather than a build error, and the verification build was green. The rules are now inserted into main's current version of the file, so this commit is purely additive. Constraint: carve a branch out of an old state with a delta, never a wholesale file checkout from a tag, or any change main made to that file since the branch point is silently reverted Ticket: DOC-6909 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
b99b3a8 to
522e174
Compare
dwdougherty
left a comment
There was a problem hiding this comment.
LGTM, but this definitely needs @paoloredis's eyes.


Part 2 of 4. Stack: #3795 → #3796 (this) → #3797 → #3798
What this is
Updates the two tools that read
relrefas a literal string, ahead of any content moving off it. This is @paoloredis's review point from #3732, and it turns out not to be a "before we remove relref" concern — it bites per section, at migration time.Both changes are inert until content actually uses repo-root-relative links, so this is safe to land on its own.
process-markdown-content.htmlrelrefto absolute URLsversion_archiver.pyrelrefThe archiver one was found by probe rather than by reasoning, and it's the more expensive: wrong content in a frozen version, discovered late.
Notes for review
](/content/…), not the bare/content/prefix — otherwise they rewrite thegithub.comblob URLs that legitimately embed the same path segment. There's a test pinning this.replace_linkclosure across both notations, so the release-notes exemption and the already-versioned guard can't drift apart.test_source_relative_link_is_left_aloneasserts the resolution, not just that the text is unchanged.build/test_version_archiver.py(8 tests) was confirmed to fail with only the new substitution disabled, so it isn't passing vacuously. Like itsbuild/test_*.pysiblings it isn't wired into CI.Not covered
394
.html.mdfiles still leak pre-existing../relative links into the feed, plus 21 with rooted non-/content/links. That defect predates this work entirely and is out of scope here.Note
Medium Risk
Changes affect archived-version link correctness and AI-facing URLs, but behavior is inert until migrated content uses
/content/links and is backed by targeted archiver tests.Overview
Teaches the docs pipeline and version archiver to handle repo-root-relative Markdown links (
](/content/...) the same way they already handlerelref, ahead of DOC-6909 section migrations.In
process-markdown-content.html, newreplaceRErules rewrite those link destinations tohttps://redis.io/docs/latest/..., including_index.md/index.mdhandling so section URLs match published paths; anchors stay outside the match.In
version_archiver.py, a second pattern anchored on](/content/<prefix>/<product>/...)runs through the existingreplace_linklogic so frozen versions do not keep pointing at latest; release-notes exemption, idempotency, and “don’t touch other products / GitHub blob URLs” behavior stay shared withrelref.Adds
build/test_version_archiver.py(8 cases) covering both notations, anchors, source-relative links left alone, and false-positive guards.Reviewed by Cursor Bugbot for commit 522e174. Bugbot is set up for automated code reviews on this repo. Configure here.