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.
| {{- /* 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.
Shortcode strip regex regresses
High Severity
The remaining-shortcode remover changed from a non-greedy match to the first >}} into [^>]*, which stops at a > inside an attribute. Shortcodes such as table-children with <br/> in columnNames are only partially consumed, leaving raw shortcode fragments in the AI feed.
Reviewed by Cursor Bugbot for commit c87015c. Configure here.
c87015c to
7ade771
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. Ticket: DOC-6909 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
7ade771 to
07b7c9f
Compare


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
Touches archived-version link rewriting (silent wrong content if mis-matched) and AI feed Markdown generation; the extra removals in
process-markdown-content.htmlcould regress feed output for commented or table-children content.Overview
Teaches the version archiver and AI-facing Markdown pipeline to handle repo-root-relative links (
](/content/...) the same way they already handlerelref, ahead of content migrations offrelref.In
version_archiver.py, a second regex anchored on Markdown link destinations rewrites intra-product/content/<prefix>/<product>/…paths to include the frozen version, reusing the existingreplace_linklogic (release-notes skip, idempotency, other products untouched).build/test_version_archiver.pyadds eight isolated tests for relref vs plain links, anchors, source-relative paths, exemptions, and GitHub URL safety.In
process-markdown-content.html, threereplaceRErules turn those/content/…destinations intohttps://redis.io/docs/latest/…URLs (including_index.md/index.mdhandling) so JSON/Markdown feeds do not emit raw source paths.The same partial diff also removes line-anchored HTML-comment stripping, the
markdown-table-childrenexpansion pass, and tightens the catch-all shortcode-removal regex—changes not called out in the PR description but present in the diff.Reviewed by Cursor Bugbot for commit 07b7c9f. Bugbot is set up for automated code reviews on this repo. Configure here.