Fix Atom feed thumbnail XML#4870
Conversation
saim256
left a comment
There was a problem hiding this comment.
Approved current head 84429ad.
This is a narrow and correct XML fix for #4869. AtomFeedBuilder now closes the media:thumbnail url attribute before the self-closing tag marker, so entries with thumbnail_url produce parseable Atom XML instead of an unterminated attribute. The added regression builds an Atom feed with a thumbnail, checks the exact media:thumbnail output, and parses the full feed with xml.etree.ElementTree.
Validation performed locally:
python -m pytest tests\test_bottube_feed.py -q-> 33 passedpython -m py_compile node\bottube_feed.py tests\test_bottube_feed.py-> passedgit diff --check origin/main...HEAD -- node/bottube_feed.py tests/test_bottube_feed.py-> passedpython tools\bcos_spdx_check.py --base-ref origin/main-> BCOS SPDX check: OKpython -m ruff check node\bottube_feed.py tests\test_bottube_feed.py --select E9,F821,F811 --output-format=concise-> All checks passed
No blocking issues found.
idan57570-art
left a comment
There was a problem hiding this comment.
Code looks clean. Approved for merge.
godd-ctrl
left a comment
There was a problem hiding this comment.
Approved current head 84429ad.
The Atom feed media thumbnail element now closes the url attribute before the self-closing marker, matching the RSS-side thumbnail form and producing parseable XML. The added regression builds an Atom feed with thumbnail_url, asserts the exact thumbnail element, and parses the result with ElementTree.
Validation performed:
- git diff --name-status origin/main...HEAD -> node/bottube_feed.py, tests/test_bottube_feed.py
- git diff --check origin/main...HEAD -> passed
- python tools\bcos_spdx_check.py --base-ref origin/main -> passed
- python -m py_compile node\bottube_feed.py tests\test_bottube_feed.py -> passed
- python -m pytest tests\test_bottube_feed.py -q -> 33 passed
No blocking issues found in the reviewed diff.
loganoe
left a comment
There was a problem hiding this comment.
Review for Scottcjn/rustchain-bounties#73. Approved current head 84429ad91bad33a0580784c43db8ca15d265d4d7.
This is a focused XML well-formedness fix. The old <media:thumbnail> line omitted the closing quote before />; the patch closes the attribute correctly and adds a regression that parses the generated Atom document with xml.etree.ElementTree. The test exercises the media namespace path because AtomFeedBuilder.build() includes the namespace declarations used by the parser.
Validation performed:
python3 -m py_compile node/bottube_feed.py tests/test_bottube_feed.py-> passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --no-project --with pytest --with flask python -m pytest tests/test_bottube_feed.py -q-> 33 passedgit diff --check origin/main...HEAD-> passedpython3 tools/bcos_spdx_check.py --base-ref origin/main-> OK
No blocking findings from this review.
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
508704820
left a comment
There was a problem hiding this comment.
Code Review: Fix Atom Feed Thumbnail XML
Summary
Fixes malformed XML in the Atom feed: thumbnail tag was missing the closing / before >, producing <media:thumbnail url="..."/> (self-closing) instead of <media:thumbnail url=".../> (malformed).
What Works Well
- XML well-formedness: Missing
/produces invalid XML that parsers may reject - Test added: Verifies the thumbnail element is properly self-closing
- Small but important: Feed readers would fail on this
Verdict: Approve
Important XML fix — malformed feeds break RSS/Atom consumers.
jaxint
left a comment
There was a problem hiding this comment.
Great contribution! LGTM.
saim256
left a comment
There was a problem hiding this comment.
Approved after focused validation. The malformed media thumbnail tag now closes the quoted url attribute before the self-closing slash, and the new regression test exercises both the exact serialized thumbnail element and full XML parsing via ElementTree.\n\nChecks run locally on the PR branch:\n- python -m pytest tests/test_bottube_feed.py -q -> 33 passed\n- python -m py_compile node/bottube_feed.py tests/test_bottube_feed.py -> passed\n- git diff --check origin/main...HEAD -- node/bottube_feed.py tests/test_bottube_feed.py -> passed\n- python tools\bcos_spdx_check.py --base-ref origin/main -> BCOS SPDX check: OK
Summary
media:thumbnailcloses theurlattribute before/>.thumbnail_urland parses it as XML.Fixes #4869
Validation
python -m pytest tests\test_bottube_feed.py -qpython -m py_compile node\bottube_feed.py tests\test_bottube_feed.pygit diff --check -- node\bottube_feed.py tests\test_bottube_feed.pypython tools\bcos_spdx_check.py --base-ref origin/mainNote:
python -m ruff check node\bottube_feed.py tests\test_bottube_feed.py --select E9,F821,F811 --output-format=concisewas not run becauseruffis not installed in this environment.