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

Documentation refers to GitLab documentation but doesn't support all build state #1668

Open
HeikoBoettger opened this issue Jul 10, 2024 · 0 comments
Labels
bug For changelog: Minor bug. Will be listed after features

Comments

@HeikoBoettger
Copy link

Jenkins and plugins versions report

java.lang.IllegalArgumentException: No enum constant com.dabsquared.gitlabjenkins.gitlab.api.model.BuildState.manual
at java.base/java.lang.Enum.valueOf(Enum.java:240)
at org.jenkinsci.plugins.structs.describable.DescribableModel.coerce(DescribableModel.java:476)
at org.jenkinsci.plugins.structs.describable.DescribableModel.buildArguments(DescribableModel.java:409)
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:329)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:305)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
at jdk.internal.reflect.GeneratedMethodAccessor155140.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:180)
at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:163)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:148)
at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:178)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:182)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: eaeb3e10-7815-4a83-a369-a88fb00c9b4f
Caused: java.lang.IllegalArgumentException: Could not instantiate {name=jenkins, state=manual} for com.dabsquared.gitlabjenkins.workflow.UpdateGitLabCommitStatusStep
at org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(DescribableModel.java:334)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:305)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
at jdk.internal.reflect.GeneratedMethodAccessor155140.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

What Operating System are you using (both controller, and any agents involved in the problem)?

doesn't matter

Reproduction steps

Create a pipeline and try to pass "manual" as status when invoking gitlabUpdateCommitStatus.

Expected Results

Since the documentation tells to lookup the GitLab API documentation, I would expect that the status is just passed as it is to GitLab. Further I would assume that GitLab already give a http status code when there is bad status value so the plugin could just check for an error returned by gitlab.

Proposal: check whether it is really needed to have conversion to the enum

Actual Results

It fails due because the plugin wasn't updated to support the new values.

Anything else?

No response

Are you interested in contributing a fix?

Yes, as long as it's only adding the missing enum value and there are no test to update.

@HeikoBoettger HeikoBoettger added the bug For changelog: Minor bug. Will be listed after features label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features
Projects
None yet
Development

No branches or pull requests

1 participant