Page MenuHomePhabricator

normalize() and canonicalize() Should Return a Z22K2 Error When Input Is Too Bad
Closed, ResolvedPublic

Description

Description

If you try to normalize an object like

{
  Z1K1: 'Z6',
  Z6K1: 13
}

you'll get back

{
  Z1K1: 'Z6',
  Z6K1: {}
}

which is very bad for many reasons. We should guarantee that normalize() and canonicalize() always return valid ZObjects. If this is impossible (e.g., because the input contains a Boolean or integer), these functions should "error out."

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

  • normalize() "errors out" when input contains Booleans or integers
  • canonicalize() "errors out" when input contains Booleans or integers

Completion checklist

Event Timeline

apine opened https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-schemata/-/merge_requests/7

Produce a Z22K2 error when the input to canonicalize() or normalize() is very obviously wrong.

apine closed https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-schemata/-/merge_requests/7

Draft: Produce a Z22K2 error when the input to canonicalize() or normalize() is very obviously wrong.

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

Support degenerate quoted objects in the mixed validator, normalization, and canonicalization.

apine updated https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-orchestrator/-/merge_requests/39

Draft: Update function-schemata sub-module to HEAD (4927eba) (BREAKING - changes some test outputs)

dmartin merged https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-orchestrator/-/merge_requests/39

Update function-schemata sub-module to HEAD (4927eba) (BREAKING - changes some test outputs)

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

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

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

Change 938017 merged by jenkins-bot:

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

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