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

workDirSettings in JNLPLauncher requirements are too strict, CasC plugin is impacted

    • Jenkins 2.126

      See https://github.com/jenkinsci/configuration-as-code-plugin/issues/233

      Currently the CasC plugin does not offer compatibility for old-style logic using @DataBoundConstructor. If a plugin configuration gets updated (new constructor, old is deprecated), the plugin just fails if newly introduced fields are non-null.

          [JENKINS-51603] workDirSettings in JNLPLauncher requirements are too strict, CasC plugin is impacted

          The actual issue is that JNLPLauncher's workDirSettings is declared @Nonnull https://github.com/jenkinsci/jenkins/blob/393680beb5d64628bdf8d9e5bf8daf4cab2191ad/core/src/main/java/hudson/slaves/JNLPLauncher.java#L69-L77  while it's actually nullable, as a default value can be safely computed (as done by deprecated constructor)

           

          also read https://github.com/jenkinsci/jep/pull/111

          Nicolas De Loof added a comment - The actual issue is that JNLPLauncher's workDirSettings is declared @Nonnull  https://github.com/jenkinsci/jenkins/blob/393680beb5d64628bdf8d9e5bf8daf4cab2191ad/core/src/main/java/hudson/slaves/JNLPLauncher.java#L69-L77   while it's actually nullable, as a default value can be safely computed (as done by deprecated constructor)   also read  https://github.com/jenkinsci/jep/pull/111

          Oleg Nenashev added a comment -

          Yep, I am going to remove the non-null requirement

          Oleg Nenashev added a comment - Yep, I am going to remove the non-null requirement

          Oleg Nenashev added a comment -

          Created https://github.com/jenkinsci/jenkins/pull/3463
          IMHO it deserves backporting

          Oleg Nenashev added a comment - Created https://github.com/jenkinsci/jenkins/pull/3463 IMHO it deserves backporting

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/slaves/JNLPLauncher.java
          http://jenkins-ci.org/commit/jenkins/229ed44a535034e045005bca942ed04a3093c91c
          Log:
          JENKINS-51603 - Relax workDirectory requirements for a JNLPLauncher constructor

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/slaves/JNLPLauncher.java http://jenkins-ci.org/commit/jenkins/229ed44a535034e045005bca942ed04a3093c91c Log: JENKINS-51603 - Relax workDirectory requirements for a JNLPLauncher constructor

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/slaves/JNLPLauncher.java
          http://jenkins-ci.org/commit/jenkins/d79c6afd2163a30b549314c7c1185bf8bd1fd149
          Log:
          JENKINS-51603 - Use CheckForNull instead of Nullable

          Compare: https://github.com/jenkinsci/jenkins/compare/e4a3138ce5de...d79c6afd2163
          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/slaves/JNLPLauncher.java http://jenkins-ci.org/commit/jenkins/d79c6afd2163a30b549314c7c1185bf8bd1fd149 Log: JENKINS-51603 - Use CheckForNull instead of Nullable Compare: https://github.com/jenkinsci/jenkins/compare/e4a3138ce5de...d79c6afd2163 * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.

          Jesse Glick added a comment -

          Merged, so fixed, yes?

          Jesse Glick added a comment - Merged, so fixed, yes?

          Jesse Glick added a comment -

          …though I disagree with the fix.

          Jesse Glick added a comment - …though I disagree with the fix.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/slaves/JNLPLauncher.java
          test/src/test/java/hudson/slaves/JNLPLauncherTest.java
          http://jenkins-ci.org/commit/jenkins/98b37699152595f35fce7387be0ee1717596650d
          Log:
          JENKINS-51603 The proper way to make a parameter optional is to use @DataBoundSetter.

          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/slaves/JNLPLauncher.java test/src/test/java/hudson/slaves/JNLPLauncherTest.java http://jenkins-ci.org/commit/jenkins/98b37699152595f35fce7387be0ee1717596650d Log: JENKINS-51603 The proper way to make a parameter optional is to use @DataBoundSetter. * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.

          oleg_nenashev,jglick, I prefer to either backport both the patches or none. Given Jesse's amendment is not yet merged, I lean towards skipping this in 1.121.2.

          Oliver Gondža added a comment - oleg_nenashev , jglick , I prefer to either backport both the patches or none. Given Jesse's amendment is not yet merged, I lean towards skipping this in 1.121.2.

          Jesse Glick added a comment -

          My amendment is merged, but very recently. I agree that this does not need to be in 2.121.2.

          Jesse Glick added a comment - My amendment is merged, but very recently. I agree that this does not need to be in 2.121.2.

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: