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

Add git plugin CasC symbol backwards compatibility with pre 5.0.0 versions

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • git-plugin
    • None

      When using Jenkins 2.375.3 with git plugin 4.14.3, my CasC bundle is working well, but after upgrading the git plugin to 5.0.0, my CasC bundle is no longer valid.
       
      While according to semver rules, it can be expected for this new version to contain breaking changes, It would be great to support the previously working CasC syntax as well as the new syntax.
       
      When using git plugin 4.14.3 with the following reduced CasC bundle applied to configure the git plugin:
      BEE-30962.yaml

       
      This CasC bundle would return the following during form validation at JENKINS_URL/manage/configuration-as-code/ (and the bundle would apply cleanly):
       

      The configuration can be applied

       
       
      After upgrading the git plugin to version 5.0.0, and restarting the instance, in the product UI I see a warning:

      Configuration as Code obsolete file format:
      'gitSCM' is an obsolete attribute name, please use 'scmGit'

       
      Additionally, when I go to JENKINS_URL/manage/configuration-as-code/ and try to apply that same CasC bundle, before I try to apply it, I get a form validation error in the UI:
       

      An internal error occurred during form field validation (HTTP 500). Please reload the page and if the problem persists, ask the administrator for help.

       
      I also see the following warning in the logs:

      2023-03-03 19:13:09.780+0000 [id=16] WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving http://localhost:8080/manage/configuration-as-code/checkNewSource
      java.lang.NullPointerException
      at io.jenkins.plugins.casc.ConfigurationAsCode.lambda$collectProblems$0(ConfigurationAsCode.java:262)
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
      at java.base/java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1764)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
      at io.jenkins.plugins.casc.ConfigurationAsCode.collectProblems(ConfigurationAsCode.java:263)

        1. BEE-30962.yaml
          0.6 kB
        2. configuration-as-code.yaml
          7 kB
        3. image-2023-03-03-17-44-11-331.png
          image-2023-03-03-17-44-11-331.png
          104 kB
        4. io.jenkins.plugins.casc.CasCGlobalConfig.xml
          0.3 kB
        5. plugins.txt
          1.0 kB
        6. plugins-more.txt
          4 kB
        7. run-jenkins.sh
          0.9 kB
        8. run-jenkins-more.sh
          0.9 kB

            ridemountainpig Yen Cheng Lin
            rkivisto Ray Kivisto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: