Page MenuHomePhabricator

Extract ability to parse WBCS License Mappings into a share-able location
Closed, ResolvedPublic

Description

I'm not sure if this is the appropriate place to file this task, feel free to move to a more appropriate location if not.

WikibaseCirrusSearch currently includes some code to parse a MediaWiki interface page on commons which is used to map statements with different license types. This data is fed into haslicense feature used in Commons MediaSearch.

I'd like to be able to use this logic in WikibaseMediaInfo, as part of the work I'm doing on https://phabricator.wikimedia.org/T273166. I'd like to reference the same on-wiki interface page to populate some UI elements rather than just hard-coding the data on my end, but I'd also prefer to avoid duplicating this code if possible. However, since it is embedded in a larger WBCS hooks method, I don't see an easy way to re-use it.

Would there be any way to extract this code into a location where another extension could re-use it (perhaps similar to the "Util" namespace that Cirrus has) without otherwise disrupting things here? I am not very familiar with WBCS so I figured I should ask here before just opening a patch.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 666706 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseCirrusSearch@master] Move license map parsing logic into standalone function

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

Change 666706 merged by jenkins-bot:
[mediawiki/extensions/WikibaseCirrusSearch@master] Move license map parsing logic into standalone function

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

Etonkovidova subscribed.

Checked commons wmf.35 - no regression issues.