Page MenuHomePhabricator

Make noop script be able replace whole fields with nested subfields
Closed, ResolvedPublic

Description

Currently, noop script requires incoming data to have null/empty value for a field that is being deleted. However, it is a problem for field with massive amount of subfields, such as labels/description fields in Wikidata (see T125500).

We need to be able to tell noop script to replace content of the nested field wholesale, e.g. having data:

labels: { x: hello, y: world }

and incoming data:

labels: { x: bonjour }

it would replace the whole labels field and not just labels.x. Ideally this would be a parameter on labels mapping.

Details

Related Gerrit Patches:
mediawiki/extensions/CirrusSearch : masterAllow setting super_noop_script handlers
search/extra : masterClarify equals handler and make it nullsafe by default

Related Objects

StatusAssignedTask
ResolvedWikidata-bugs
OpenNone
Resolvedaude
ResolvedSmalyshev
Resolvedaude
ResolvedNone
InvalidNone
ResolvedSmalyshev
DuplicateSmalyshev
DeclinedNone
OpenNone
DeclinedNone
ResolvedSmalyshev
DeclinedNone
ResolvedSmalyshev
Resolveddcausse
Resolveddcausse
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
Resolveddcausse

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 20 2017, 5:22 PM
debt triaged this task as Normal priority.Mar 21 2017, 5:13 PM

Change 346172 had a related patch set uploaded (by DCausse):
[search/extra@master] Add pruneMap handler to super_noop_script

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

Change 347380 had a related patch set uploaded (by DCausse):
[mediawiki/extensions/CirrusSearch@master] Allow setting super_noop_script handlers

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

There's no need to add new handlers unfortunately the equals handler needs to be fixed to be nullsafe.
Using it right now without deploying a new version of the plugin will cause NPE during updates.

Change 346172 merged by jenkins-bot:
[search/extra@master] Clarify equals handler and make it nullsafe by default

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

Change 347380 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Allow setting super_noop_script handlers

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

@dcausse, after 347380 is merged, do we need to do some changes in the Wikidata code to actually use proper noop operations?

debt closed this task as Resolved.May 30 2017, 5:27 PM
debt added a subscriber: debt.

Plugin is ready for deployment, this ticket is done.

Restricted Application added a subscriber: PokestarFan. · View Herald TranscriptJul 21 2017, 4:55 PM