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

MyViewsProperty support for configuration-as-code

XMLWordPrintable

    • 2.344

      When applying a configuration, a NPE is raised because of the MyViewsProperty class.

      java.lang.NullPointerException
      	at hudson.model.MyViewsProperty.save(MyViewsProperty.java:138)
      	at hudson.BulkChange.commit(BulkChange.java:98)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:271)
      	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
      	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
      	at io.vavr.control.Option.map(Option.java:392)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
      	at io.vavr.Tuple2.apply(Tuple2.java:238)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:55)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
      	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:345)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:276)
      	at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.configure(DataBoundConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$doConfigure$16668e2$1(HeteroDescribableConfigurator.java:277)
      	at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.doConfigure(HeteroDescribableConfigurator.java:277)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$null$2(HeteroDescribableConfigurator.java:86)
      	at io.vavr.control.Option.map(Option.java:392)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$configure$3(HeteroDescribableConfigurator.java:86)
      	at io.vavr.Tuple2.apply(Tuple2.java:238)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.configure(HeteroDescribableConfigurator.java:83)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:92)
      	at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.check(HeteroDescribableConfigurator.java:55)
      	at io.jenkins.plugins.casc.BaseConfigurator.configure(BaseConfigurator.java:352)
      	at io.jenkins.plugins.casc.BaseConfigurator.check(BaseConfigurator.java:287)
      

      Looks similar to https://github.com/jenkinsci/jenkins/pull/4557

       

      An example configuration:

      jenkins:
        securityRealm:
          local:
            allowsSignup: false
            enableCaptcha: false
            users:
            - id: "admin"
              name: "admin"
              properties:
              - "apiToken"
              - "myView"
              - preferredProvider:
                  providerId: "default"
              - "timezone"
      

            timja Tim Jacomb
            egutierrez Evaristo Gutierrez
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: