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]: template_methods overlaps with library methods #291

Closed
thatsmydoing opened this issue Jun 23, 2022 · 2 comments · Fixed by #293
Closed

[Bug]: template_methods overlaps with library methods #291

thatsmydoing opened this issue Jun 23, 2022 · 2 comments · Fixed by #293
Labels
bug Something isn't working

Comments

@thatsmydoing
Copy link

Jenkins Version

2.346.1

JTE Version

2.5.1

Bug Description

When upgrading to 2.5.1 from 2.4, one of our pipeline configurations had template_methods that declare the same functions as a library we were importing. I'm not sure if this was just wrong but it was not problematic in 2.4 but in 2.5, it throws an error that Overlapping template primitives for names.

I just wanted to note this as 2.5 stated no user-facing breaking changes but this was one for us.

Relevant log output

[JTE] There are multiple primitives with the name 'grud'
[JTE] 1. Step 'grud' from the 'vars' Library
[JTE] 2. No-Op Template Step 'grud'
[JTE] There are multiple primitives with the name 'source'
[JTE] 1. Step 'source' from the 'vars' Library
[JTE] 2. No-Op Template Step 'source'
[JTE] Overlapping template primitives for names: [grud, source] (show)
org.boozallen.plugins.jte.util.AggregateException: The following errors occurred: 
1: Overlapping template primitives for names: [grud, source]
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:242)
	at org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector.invoke(TemplatePrimitiveInjector.groovy:149)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:233)
	at org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector.orchestrate(TemplatePrimitiveInjector.groovy:98)
	at org.boozallen.plugins.jte.init.primitives.TemplatePrimitiveInjector$orchestrate.call(Unknown Source)
	at org.boozallen.plugins.jte.job.TemplateFlowDefinition.create(TemplateFlowDefinition.groovy:85)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)

Steps to Reproduce

Have a pipeline configuration where steps come from a library and have template_methods with the same name.

@thatsmydoing thatsmydoing added the bug Something isn't working label Jun 23, 2022
@steven-terrana
Copy link

thanks for reporting. we'll look into it.

@steven-terrana
Copy link

Thanks again for reporting!
resolved by #293.

will release a version 2.5.2 some time today.

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