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

[Bug]: Namespaced Step call passes arg array not spread args #255

Closed
cokieffebah opened this issue Jan 31, 2022 · 0 comments · Fixed by #261
Closed

[Bug]: Namespaced Step call passes arg array not spread args #255

cokieffebah opened this issue Jan 31, 2022 · 0 comments · Fixed by #261
Assignees
Labels
bug Something isn't working

Comments

@cokieffebah
Copy link

Jenkins Version

2.263.1

JTE Version

2.3

Bug Description

https://github.com/jenkinsci/templating-engine-plugin/blob/main/src/main/groovy/org/boozallen/plugins/jte/init/primitives/TemplatePrimitiveNamespace.groovy#L49

should be:
return args.size() > 0 ? value.call(*args) : value.call()

namespace call incorrectly internally passes the 'args' array as the only argument.

Relevant log output

No response

Steps to Reproduce

make library step:

def call(def opts = [:]){
  println opts.getClass()
}

make a template with a fully namespaced call like jte.libraries.lib.step1

jte.libraries.lib.step1(['arg1':'string'])

note that inside the step, ops is an array that contains the passed has

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant