Page MenuHomePhabricator

Python executor mixed-form serialization of typed maps and typed pairs
Closed, ResolvedPublicBUG REPORT

Description

Description

The following phpunit test fails:

docker compose exec mediawiki composer phpunit:entrypoint -- extensions/WikiLambda/tests/phpunit/integration/API/ApiFunctionCallTest.php --filter "Invoke a function that maps the element of a typed Map at a given key to a string version of its value"

The orchestrator returns Z24 because during validateReturnType (particularly responseEnvelopeContainsValue) expects normal form, but it's receiving a mixed result from the python evaluator, like this:

"Z22K1": {
    "Z1K1": {  // <<<<<<<<<<<<------------- Mixed form object
        "Z1K1": {
            "Z1K1": "Z9",
            "Z9K1": "Z7"
        },
        "Z7K1": {
            "Z1K1": "Z9",
            "Z9K1": "Z883"
        },
        "Z883K1": "Z6",
        "Z883K2": "Z6"
    },
    "K1": {
        "Z1K1": {
            "Z1K1": {
                "Z1K1": "Z9",
                "Z9K1": "Z7"
            },
            "Z7K1": {
                "Z1K1": "Z9",
                "Z9K1": "Z881"
            },
            "Z881K1": {   // <<<<<<<<<<<<------------- Mixed form object
                "Z1K1": {
                    "Z1K1": "Z9",
                    "Z9K1": "Z7"
                },
                "Z7K1": {
                    "Z1K1": "Z9",
                    "Z9K1": "Z882"
                },
                "Z882K1": "Z6",  
                "Z882K2": "Z6"  
            }
        },
 ...

We need to:

  • either allow responseEnvelopeContainsValue to function with mixed or canonical forms, or
  • make sure that the python executor serializes maps and pairs in normal form

Also, re-enable the phpunit test from WikiLambda.


Completion checklist

Event Timeline

Change 973195 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Disconnect broken test that depends on evaluator fix

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

Change 973195 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Disconnect broken test that depends on evaluator fix

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

Change 974174 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Uncomment FunctionCall tests that receive serialized maps and pairs

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

Jdforrester-WMF moved this task from To Triage to To deploy on the Abstract Wikipedia team board.

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

[operations/deployment-charts@master] wikifunctions: Switch JavaScript evaluator to 2023-11-22-195017

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

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

[operations/deployment-charts@master] wikifunctions: Switch Python evaluator to 2023-11-22-195017

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

Change 976846 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Switch JavaScript evaluator to 2023-11-22-195017

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

Change 976847 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Switch Python evaluator to 2023-11-29-143341

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

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

[operations/deployment-charts@master] wikifunctions: Switch JavaScript evaluator to 2023-11-29-143341

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

Change 978678 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Switch JavaScript evaluator to 2023-11-29-143341

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

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

[operations/deployment-charts@master] wikifunctions: Switch Python evaluator to 2023-11-29-143341 (try 3)

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

Change 978514 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Switch Python evaluator to 2023-11-29-143341 (try 3)

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

Change 974174 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Uncomment FunctionCall tests that receive serialized maps and pairs

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