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

MyViewsProperty support for configuration-as-code

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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"
      

        Attachments

          Activity

          Hide
          egutierrez Evaristo Gutierrez added a comment -
          Show
          egutierrez Evaristo Gutierrez added a comment - CC Tim Jacomb
          Hide
          timja Tim Jacomb added a comment -

          What’s the configuration being applied?

          Show
          timja Tim Jacomb added a comment - What’s the configuration being applied?
          Hide
          egutierrez Evaristo Gutierrez added a comment -

          Tim Jacomb sorry, I have added it to the description.

          Show
          egutierrez Evaristo Gutierrez added a comment - Tim Jacomb sorry, I have added it to the description.
          Hide
          paprzyx Piotr added a comment -

          Evaristo Gutierrez Did you found any solution for that? I have same problem.

          Show
          paprzyx Piotr added a comment - Evaristo Gutierrez  Did you found any solution for that? I have same problem.
          Hide
          paprzyx Piotr added a comment -

          Evaristo Gutierrez for workaround jsut remove myView from configuration

          Show
          paprzyx Piotr added a comment - Evaristo Gutierrez  for workaround jsut remove  myView from configuration
          Hide
          stanislaw_kodzis Stanisław added a comment -

          This is still not solved, and very annoying. Workaround for Piotr works fine, however

          Show
          stanislaw_kodzis Stanisław added a comment - This is still not solved, and very annoying. Workaround for Piotr works fine, however

            People

            Assignee:
            ealvarez Esther Álvarez Feijoo
            Reporter:
            egutierrez Evaristo Gutierrez
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: