elyra icon indicating copy to clipboard operation
elyra copied to clipboard

Add support for const types in metadata editor

Open kevin-bates opened this issue 4 years ago • 6 comments

The runtime types PR (#2263) introduces a runtime_type property to each schema within the Runtimes schemaspace. This property denotes the type of runtime to which instances of the schema correspond and uses a const meta-property to hold this value - since the hosting schema is one-to-one with a runtime processor implementation (and, therefore, a type). Here's the schema entry relative to the kfp schema:

       "runtime_type": {
          "title": "Runtime Type",
          "description": "The runtime associated with this instance",
          "type": "string",
          "const": "KUBEFLOW_PIPELINES"
        },

Left unaddressed, this will present a Runtime Type property with an empty edit control. If any value other than the constant value is entered, the validation for that instance will fail. Since runtime_type is not required, the only "working" approach would be to never enter any value (or know the constant value to enter). Because this is a constant, the user should not need to enter a value or update previously persisted constant values.

For const types, the metadata editor should unconditionally set the value of the property to the value stored in the const meta-property treat the property as read-only.

The idea that constant-based values should perhaps be hidden is also applicable here. As a result, it might be good to offer a uihints "style" that denotes a particular property be completely hidden from the end-user.

kevin-bates avatar Nov 03 '21 22:11 kevin-bates

How about introducing a UI property that identifies special attributes, such as 'hidden' (immutable and not rendered) or 'read-only' (immutable)?

ptitzler avatar Nov 03 '21 23:11 ptitzler

I think this makes a lot of sense and is used in other metadata-based systems I've worked on in the past.

kevin-bates avatar Nov 05 '21 20:11 kevin-bates

Based on the conversation above, do we still need this?

lresende avatar Nov 07 '21 20:11 lresende

Yes, the discussion above is essentially regarding the two forms for how we want to display constant-based properties. We should still transfer the value reflected in the const field to the metadata instance. That transfer isn't really necessary if the uihint were to indicate a 'hidden attribute, but is for 'read-only' and 'visible'.

kevin-bates avatar Nov 07 '21 23:11 kevin-bates

See: https://github.com/elyra-ai/elyra/pull/2263#pullrequestreview-803006967

akchinSTC avatar Nov 10 '21 20:11 akchinSTC

@marthacryan - check to see if this has been resolved earlier release

akchinSTC avatar Dec 09 '22 16:12 akchinSTC