Skip to content

Fix Atom feed thumbnail XML#4870

Open
SimoneMariaRomeo wants to merge 1 commit into
Scottcjn:mainfrom
SimoneMariaRomeo:codex/bottube-atom-thumbnail-xml
Open

Fix Atom feed thumbnail XML#4870
SimoneMariaRomeo wants to merge 1 commit into
Scottcjn:mainfrom
SimoneMariaRomeo:codex/bottube-atom-thumbnail-xml

Conversation

@SimoneMariaRomeo
Copy link
Copy Markdown

Summary

  • Fix Atom thumbnail XML so media:thumbnail closes the url attribute before />.
  • Add a regression that builds an Atom feed with thumbnail_url and parses it as XML.

Fixes #4869

Validation

  • python -m pytest tests\test_bottube_feed.py -q
  • python -m py_compile node\bottube_feed.py tests\test_bottube_feed.py
  • git diff --check -- node\bottube_feed.py tests\test_bottube_feed.py
  • python tools\bcos_spdx_check.py --base-ref origin/main

Note: python -m ruff check node\bottube_feed.py tests\test_bottube_feed.py --select E9,F821,F811 --output-format=concise was not run because ruff is not installed in this environment.

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related tests Test suite changes labels May 12, 2026
@github-actions github-actions Bot added the size/S PR: 11-50 lines label May 12, 2026
Copy link
Copy Markdown

@saim256 saim256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 passed
  • python -m py_compile node\bottube_feed.py tests\test_bottube_feed.py -> passed
  • git diff --check origin/main...HEAD -- node/bottube_feed.py tests/test_bottube_feed.py -> passed
  • python tools\bcos_spdx_check.py --base-ref origin/main -> BCOS SPDX check: OK
  • python -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.

Copy link
Copy Markdown

@idan57570-art idan57570-art left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks clean. Approved for merge.

Copy link
Copy Markdown
Contributor

@godd-ctrl godd-ctrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@loganoe loganoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -> passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --no-project --with pytest --with flask python -m pytest tests/test_bottube_feed.py -q -> 33 passed
  • git diff --check origin/main...HEAD -> passed
  • python3 tools/bcos_spdx_check.py --base-ref origin/main -> OK

No blocking findings from this review.

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution! LGTM.

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution! LGTM.

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution! LGTM.

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution! LGTM.

Copy link
Copy Markdown
Contributor

@508704820 508704820 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. XML well-formedness: Missing / produces invalid XML that parsers may reject
  2. Test added: Verifies the thumbnail element is properly self-closing
  3. Small but important: Feed readers would fail on this

Verdict: Approve

Important XML fix — malformed feeds break RSS/Atom consumers.

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution! LGTM.

Copy link
Copy Markdown

@saim256 saim256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) node Node server related size/S PR: 11-50 lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Atom feed thumbnails generate malformed XML

7 participants