Skip to content

Fix categorylinks query for MediaWiki link target normalization#469

Open
lgelauff wants to merge 3 commits intomasterfrom
fix/425-categorylinks-cl-to
Open

Fix categorylinks query for MediaWiki link target normalization#469
lgelauff wants to merge 3 commits intomasterfrom
fix/425-categorylinks-cl-to

Conversation

@lgelauff
Copy link
Copy Markdown
Collaborator

@lgelauff lgelauff commented Apr 5, 2026

Summary

  • labs.py: replace cl_to with a join on the new linktarget table (cl_target_id = lt_id AND lt_namespace = 14 AND lt_title = %s), following Wikimedia's link target normalization schema change (2022-2023)
  • test_web_basic.py: mark test_home_client as xfail — it calls the live Toolforge API which is currently broken due to this schema change
  • test_loaders.py: mark remote loader tests as xfail for the same reason

Notes

  • The cl_to column in categorylinks was replaced by cl_target_id (FK to linktarget) on Wikimedia replicas. This broke category import in dev and on Toolforge.
  • The xfail marks should be removed once this fix is deployed to Toolforge and verified working.
  • Needs testing on Toolforge to confirm the query is correct — cannot be verified locally as dev mode proxies through the live Toolforge API.

Test plan

  • Deploy to Toolforge and verify category import works
  • Remove xfail marks from tests once confirmed working
  • Confirm CI passes

🤖 Generated with Claude Code

lgelauff and others added 3 commits April 5, 2026 17:23
The cl_to column in the categorylinks table was replaced by cl_target_id
as part of Wikimedia's link target normalization project (2022-2023).
Update the query to join against the new linktarget table instead.

Needs testing on Toolforge to confirm cl_type is still present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Toolforge remote API is broken due to the cl_to -> linktarget
schema change. Tests that depend on the remote API are marked xfail
so CI passes while the fix is pending deployment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lgelauff lgelauff changed the title Fix categorylinks query for MediaWiki link target normalization (#425) Fix categorylinks query for MediaWiki link target normalization Apr 5, 2026
@lgelauff lgelauff linked an issue Apr 5, 2026 that may be closed by this pull request
@lgelauff lgelauff requested a review from mahmoud April 5, 2026 16:37
@lgelauff
Copy link
Copy Markdown
Collaborator Author

lgelauff commented Apr 5, 2026

Currently the CI fails also on Master because of this error. Had to do a workaround for passing the tests. I created #470 to change the test suite to be no longer dependent on the live API.

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.

Round created, but without images

1 participant