Skip to content

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

Open
DimitriKwihangana wants to merge 3 commits intomainfrom
HEXA-1457-add-secret-field-type-to-pipeline
Open

feat: add secret parameter type for pipeline parameters(HEXA-1457 )#373
DimitriKwihangana wants to merge 3 commits intomainfrom
HEXA-1457-add-secret-field-type-to-pipeline

Conversation

@DimitriKwihangana
Copy link
Copy Markdown
Contributor

@DimitriKwihangana DimitriKwihangana commented Apr 1, 2026

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 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

Copy link
Copy Markdown
Contributor Author

@DimitriKwihangana DimitriKwihangana Apr 3, 2026

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.

Copy link
Copy Markdown
Contributor

@yolanfery yolanfery Apr 3, 2026

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)

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.

Copy link
Copy Markdown
Contributor

@yolanfery yolanfery Apr 3, 2026

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)

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