Skip to content

fix(news): publish the deployed logo asset in article JSON-LD - #2275

Open
antoleod wants to merge 1 commit into
Scottcjn:mainfrom
antoleod:fix/news-article-publisher-logo
Open

antoleod wants to merge 1 commit into
Scottcjn:mainfrom
antoleod:fix/news-article-publisher-logo

Conversation

@antoleod

Copy link
Copy Markdown
Contributor

Problem

/news/article/<video_id> publishes JSON-LD whose publisher.logo.url is https://bottube.ai/static/bottube_logo.png (underscore). That asset is not shipped: bottube_static/ contains bottube-logo.png (hyphen). Every news article therefore advertised a publisher logo that 404s, while base.html, watch.html, seo_routes.py, news_routes.py and agent_discovery.py all use the hyphenated path.

The regression meant to catch exactly this could never run: tests/test_rss_logo.py imported generate_rss_feed from news_routes, a function that has never existed in that module, so pytest aborted the module at collection and no assertion executed.

Reproduction (before this change)

$ python -m pytest tests/test_rss_logo.py -q
ERROR tests/test_rss_logo.py
E   ImportError: cannot import name 'generate_rss_feed' from 'news_routes'

$ grep -n bottube_logo.png bottube_templates/news_article.html
39:      "url": "https://bottube.ai/static/bottube_logo.png"

$ ls bottube_static/bottube_logo.png
ls: cannot access 'bottube_static/bottube_logo.png': No such file or directory
$ ls bottube_static/bottube-logo.png
bottube_static/bottube-logo.png

Change

  • bottube_templates/news_article.html: point publisher.logo.url at the shipped bottube-logo.png.
  • tests/test_rss_logo.py: rebuilt so it is collectable and actually guards the class of defect:
    • asserts the deployed asset exists;
    • renders /news/rss through the blueprint and asserts the channel <image><url> resolves to a shipped file;
    • renders news_article.html through the real application (so the page's Jinja filters apply) and asserts the JSON-LD publisher logo resolves to a shipped file;
    • fails if any route module or template emits the undeployed bottube + _logo.png variant.

Verification

$ python -m pytest tests/test_rss_logo.py -q
4 passed

# mutation proof — with the template reverted, the new guards fail:
$ git stash push -- bottube_templates/news_article.html
$ python -m pytest tests/test_rss_logo.py -q
FAILED tests/test_rss_logo.py::test_news_article_publisher_logo_url_resolves
FAILED tests/test_rss_logo.py::test_no_published_source_references_undeployed_logo_variant
2 failed, 2 passed

$ python -m pytest tests/test_rss_logo.py tests/test_news_routes_rss.py tests/test_news_routes_db_path.py tests/test_seo_video_jsonld.py tests/test_seo_audit_hygiene.py tests/test_seo_audit_fix_pack.py -q
18 passed

The single remaining failure in the template/SEO slice, tests/test_verify_template_accessibility.py::test_verify_video_id_input_has_programmatic_label, also fails on a clean main checkout and is untouched here.

🤖 Generated with Codebuff

The news article page's JSON-LD advertised
https://bottube.ai/static/bottube_logo.png, which is not shipped in
bottube_static/ — the deployed asset is bottube-logo.png — so every news
article published a 404 publisher-logo URL while every other surface used
the hyphenated path.

The regression meant to guard this could never run: it imported
generate_rss_feed from news_routes, a function that does not exist, so the
module failed collection and no assertion ever executed. It now renders the
RSS channel and the news article template through the real application,
asserts each published logo URL resolves to a shipped asset, and fails if a
route module or template emits the undeployed variant.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant