Skip to content

feat: add secret parameter type for pipeline parameters(HEXA-1457 )#373

Merged
DimitriKwihangana merged 5 commits into
mainfrom
HEXA-1457-add-secret-field-type-to-pipeline
Apr 23, 2026
Merged

feat: add secret parameter type for pipeline parameters(HEXA-1457 )#373
DimitriKwihangana merged 5 commits into
mainfrom
HEXA-1457-add-secret-field-type-to-pipeline

Conversation

@DimitriKwihangana

@DimitriKwihangana DimitriKwihangana commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Adds a new Secret parameter type so pipeline authors can mark sensitive values (e.g. API tokens) to be masked in the app instead of displayed in a string.

Changes

Please list / describe the changes in the codebase for the reviewer(s).

@DimitriKwihangana DimitriKwihangana changed the title Hexa 1457 add secret field type to pipeline feat:add secret field type to pipeline(Hexa 1457 ) Apr 1, 2026
@DimitriKwihangana DimitriKwihangana changed the title feat:add secret field type to pipeline(Hexa 1457 ) feat: add secret parameter type for pipeline parameters(HEXA-1457 ) Apr 1, 2026
@DimitriKwihangana DimitriKwihangana self-assigned this Apr 2, 2026
@DimitriKwihangana DimitriKwihangana requested a review from mrivar April 2, 2026 14:07
int = "int"
postgresql = "postgresql"
s3 = "s3"
secret = "secret"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To modify the files under graphql/graphql_client/ you need to follow https://github.com/BLSQ/openhexa-sdk-python/blob/0f795c065543956e8487d3b1a126e65a3a09ea1a/README.md#codegen-from-the-graphql-schema

Those files are auto generated based on schema.generated.graphql

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I'm off today :) but felt to address the comments. It slipped my mind that files under graphql/graphql_client/ are auto-generated. I've added secret to schema.generated.graphql and re-ran ariadne-codegen to regenerate enums.py instead of editing it manually.

Comment thread openhexa/sdk/pipelines/parameter.py Outdated
Comment on lines +527 to +530
if isinstance(type, ParameterType):
self.type = type
else:
self.type = TYPES_BY_PYTHON_TYPE[type.__name__]()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change required ? Just curious

@DimitriKwihangana DimitriKwihangana Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime.py passes a ParameterType instance directly to Parameter.init, so this check was needed to handle that path and it worked. let me know if it should be this way. not so sure if it is the perfect way.

@yolanfery yolanfery Apr 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems a smell that something is wrong, because conceptually we just want to add a new type to but we modify the generic logic for all types

I think #374 would solve it (not particularly polished nor tested)

Comment thread openhexa/sdk/pipelines/runtime.py Outdated
param_kwargs = {k: v["value"] for k, v in parameter_args.items()}

parameter = Parameter(type=type_class.expected_type, **param_kwargs)
parameter = Parameter(type=type_class, **param_kwargs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change required ? Just curious

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before I was having an error of having the secret reaching in the database treated as "str" I found that without this fix, SecretType().expected_type resolves to str, meaning Secret parameters would silently serialize as "type": "str" and never reach the frontend as masked.

@yolanfery yolanfery Apr 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think the type logic smells wrong for the Secret and this seems to fix the symptom but not the underlying issue

What do you think of this #374 ? (not particularly polished nor tested)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant! @yolanfery!! It works perfectly. I tested it.

* Revert "chore(deps): update dependency python to 3.14 (#363)"

This reverts commit 178b0a7.

* fix: parameter typing for File (#371)

* chore: release v2.19.4 (#370)

* fix: type

* fix: type test

---------

Co-authored-by: blsqbot <83090543+blsqbot@users.noreply.github.com>
@DimitriKwihangana DimitriKwihangana merged commit 0dfc82e into main Apr 23, 2026
6 checks passed
@DimitriKwihangana DimitriKwihangana deleted the HEXA-1457-add-secret-field-type-to-pipeline branch April 23, 2026 08:06
@blsqbot blsqbot mentioned this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants