-
Notifications
You must be signed in to change notification settings - Fork 29
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
Bug: Parameters with typeof steps
are not generated correctly
#161
Comments
steps
parameter type is generated incorrectlypost_steps
parameter type is generated incorrectly
Hi! Thanks for opening this issue. It looks like this is an unexpected way of implementing The WorkflowJob constructor has the parameter arguments, then two special arguments for pre steps and post steps.
So instead of defining the pre_steps in the parameters object yourself, you pass them along in the following arguments.
I also found an unexpected output where if you have undefined parameters, the pre and post steps will not be generated. The real issue here means that any "StepsParameter" might not be generating as expected. That's a good find. I'll change the title of this issue to reflect that. (Looks like your first title was correct 😄 ) |
post_steps
parameter type is generated incorrectlysteps
are not generated correctly
I see now that there is a pre_steps are also on the parameters object. This is likely an error, but might be the preferable way. Happy to receive some input on which is better for the end user, as I can see pros and cons to both. |
In my opinion, in order to avoid confusion like this, only one or the other should be allowed, not both. Ideally, if we decide to pass pre/post-steps as separate parameters, the type system would complain if the user tries to set them inside the Given that, it might be simplest to remove them as separate parameters and just pass them as members of the |
I found another manifestation of this issue when passing the built-in |
@Jaryt Any updates on this? We are hoping to start porting some of our existing configs to the SDK, but this is a blocker. |
Hey @Xavientois 👋 Would you be willing to test out the #176 PR and let me know if this works for you? |
Sure thing! Thanks! |
@KyleTryon I tested it with the following code, and still saw issues. Maybe my TS setup is broken. |
Hey @Xavientois sorry for the delay, I had to attend to some work on another repo. Coming back to take a look here. Thank you for the added info! |
Perfect! Thanks! If my example works on your machine, then the issue on my end was likely my TS setup, so I would consider it fixed at that point. |
Updating with comments from PR, a new PR will be created.
|
Is there an existing issue for this?
Current behavior
Values passed to a parameter with the
post_steps
parameter type are generated incorrectly.checkout
command produces an empty objectname:
propertyThis causes the generated config to fail when trying to run the pipeline
Minimum reproduction code
https://gist.github.com/Xavientois/21bb00fc854d75d3bab19905611d47a2
Steps to reproduce
No response
Expected behavior
- checkout
name:
propertyCircleCI Config SDK version
0.10.1
Node.js version
16.18.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: