Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55381

Configuration-as-Code compatibility

XMLWordPrintable

    • 2.45

      The TestCrumbIssuer is not compatible with JCasC.

      That's quite confusing when implementing JCasC compatibility tests for other plugins and seeing this stacktrace.

      Test

      import io.jenkins.plugins.casc.ConfigurationAsCode;
      import org.junit.Rule;
      import org.junit.Test;
      
      public class ConfigurationAsCodeTest {
          @Rule
          public JenkinsRule j = new JenkinsRule();
      
          @Test
          public void test() throws Exception {
              ConfigurationAsCode.get().export(System.out);
          }
      }
      

      Jenkins Log Entry

      2.480 [id=15]	WARNING	i.j.p.c.i.DefaultConfiguratorRegistry#internalLookup: Configuration-as-Code can't handle type class org.jvnet.hudson.test.TestCrumbIssuer

       Output

      plugins:
        sites:
        - id: "default"
          url: "http://localhost:44791/update-center.json"
      jenkins:
        agentProtocols:
        - "CLI-connect"
        - "CLI2-connect"
        - "JNLP-connect"
        - "JNLP2-connect"
        - "JNLP4-connect"
        - "Ping"
        crumbIssuer: "FAILED TO EXPORT hudson.model.Hudson#crumbIssuer: \nio.jenkins.plugins.casc.ConfiguratorException:\
          \ Cannot find configurator for type class org.jvnet.hudson.test.TestCrumbIssuer\n\
          \tat io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry$1.load(DefaultConfiguratorRegistry.java:97)\n\
          \tat io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry$1.load(DefaultConfiguratorRegistry.java:93)\n\
          \tat com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3568)\n\
          \tat com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2350)\n\
          \tat com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2313)\n\
          \tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2228)\n\t\
          at com.google.common.cache.LocalCache.get(LocalCache.java:3965)\n\tat com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3969)\n\
          \tat com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4829)\n\
          \tat io.jenkins.plugins.casc.impl.DefaultConfiguratorRegistry.lookupOrFail(DefaultConfiguratorRegistry.java:70)\n\
          \tat io.jenkins.plugins.casc.ConfigurationContext.lookupOrFail(ConfigurationContext.java:71)\n\
          \tat io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:160)\n\
          \tat io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:43)\n\
          \tat io.jenkins.plugins.casc.Attribute.describe(Attribute.java:196)\n\tat io.jenkins.plugins.casc.core.JenkinsConfigurator.describe(JenkinsConfigurator.java:83)\n\
          \tat io.jenkins.plugins.casc.core.JenkinsConfigurator.describe(JenkinsConfigurator.java:30)\n\
          \tat io.jenkins.plugins.casc.ConfigurationAsCode.export(ConfigurationAsCode.java:411)\n\
          \tat org.jvnet.hudson.test.ConfigurationAsCodeTest.test(ConfigurationAsCodeTest.java:14)\n\
          \tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\
          \tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\
          \tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)\n\
          \tat org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)\n\
          \tat org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)\n\
          \tat org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)\n\
          \tat org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:553)\n\tat\
          \ org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)\n\
          \tat org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)\n\
          \tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.lang.Thread.run(Thread.java:748)\n"
        disableRememberMe: false
        mode: NORMAL
        numExecutors: 2
        primaryView:
          all:
            name: "all"
        quietPeriod: 5
        scmCheckoutRetryCount: 0
        slaveAgentPort: 0
        views:
        - all:
            name: "all"
      tool:
        jdk:
          defaultProperties:
          - installSource:
              installers:
              - jdkInstaller:
                  acceptLicense: false
          installations:
          - home: "/usr/lib/jvm/java-8-openjdk/jre"
            name: "default" 

       

            olivergondza Oliver Gondža
            renescheibe René Scheibe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: