Skip to content
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

(suggestion) replace "{{ }}" with "$( )", "${ }" or any yaml-friendly marker #769

Closed
cdevienne opened this issue Feb 21, 2024 · 4 comments
Closed
Labels

Comments

@cdevienne
Copy link
Contributor

Using {{ and }} for variable substitution makes it cumbersome to generate venom scripts with yaml library, when we need to make data substitutions (as opposed to string substitutions).

The following script is a valid venom script but cannot be written or parsed by a standard yaml library:

vars:
  credentials:
    username: xxx
    password: yyy
testcases:
- name: login
  steps:
    - type: myexecutor
      credentials: {{ .credentials }}

In this particular case, the variable cannot be enclosed in " because the executor needs a map, not a string.

Using an alternative marker, in addition to {{}} (if not in replacement of) would make things a lots smoother for programs that manipulates venom scripts.

@cdevienne cdevienne changed the title (suggestion) replace "{{ }}" with "$( )" or any yaml-friendly marker (suggestion) replace "{{ }}" with "$( )", "${ }" or any yaml-friendly marker Mar 25, 2024
@github-actions github-actions bot added the Stale label Aug 13, 2024
@yesnault
Copy link
Member

(nothing planned about that replacement for now)

@cdevienne
Copy link
Contributor Author

How about an alternative markup in addition to {{}} that would not break any existing script but would still solve my main issue?
I can provide a patch.

@yesnault
Copy link
Member

For now, the basecode is linked to the CDS SDK Interpolate func (github.com/ovh/cds/sdk/interpolate), not sure that it's possible to add an alternative markup easily.

In the next major release, we will move to ${{..}} and remove the CDS Interpolate usage.
--> #804

@cdevienne
Copy link
Contributor Author

this is excellent news, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants