-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable plugin metadata setting from manifest's initialize block #815
Comments
@manushak @narekhovhannisyan please review AC to see if it all looks good |
builtins
@jmcook1186 there is an inconsistency between the if we want the yaml to look like this:
the data will be:
if we want the type to be an
the There is another version
and in this case, the data will be an
Which version do you prefer? |
@manushak are there any knock on effects on the plugin side? Assuming not, I prefer the middle option where the yaml is consistent with the other elements in the manifest, i.e. yaml like this:
|
@narekhovhannisyan please review the PR in the if-core |
@narekhovhannisyan the PR i |
@narekhovhannisyan please change the version locally to review the pr 🙏 |
Why: Sub of #761
What: Add metadata to all
builtins
and enable metadata overwriting frominitialize
Context
Instead of defining parameters in
params.ts
, we can make use of the metadata field we already expose in our plugin interface and move the parameter definitions into the plugins themselves. The plugin interface should looks as follows:This ticket covers entering each
builtin
in the IF repository and adding the necessary parameter metadata. There should be an object insideoutputs:
for each value output by the plugin, and the same forinputs
.note that these should be optional in the sense that we don't break existing plugins that don't provide plugin metadata here. We will update all our code and our documentation, best practise guides and templates to use this feature, but old plugins should still run - the downstream impact will just be that the
explainer
feature won't work for them.The parameter metadata should be updateable by passing in
inputs
andoutputs
arrays in theinitialize
block in the manifest. If no parameter metadata is passed from the manifest, the plugin should use the default hardcoded into the plugin source code (which may be none).For example, an instance of the Sum plugin might be configured as follows:
In this case, the plugin metadata gets updated with the values in
parameter-metadata
during the initialization. If theparameter-metadata
is missing, then the hardcoded defaults for the plugin are used. The same is true if an individual parameter's metadata is missing - just use the hardcoided default. If there is no hardcoded default, don't error out, just ignore (we'll handle reporting these issues later when we built theexplainer
feature.SoW
Add feature that updates plugin metadata according to the
parameter-metadata
provided in the manifest'sinitialize
block.For builtins that have known inputs/outputs, add them to the hardcoded defaults in the plugin code
Acceptance criteria:
Plugin interface accepts parameter metadata, with arrays for
inputs
andoutputs
The plugin metadata definition in the plugin source code should look roughly as follows:
Plugin metadata is updated using values passed from
parameter-metadata
feature in manifest'sinitialize
blockGIVEN the feature is implemented
WHEN the following metadata is provided in the manifest file
THEN the plugin instance is initialized with the values from the
plugin-metadata
field from itsinitialize
block loaded into itsmetadata
object.parameter-metadata
configGIVEN the feature is implemented
WHEN I run a manifest with the following
initialize
blockOR the
initialize
block loois as follows:THEN: The manifest runs without throwing an error, the plugin's
metadata
object just looks as follows:The text was updated successfully, but these errors were encountered: