Page MenuHomePhabricator

setZMapValue and setMetadataValue Should Mutate Objects In-Place, Not Return New Objects
Closed, ResolvedPublic

Description

Description

Currently, the idiom with these functions is to do something like

theEnvelope = setMetadataValue( theEnvelope, key, value );

The assignment shouldn't be necessary. In most cases, it currently isn't, but we should remove all of these reassignments from code and ensure that objects are always being mutated in-place. For setZMapValue, this will sometimes not be possible, but it should ALWAYS be possible for setMetadataValue.

Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)

  • setMetadataValue no longer needs to return anything
  • setZMapValue maybe doesn't need to return anything? But probably does
  • callers of functions so modified are updated accordingly

Remove all the non-applicable tags from the "Tags" field, leave only the tags of the projects/repositories related to this task


Completion checklist

Event Timeline

jforrester merged https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-schemata/-/merge_requests/121

[BREAKING CHANGE] Make setMetadataValue(s?) and setZMapValue purely in-place operations.

Change #1037796 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (307671a)

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

Change #1037796 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (307671a)

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

Change #1039220 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-05-23-164021 to 2024-06-05-003919

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

Change #1039221 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade evaluators from 2024-05-28-185827 to 2024-05-31-163732

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

Change #1039220 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-05-23-164021 to 2024-06-05-003919

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

Change #1039221 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade evaluators from 2024-05-28-185827 to 2024-05-31-163732

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