Page MenuHomePhabricator

Composition creating a type doesn't evaluate
Closed, ResolvedPublic

Description

I have a function "Create static type" that takes a string and returns a type.

I created the following implementation:

{
    "Z1K1": "Z2",
    "Z2K1": "Z10122",
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z10121",
        "Z14K2": {
            "Z1K1": "Z4",
            "Z4K1": {
                "Z1K1": "Z7",
                "Z7K1": "Z10121",
                "Z10121K1": ""
            },
            "Z4K2": [
                {
                    "Z1K1": "Z3",
                    "Z3K1": "Z6",
                    "Z3K2": "K1",
                    "Z3K3": {
                        "Z1K1": "Z12",
                        "Z12K1": []
                    }
                }
            ],
            "Z4K3": "Z101"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Create static type composition"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": []
            }
        ]
    }
}

But evaluating that results in a wrong content type on the implementation, and a guzzler error on the function definition.

Implementation:

impl.png (1×700 px, 107 KB)

Definition:

def.png (760×824 px, 85 KB)

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
StalledNone
Resolvedcmassaro
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
Resolvedcmassaro
OpenNone
ResolvedJdforrester-WMF
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedNone
ResolvedNone
Resolvedcmassaro
Resolvedcmassaro
ResolvedNone
Resolvedgengh
Resolvedgengh
DeclinedLindsaykwardell
ResolvedLindsaykwardell
Resolvedcmassaro
Resolvedcmassaro
ResolvedNone
ResolvedNone
Resolvedcmassaro
ResolvedNone
InvalidNone
Invalidgengh
ResolvedNone
ResolvedNone
ResolvedJdforrester-WMF
ResolvedNone
ResolvedNone
DeclinedNone
ResolvedSimoneThisDot
ResolvedSimoneThisDot
Resolvedcmassaro
ResolvedSimoneThisDot
Resolvedcmassaro
ResolvedBUG REPORTJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedSimoneThisDot
ResolvedJdforrester-WMF
ResolvedDVrandecic
ResolvedNone
ResolvedNone
Resolvedcmassaro
ResolvedDVrandecic
ResolvedLindsaykwardell
Resolvedarthurlorenzi
ResolvedNone
InvalidNone
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
ResolvedJdforrester-WMF
Resolvedcmassaro
Resolvedcmassaro
Resolvedcmassaro
ResolvedNone
ResolvedSimoneThisDot
ResolvedSimoneThisDot
ResolvedSimoneThisDot
ResolvedJdforrester-WMF
Resolvedcmassaro
Resolvedgengh
Resolvedcmassaro
ResolvedJdforrester-WMF
Resolvedcmassaro
Resolvedcmassaro
ResolvedNone
ResolvedDVrandecic
Resolvedcmassaro
Resolvedarthurlorenzi
ResolvedAdesojiThisDot

Event Timeline

For Denny to verify whether this is still true.

DVrandecic triaged this task as Medium priority.Oct 6 2021, 4:38 PM

Locally, I am now receiving a Internal Server Error (which is different than in the description) when calling the Function definition, and a Z539/"wrong content type" on the implementation (which is unchanged from what is said in the description)

I tried to rebuild it. So one problem is that I actually cannot replace the Z7 on the Z14K2, but I found a workaround by simply using the Z801/Echo function which then allows me to use any content.

(Sidenote: I managed to enter the following through the UI, and I clicked on Save, the saving happened, but didn't change my window somehow. But I guess this is a red herring)

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10157"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z10121",
        "Z14K2": {
            "Z1K1": "Z7",
            "Z7K1": "Z801",
            "Z801K1": {
                "Z1K1": "Z4",
                "Z4K1": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z10121",
                    "Z10121K1": ""
                },
                "Z4K2": [
                    {
                        "Z1K1": "Z3",
                        "Z3K1": "Z6",
                        "Z3K2": "K1",
                        "Z3K3": {
                            "Z1K1": "Z12",
                            "Z12K1": []
                        }
                    }
                ],
                "Z4K3": "Z101"
            }
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Echo implementation of create a static type composition"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": []
            }
        ]
    }
}

Now that should be the same as before. And indeed, I get the same error back, Z539:

{
    "Z1K1": "Z22",
    "Z22K1": "Z23",
    "Z22K2": {
        "Z1K1": "Z5",
        "Z5K1": {
            "Z1K1": "Z539",
            "Z539K1": "The provided object is not a function call"
        }
    }
}

Instead it should return

{
  "Z1K1": "Z4",
  "Z4K1": {
    "Z1K1": "Z7",
    "Z7K1": "Z10121",
    "Z10121K1": ""
  },
  "Z4K2": [
    {
      "Z1K1": "Z3",
      "Z3K1": "Z6",
      "Z3K2": "K1",
      "Z3K3": {
        "Z1K1": "Z12",
        "Z12K1": []
      }
    }
  ],
  "Z4K3": "Z101"
}

Hey! So, I am trying to debug this. I see one issue with composition implementations in the orchestrator that I might need to change, but I also need a bit more info.

First, the error you're getting is because of this line:

"Z3K2": "K1",

which should be

"Z3K2": {
    "Z1K1": "Z6",
    "Z6K1": "K1"
}

We need to change the normal-form validators to accept "K1" as a Z6, of course.

Otherwise, can you provide me with 1) the exact ZObject you are sending to the orchestrator and 2) any objects you've created locally on the wiki? For example, I don't know what "Z10121" is supposed to be (and if it's the function wrapping this implementation, the execution will recurse infinitely).

I suspect that we may actually need to wrap the result of this composition in a Z99, then use Z899 to dereference it for later use.

DVrandecic raised the priority of this task from Medium to High.Dec 8 2021, 11:34 PM

Change 751790 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-orchestrator@master] Allow compositions to return static types.

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

Change 751790 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Allow compositions to return static types.

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

I tried to get this to work, but couldn't. Cory, you'd need to show me how.