Page MenuHomePhabricator

Error when calling the wikidata API with no titles
Closed, ResolvedPublic1 Estimated Story Points

Description

The wikidata API is used to retrieve entity information about a list of titles for a given language. There is logic in place to deduplicating the titles. When there is no titles left, it still tries to call the API, which results in an error, log spam and useless processing.

Example: https://logstash.wikimedia.org/app/discover#/doc/0001c630-87fc-11f0-a6ef-d336524cfa1c/ecs-ml-1-1.11.0-7-2025.44?id=eFZYO5oBlLUf3R62I6oh


Test Case 1: Verify Logs Do Not Contain Errors for Empty Title Lists

  1. Trigger multiple calls with empty title lists after deduplication.
  2. Monitor logs (e.g., Logstash) for entries related to the Wikidata API requests.
  3. ✅❓❌⬜ AC1: Confirm no error logs or spam are generated for empty lists.

QA Results - Logstash

ACStatusDetails
1T408936#11375211

Event Timeline

SBisson triaged this task as Medium priority.
SBisson added a project: LPL Hypothesis.

Change #1200399 had a related patch set uploaded (by Sbisson; author: Sbisson):

[research/recommendation-api@master] Skip wikidata API call when no titles left

https://gerrit.wikimedia.org/r/1200399

Change #1200399 merged by jenkins-bot:

[research/recommendation-api@master] Skip wikidata API call when no titles left

https://gerrit.wikimedia.org/r/1200399

Change #1202376 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-05-230545-production

https://gerrit.wikimedia.org/r/1202376

Change #1202376 merged by jenkins-bot:

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-05-230545-production

https://gerrit.wikimedia.org/r/1202376

Change #1203450 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-07-162011-production

https://gerrit.wikimedia.org/r/1203450

Change #1203450 merged by jenkins-bot:

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-07-162011-production

https://gerrit.wikimedia.org/r/1203450

Mentioned in SAL (#wikimedia-operations) [2025-11-10T14:31:12Z] <kart_> Update Recommnedation API to 2025-11-07-162011-production (T405000, T406854, T408936, T408937, T408934)

@SBisson No errors post update as seen in Logstash screenshot below. I will move this to Sign-off. Thanks for all your work!

Test Result - LogStash

Status: ✅ PASS
Environment: LogStash
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Logs Do Not Contain Errors for Empty Title Lists

  1. Trigger multiple calls with empty title lists after deduplication.
  2. Monitor logs (e.g., Logstash) for entries related to the Wikidata API requests.
  3. AC1: Confirm no error logs or spam are generated for empty lists.

2025-11-12_11-32-17.png (954×1 px, 857 KB)

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.

no design review needed for this task so moving it to product signoff.

Nikerabbit set the point value for this task to 1.