8000 Fix producer external links dropped when a section is missing by rombat · Pull Request #672 · jikan-me/jikan · GitHub
[go: up one dir, main page]

Skip to content

Fix producer external links dropped when a section is missing - #672

Merged
irfan-dahir merged 2 commits into
jikan-me:masterfrom
rombat:fix/producer-external-links
Nov 11, 2026
Merged

irfan-dahir merged 2 commits into
jikan-me:masterfrom
rombat:fix/producer-external-links

Conversation

@rombat
@rombat rombat commented Nov 11, 2026
Copy link
Copy Markdown
Contributor

ProducerParser::getExternalLinks() returned an empty array as soon as either the "Available At" or the "Resources" section was missing from a producer page, dropping the links of the section that was there. A studio with official site links but no "Resources" entry, like OLM (producer 28), got no external links at all. Both early returns are gone: a missing section now just contributes no links.

  • ProducerExternalLinksTest removes one section from the recorded Pierrot page (producer-1-p1) and checks that the other section's links are kept. Both cases fail without the fix
  • CHANGELOG entry under Unreleased

Testing

composer quality:static passes. composer test passes except NewsListItemParserTest::it_gets_the_date, which fails on master too (it expects the recorded news to be less than 30 days old). The commit skips the pre-commit hook for that reason.

getExternalLinks() returned an empty array as soon as either the
"Available At" or the "Resources" section was missing, discarding
the links of the other section.
@rombat
rombat marked this pull request as ready for review November 11, 2026 10:30
@irfan-dahir
irfan-dahir self-requested a review November 11, 2026 11:12
@irfan-dahir irfan-dahir left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified, with the bug reproduced against today's live markup.

Live check (2026-11-11)

  • producer/28 (OLM — the case described): one user-profile-sns div with 3 links, no pb16 div. Old parser returns 0 links; this branch returns the 3 real links (olm.co.jp, olm.co.jp/?lang=en, twitter.com/olmdrd).
  • producer/1 (Pierrot): both sections present, 5 + 6 = 11 links, identical before and after the change — no duplicates, ordering unchanged.

Local verification

  • Red -> green: both new test cases fail on this branch with master's parser and pass with the fix.
  • composer quality:static clean.
  • No fixtures/snapshot change needed: recorded pages carry both sections, so model output is unchanged for them.
  • Test placement matches the 12 other Corpus/ tests that drive a parser straight from Variants::crawler.

CI is red for reasons unrelated to this diff — the time-dependent NewsListItemParserTest::it_gets_the_date (started failing on master today) and the person snapshot tests, which needed jikan#673 (now merged). Nothing here to fix.

Approve. Optional belt-and-braces: a case asserting that with both sections present the result is still 11, so the test pins the unchanged path too.

@irfan-dahir
irfan-dahir merged commit a62ccad into jikan-me:master Nov 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0