Page MenuHomePhabricator

ZObjectSelector: Stop resolver types and disallowed root types from being chosen as type for inputs, outputs and persistend object types
Closed, ResolvedPublicBUG REPORT

Description

Description

Resolver types: those that when evaluated resolve to other objects/types

  • Z2/Persistent object (special case)
  • Z7/Function call
  • Z9/Reference
  • Z18/Argument reference
  • Z22/Evaluation result

Disallowed root types: those that cannot be saved as the root ZObject (value of Z2K2 in a Z2/Persistent object), either because they strongly depend on their context or because they are generated on runtime.

  • Z2/Persistent object
  • Z3/Key
  • Z9/Reference
  • Z17/Argument declaration
  • Z18/Argument reference
  • Z39/Key reference
  • Z5/Error
  • Z16/Code
  • Z21/Unit
  • Z22/Evaluation result

Steps to reproduce:

Observed behavior:

  • All disallowed types except for Z2/Persistent object and Z7/Function call appear in the dropdown and can be selected

Expected behavior (Acceptance criteria):

  • In the ZObject editor, Content type field should not allow creation of any object of a type from the "Disallowed root types" list.
  • In the ZFunction editor, Input and Output type fields should not allow creation of any object of a type from the "Resolver types" list.

Completion checklist

Event Timeline

There is in fact one instance of Z21/Unit, which is Z24/void.

Regarding Z7, I think @Jdforrester-WMF and I have a potential diverging opinion (so I wanted to raise this here). I think it is OK to store a Z7, whereas he thinks we should not.

My argument is that a Z7 can sometimes be clearer to describe a value than a literal, which is why I think that a Z7 is OK.

Z22/Evaluation result should also not be allowed as an input or output type, nor as a root type.

Editing the task to include Z22

Change 861864 had a related patch set uploaded (by AdesojiThisDot; author: AdesojiThisDot):

[mediawiki/extensions/WikiLambda@master] added resolver types and disallowed root types to EXCLUDED_Z_TYPES

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

Change 861864 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] added resolver types and disallowed root types to EXCLUDED_Z_TYPES

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

Checked both acceptance criteria, and works well.