Page MenuHomePhabricator

Use evaluation for validation
Closed, ResolvedPublic

Description

Every type will come with a function that validates the instances of that type. These functions are functions defined in Wikifunctions. This task is to actually use these functions to validate instances.

Related Objects

StatusSubtypeAssignedTask
OpenNone
ResolvedNone
ResolvedNone
ResolvedNone
OpenNone
StalledNone
Resolvedcmassaro
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
ResolvedNone
Resolvedcmassaro
ResolvedDVrandecic
ResolvedLindsaykwardell
Resolvedarthurlorenzi
ResolvedNone
InvalidNone
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
ResolvedJdforrester-WMF
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
ResolvedNone
ResolvedSimoneThisDot
ResolvedSimoneThisDot
ResolvedSimoneThisDot
Resolvedcmassaro
Resolvedcmassaro
ResolvedNone
ResolvedDVrandecic
Resolvedcmassaro
Resolvedarthurlorenzi

Event Timeline

DVrandecic triaged this task as Medium priority.Apr 7 2021, 5:08 AM

I’m wondering whether it would make sense to think of a Z4K3/validator (function) as a constructor for validated instances of objects of the specified type. In practice, this would add an additional key into validated instances, with its value being the list of Z5/Errors (an empty list in the case of a valid object). For example, the valid positive integer represented by "2" would be the object {"Z1K1": "Z70", "Z70K1": "2", "Z70K2": []}. The unvalidated instance, on the other hand, would be a Z7/Function call to the Z70 validator/constructor function, passing "K1": "2" (and expecting type+value+errors – a validated Z70 instance – in return). This ensures that only the validator/constructor function can provide the Z70K2/errors value.

Change 720023 had a related patch set uploaded (by Lindsay Wardell; author: Lindsay Wardell):

[mediawiki/extensions/WikiLambda@master] Enable validation on function calls

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

Change 720025 had a related patch set uploaded (by Lindsay Wardell; author: Lindsay Wardell):

[mediawiki/services/function-orchestrator@master] Enable validation by default, and defer to input when provided

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

Change 720023 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Enable validation on function calls

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

Change 720025 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Enable validation by default, and defer to input when provided

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