• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • gradle-plugin
    • None
    • Jenkins v 2.392
      Latest Gradle plugin version

      Similar to the fix for JENKINS-70139 to have booleanRadio use non-unique IDs in core Jenkins, the radioBlock construct has generated IDs, so when you have a repeatable describable (e.g. Gradle build step) then this ID will be duplicated for all instances.

      Gradle plugin example with the Build steps as repeatable sections where you choose the Gradle executable. Only one radio button can be selected in the whole group.

      https://github.com/jenkinsci/gradle-plugin/blob/master/src/main/resources/hudson/plugins/gradle/Gradle/config.jelly#L5

       

          [JENKINS-70739] Gradle step radioBlock uses non-unique ID

          Tom created issue -

          Tom added a comment -

          Tom added a comment - Caused by this PR: https://github.com/jenkinsci/jenkins/pull/7631
          Tom made changes -
          Link New: This issue is caused by JENKINS-70139 [ JENKINS-70139 ]
          Tom made changes -
          Attachment New: credentialBinding.png [ 60076 ]
          Tom made changes -
          Attachment New: gradleBuild.png [ 60077 ]
          Tom made changes -
          Description Original: After the fix for JENKINS-70139 to have booleanRadio use non-unique IDs, it is causing issues with radio buttons in repeatable sections for other plugins.

          Credentials Binding plugin example - you can see in the repeating Username and password (separated) sections only one radio button can be selected / active. This is more than just visual, the values are not enabled.

          [https://github.com/jenkinsci/credentials-binding-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/credentialsbinding/impl/BindingStep/config.jelly#L34]

          !image-2023-02-28-15-57-30-293.png!

           

          Gradle plugin example with the Build steps as repeatable sections where you choose the Gradle executable. Only one radio button can be selected in the whole group.

          [https://github.com/jenkinsci/gradle-plugin/blob/master/src/main/resources/hudson/plugins/gradle/Gradle/config.jelly#L5]

          !image-2023-02-28-15-59-57-880.png!

           

          File operations example 

          In any freestyle job, just add create/edit text file section (plugin to be installed) - plugin url - [https://plugins.jenkins.io/text-file-operations/]

          add min two section, and try to select the overwrite file option in both the section

          [https://github.com/jenkinsci/text-file-operations-plugin/blob/master/src/main/resources/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder/config.jelly#L14]

           
          New: After the fix for JENKINS-70139 to have booleanRadio use non-unique IDs, it is causing issues with radio buttons in repeatable sections for other plugins.

          Credentials Binding plugin example - you can see in the repeating Username and password (separated) sections only one radio button can be selected / active. This is more than just visual, the values are not enabled.

          [https://github.com/jenkinsci/credentials-binding-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/credentialsbinding/impl/BindingStep/config.jelly#L34]

          !credentialBinding.png!

           

          Gradle plugin example with the Build steps as repeatable sections where you choose the Gradle executable. Only one radio button can be selected in the whole group.

          [https://github.com/jenkinsci/gradle-plugin/blob/master/src/main/resources/hudson/plugins/gradle/Gradle/config.jelly#L5]

          !gradleBuild.png!

           

          File operations example 

          In any freestyle job, just add create/edit text file section (plugin to be installed) - plugin url - [https://plugins.jenkins.io/text-file-operations/]

          add min two section, and try to select the overwrite file option in both the section

          [https://github.com/jenkinsci/text-file-operations-plugin/blob/master/src/main/resources/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder/config.jelly#L14]

           
          Tom made changes -
          Attachment New: textFileOperations.mov [ 60078 ]
          Tom made changes -
          Description Original: After the fix for JENKINS-70139 to have booleanRadio use non-unique IDs, it is causing issues with radio buttons in repeatable sections for other plugins.

          Credentials Binding plugin example - you can see in the repeating Username and password (separated) sections only one radio button can be selected / active. This is more than just visual, the values are not enabled.

          [https://github.com/jenkinsci/credentials-binding-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/credentialsbinding/impl/BindingStep/config.jelly#L34]

          !credentialBinding.png!

           

          Gradle plugin example with the Build steps as repeatable sections where you choose the Gradle executable. Only one radio button can be selected in the whole group.

          [https://github.com/jenkinsci/gradle-plugin/blob/master/src/main/resources/hudson/plugins/gradle/Gradle/config.jelly#L5]

          !gradleBuild.png!

           

          File operations example 

          In any freestyle job, just add create/edit text file section (plugin to be installed) - plugin url - [https://plugins.jenkins.io/text-file-operations/]

          add min two section, and try to select the overwrite file option in both the section

          [https://github.com/jenkinsci/text-file-operations-plugin/blob/master/src/main/resources/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder/config.jelly#L14]

           
          New: After the fix for JENKINS-70139 to have booleanRadio use non-unique IDs, it is causing issues with radio buttons in repeatable sections for other plugins.

          Credentials Binding plugin example - you can see in the repeating Username and password (separated) sections only one radio button can be selected / active. This is more than just visual, the values are not enabled.

          [https://github.com/jenkinsci/credentials-binding-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/credentialsbinding/impl/BindingStep/config.jelly#L34]

          !credentialBinding.png!

           

          Gradle plugin example with the Build steps as repeatable sections where you choose the Gradle executable. Only one radio button can be selected in the whole group.

          [https://github.com/jenkinsci/gradle-plugin/blob/master/src/main/resources/hudson/plugins/gradle/Gradle/config.jelly#L5]

          !gradleBuild.png!

           

          File operations example 

          In any freestyle job, just add create/edit text file section (plugin to be installed) - plugin url - [https://plugins.jenkins.io/text-file-operations/]

          add min two section, and try to select the overwrite file option in both the section

          [https://github.com/jenkinsci/text-file-operations-plugin/blob/master/src/main/resources/com/etas/jenkins/plugins/CreateTextFile/CreateFileBuilder/config.jelly#L14]

          [^textFileOperations.mov]

           

          Jeff added a comment - - edited

          If you edit a job with multiple credential bindings of the same type (ex. "secret file", or "username and password (separated)"), this issue will cause all but one binding of each type to lose their credential selection unless you click the "Specific credentials" radio button on each one every time you edit the job.

          Then the job will fail with an error like this until you edit the job to restore the credential selections:

          java.lang.NullPointerException
          	at java.base/java.util.Objects.requireNonNull(Objects.java:221)
          	at com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:877)
          	at com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:855)
          	at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:195)
          	at org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding.variables(UsernamePasswordMultiBinding.java:82)
          	at org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper.makeSensitiveBuildVariables(SecretBuildWrapper.java:126)
          	at hudson.model.AbstractBuild.getSensitiveBuildVariables(AbstractBuild.java:1043)
          	at org.jenkinsci.plugins.envinject.util.RunHelper.getSensitiveBuildVariables(RunHelper.java:55)
          	at org.jenkinsci.plugins.envinject.service.EnvInjectActionSetter.addEnvVarsToRun(EnvInjectActionSetter.java:60)
          	at org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:81)
          	at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:42)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:617)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485)
          	at hudson.model.Run.execute(Run.java:1900)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
          	at hudson.model.ResourceController.execute(ResourceController.java:101)
          	at hudson.model.Executor.run(Executor.java:442) 

          Jeff added a comment - - edited If you edit a job with multiple credential bindings of the same type (ex. "secret file", or "username and password (separated)"), this issue will cause all but one binding of each type to lose their credential selection unless you click the "Specific credentials" radio button on each one every time you edit the job. Then the job will fail with an error like this until you edit the job to restore the credential selections: java.lang.NullPointerException at java.base/java.util.Objects.requireNonNull(Objects.java:221) at com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:877) at com.cloudbees.plugins.credentials.CredentialsProvider.findCredentialById(CredentialsProvider.java:855) at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:195) at org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding.variables(UsernamePasswordMultiBinding.java:82) at org.jenkinsci.plugins.credentialsbinding.impl.SecretBuildWrapper.makeSensitiveBuildVariables(SecretBuildWrapper.java:126) at hudson.model.AbstractBuild.getSensitiveBuildVariables(AbstractBuild.java:1043) at org.jenkinsci.plugins.envinject.util.RunHelper.getSensitiveBuildVariables(RunHelper.java:55) at org.jenkinsci.plugins.envinject.service.EnvInjectActionSetter.addEnvVarsToRun(EnvInjectActionSetter.java:60) at org.jenkinsci.plugins.envinject.EnvInjectListener.loadEnvironmentVariablesNode(EnvInjectListener.java:81) at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:42) at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:617) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485) at hudson.model.Run.execute(Run.java:1900) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442)
          Alexander Brandes made changes -
          Remote Link New: This issue links to "is caused by (Web Link)" [ 28530 ]

            Unassigned Unassigned
            tbeukhof Tom
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: