feature: pipeline run parameters - dynamic choices (HEXA-1620)#1780
Conversation
Re-add docker-compose.override.yaml to .gitignore
Conflicts: frontend/public/locales/en/messages.json frontend/public/locales/fr/messages.json
|
|
||
| docker-compose.debug.yaml | ||
| docker-compose.dev.yaml | ||
| docker-compose.override.yaml |
There was a problem hiding this comment.
Using this file to run my local openhexa-sdk-python and test the changes in it:
docker-compose.override.yaml:
services:
app:
volumes:
- ../openhexa-sdk-python:/openhexa-sdk-python
entrypoint: ["/bin/bash", "-c", "pip install --user -q -e /openhexa-sdk-python && exec /code/docker-entrypoint.sh \"$@\"", "--"]
yolanfery
left a comment
There was a problem hiding this comment.
Solid ! Good to see lot of tests also
No major concern, just some code quality topics and questions.
Also, we might want to add documentation as part of this PR now that the documentation is in the repo.
| code: string; | ||
| required?: boolean; | ||
| directory?: string; | ||
| directory?: string | null; |
There was a problem hiding this comment.
[Question] Can you please explain this change and the one below in the same file ?
We already have ? on directory, I don't get why we need to add this union type
There was a problem hiding this comment.
It's introduced because otherwise we get an error when running codegen:
https://github.com/BLSQ/openhexa-app/actions/runs/25879781042/job/76056394291?pr=1780
It's just because null and undefined are not considered the same apparently:
Types of property 'directory' are incompatible.
Type 'string | null | undefined' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
yolanfery
left a comment
There was a problem hiding this comment.
Great, thanks for the changes, just missing some documentation 🙂
Conflicts: frontend/src/workspaces/graphql/queries.generated.tsx
Right! I forgot about that, thanks for reminding me |
Related PRs:
Changes
choices=ChoicesFromFile(path, column?)in the SDK. The app resolves those choices at run time by reading a CSV, JSON, or YAML file from the workspace's file storage and returning a flat list of string values.pipelineParameterChoices(workspaceSlug, pipelineVersionId, parameterCode): fetches the resolved choices on demand. The run-pipeline and version-config dialogs use it to populate a Select widget when a parameter has choicesFromFile set.How/what to test
choices=ChoicesFromFile(path, column?)andchoices=path(see the linked SDK PR for the API). Upload a matching CSV/JSON/YAML file to the workspace.Screenshots / screencast
Example with CSV with 2 columns:
choices=ChoicesFromFile("choices/choices_2_cols.csv"). Not column chosen so it gives an error.choices=ChoicesFromFile("choices/choices_2_cols.csv", "two")so it shows the option of column two.Warning when a pipeline parameter has invalid choices (e.g.: int/float with a choices file with strings) the invalid options appear disabled:

Error when trying to save an invalid pipeline parameter (e.g.: an int/float pipeline parameter tries to save a string value):

Error when everything goes wrong (in theory this state should be unreachable, but it's a fail safe in case everything goes wrong 🤪)
