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.

Related Objects

StatusSubtypeAssignedTask
ResolvedWikidata-bugs
OpenNone
Resolvedaude
ResolvedSmalyshev
Resolvedaude
ResolvedNone
InvalidNone
ResolvedSmalyshev
DuplicateSmalyshev
DeclinedNone
OpenNone
DeclinedNone
ResolvedSmalyshev
DeclinedNone
ResolvedSmalyshev
Resolved dcausse
Resolved dcausse
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
ResolvedSmalyshev
Resolved dcausse

Event Timeline

debt triaged this task as Medium 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 added a subscriber: debt.

Plugin is ready for deployment, this ticket is done.