Page MenuHomePhabricator

Orchestrator returning Typed List with fully expanded type as its first element
Closed, ResolvedPublicBUG REPORT

Description

Description

Steps to reproduce (step by step instructions, with links, commands and necessary data to reproduce the error)

  1. Go to the API sandbox, and call wikilambda_function_call with the following zobject:
{
	"Z1K1": "Z7",
	"Z7K1": "Z801",
	"Z801K1": [
		"Z6",
		"abc",
		"def"
	]
}

Observed behavior

  • Z22K1 in the response looks like this:
"Z22K1": [
		{
			"Z1K1": "Z4",
			"Z4K1": "Z6",
			"Z4K2": [
				"Z3",
				{
					"Z1K1": "Z3",
					"Z3K1": "Z6",
					"Z3K2": "Z6K1",
					"Z3K3": {
						"Z1K1": "Z12",
						"Z12K1": [
							"Z11",
							{
								"Z1K1": "Z11",
								"Z11K1": "Z1002",
								"Z11K2": "value"
							}
						]
					}
				}
			],
			"Z4K3": "Z106"
		},
		"abc",
		"def"
	]
  • Note that the first element of the list is not simply "Z6", but a fully expanded definition of Z6.
  • This causes problems when Echo is called in wikilambda_perform_test: unlike wikilambda_function_call, this path validates the response received from the Orchestrator, and throws an exception saying "Key value not wellformed". If the Orchestrator's response is altered to have "Z6" as the first element, no exception is thrown.

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

  • "Z6" as first element.

Completion checklist

Event Timeline

P.S. My assumption here is that it is the Orchestrator that is wrong, rather than the PHP layer being wrong in thinking the response is malformed. Happy to be corrected.

EWright renamed this task from Orchestrator returns malformed response when running "Built-in implementation of Echo" (Z901) on a Typed List to Orchestrator returns possibly malformed response when running "Built-in implementation of Echo" (Z901) on a Typed List.Dec 7 2022, 12:56 PM
EWright updated the task description. (Show Details)
In T324661#8450386, @EWright-WMF wrote:

P.S. My assumption here is that it is the Orchestrator that is wrong, rather than the PHP layer being wrong in thinking the response is malformed. Happy to be corrected.

I think the orchestrator is correct and the PHP is wrong (this is well-formed; types in Benjamin arrays can be calls or inline/dereferenced types, not just references), but we're not meant to be getting them in this case – it should indeed be Z6.

In T324661#8450386, @EWright-WMF wrote:

P.S. My assumption here is that it is the Orchestrator that is wrong, rather than the PHP layer being wrong in thinking the response is malformed. Happy to be corrected.

I think the orchestrator is correct and the PHP is wrong (this is well-formed; types in Benjamin arrays can be calls or inline/dereferenced types, not just references), but we're not meant to be getting them in this case – it should indeed be Z6.

Thanks, James. When you say "we're not meant to be getting them in this case ", you mean that although the Orchestrator is returning a valid response, it should be returning the more concise version? If so, I guess I'll file a separate bug for the PHP layer being too picky, and leave this bug to cover the Orchestrator issue.

In T324661#8451131, @EWright-WMF wrote:
In T324661#8450386, @EWright-WMF wrote:

P.S. My assumption here is that it is the Orchestrator that is wrong, rather than the PHP layer being wrong in thinking the response is malformed. Happy to be corrected.

I think the orchestrator is correct and the PHP is wrong (this is well-formed; types in Benjamin arrays can be calls or inline/dereferenced types, not just references), but we're not meant to be getting them in this case – it should indeed be Z6.

Thanks, James. When you say "we're not meant to be getting them in this case ", you mean that although the Orchestrator is returning a valid response, it should be returning the more concise version? If so, I guess I'll file a separate bug for the PHP layer being too picky, and leave this bug to cover the Orchestrator issue.

Yes, the orchestrator is meant to convert this back to a reference in cases like this (the 'Z6' should be an ephemeral not permanent replacement).

EWright renamed this task from Orchestrator returns possibly malformed response when running "Built-in implementation of Echo" (Z901) on a Typed List to Orchestrator returning Typed List with fully expanded type as its first element.Dec 7 2022, 4:21 PM

Thanks. Filed T324687 for the PHP issue and will tackle that now. Will leave the Orchestrator issue here for later triage.

Jdforrester-WMF raised the priority of this task from Low to Medium.
cmassaro changed the task status from Open to In Progress.Mar 11 2024, 5:16 PM
cmassaro moved this task from Backlog to In Progress on the Abstract Wikipedia team board.

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

[mediawiki/extensions/WikiLambda@master] Update expected Type expansion result

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

Change 1010298 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update expected Type expansion result

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

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

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-03-05-140533 to 2024-04-04-132719

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

Change #1017060 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-03-05-140533 to 2024-04-04-132719

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