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

Plugins should switch to '$class' from 'stapler-class' and 'kind'

      The field name used to specify class names in structured form is changed to $class from stapler-class and kind.
      Plugins using `stapler-class` or `kind` should follow that change as they may not get to work in future versions of Jenkins.

      They doesn't stop working immediately as Jenkins keeps the backward compatibility (it continues to send and receive stapler-class and kind).

      Instructions for plugins:

      • For plugins using stapler-class or kind in jelly files
        • You should use proper tags provided by Jenkins core, such as descriptorRadioList and dropdownDescriptorSelector.
        • lib/form/class-entry will be provided in the next version of Jenkins.
      • For plugins using stapler-class or kind in Java codes
        • Do like this:
          String clazzName = formData.optString("$class", null);
          if (clazzName == null) {
              // Fall back on the legacy stapler-class attribute.
              clazzName = formData.optString("stapler-class", null);
          }
          
        • Jenkins core should provide an alternate way in a future release so that plugins no longer need to access stapler-class and $class.

      See:

          [JENKINS-25403] Plugins should switch to '$class' from 'stapler-class' and 'kind'

          ikedam created issue -

          ikedam added a comment -

          I should prepare a special version of Jenkins which accepts only $class to test changes for plugins.

          ikedam added a comment - I should prepare a special version of Jenkins which accepts only $class to test changes for plugins.
          ikedam made changes -
          Component/s New: authorize-project-plugin [ 18155 ]
          Component/s New: build-timeout-plugin [ 15530 ]
          Component/s New: extensible-choice-parameter-plugin [ 17512 ]
          Component/s New: flexible-publish-plugin [ 16130 ]
          Component/s New: update-sites-manager-plugin [ 17576 ]
          Description Original: The field name used to specify class names in [structured form|https://wiki.jenkins-ci.org/display/JENKINS/Structured+Form+Submission] is changed to {{$class}} from {{stapler-class}} and {{kind}}.
          Plugins using `stapler-class` or `kind` should follow that change as they may not get to work in future versions of Jenkins.

          They doesn't stop working immediately as Jenkins keeps the backward compatibility (it continues to send and receive {{stapler-class}} and {{kind}}).

          See:
          * https://github.com/stapler/stapler/pull/39
          * https://github.com/jenkinsci/jenkins/pull/1443
          New: The field name used to specify class names in [structured form|https://wiki.jenkins-ci.org/display/JENKINS/Structured+Form+Submission] is changed to {{$class}} from {{stapler-class}} and {{kind}}.
          Plugins using `stapler-class` or `kind` should follow that change as they may not get to work in future versions of Jenkins.

          They doesn't stop working immediately as Jenkins keeps the backward compatibility (it continues to send and receive {{stapler-class}} and {{kind}}).

          Instructions for plugins:
          * For plugins using {{stapler-class}} or {{kind}} in jelly files
          ** You should use proper tags provided by Jenkins core, such as descriptorRadioList and dropdownDescriptorSelector.
          ** {{lib/form/class-entry}} will be provided in the next version of Jenkins.
          * For plugins using {{stapler-class}} or {{kind}} in Java codes
          ** Do like this:
          {code}
          String clazzName = formData.optString("$class", null);
          if (clazzName == null) {
              // Fall back on the legacy stapler-class attribute.
              clazzName = formData.optString("stapler-class", null);
          }
          {code}
          ** Jenkins core should provide an alternate way in a future release so that plugins no longer need to access {{stapler-class}} and {{$class}}.

          See:
          * https://github.com/stapler/stapler/pull/39
          * https://github.com/jenkinsci/jenkins/pull/1443

          ikedam added a comment - https://github.com/ikedam/stapler/tree/stapler-parent-1.233-JENKINS-25403 https://github.com/ikedam/jenkins/tree/jenkins-1.588-JENKINS-25403

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java
          http://jenkins-ci.org/commit/flexible-publish-plugin/319e7add1b70b41017dbdc1cf9ad30a7238f3195
          Log:
          Merge pull request #5 from mattmoor/master

          JENKINS-25403 Add support for upcoming $class annotation change

          Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/50f89c1d261d...319e7add1b70

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java http://jenkins-ci.org/commit/flexible-publish-plugin/319e7add1b70b41017dbdc1cf9ad30a7238f3195 Log: Merge pull request #5 from mattmoor/master JENKINS-25403 Add support for upcoming $class annotation change Compare: https://github.com/jenkinsci/flexible-publish-plugin/compare/50f89c1d261d...319e7add1b70

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java
          http://jenkins-ci.org/commit/flexible-publish-plugin/8f952fcdfe26c460494eeb42bc744bc3d64e727a
          Log:
          JENKINS-25403 Fixed the error message for no $class or stapler-class.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/org/jenkins_ci/plugins/flexible_publish/ConditionalPublisher.java http://jenkins-ci.org/commit/flexible-publish-plugin/8f952fcdfe26c460494eeb42bc744bc3d64e727a Log: JENKINS-25403 Fixed the error message for no $class or stapler-class.
          ikedam made changes -
          Component/s Original: flexible-publish-plugin [ 16130 ]
          ikedam made changes -
          Component/s Original: build-timeout-plugin [ 15530 ]
          Component/s Original: core [ 15593 ]
          Assignee New: ikedam [ ikedam ]

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/build_timeout/BuildTimeOutUtility.java
          http://jenkins-ci.org/commit/build-timeout-plugin/33b21d98ae412d5ff2657f3d442173d06b0bee9c
          Log:
          JENKINS-25403 Fixed the error message for no $class or stapler-class.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/build_timeout/BuildTimeOutUtility.java http://jenkins-ci.org/commit/build-timeout-plugin/33b21d98ae412d5ff2657f3d442173d06b0bee9c Log: JENKINS-25403 Fixed the error message for no $class or stapler-class.

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/build_timeout/BuildTimeOutUtility.java
          http://jenkins-ci.org/commit/build-timeout-plugin/4b827f5a1c6000a737841b072e326444d93b1f20
          Log:
          Merge pull request #35 from mattmoor/master

          JENKINS-25403 Add support for the upcoming '$class' annotation change while maintaining support for older cores.

          Compare: https://github.com/jenkinsci/build-timeout-plugin/compare/db17163973b6...4b827f5a1c60

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/build_timeout/BuildTimeOutUtility.java http://jenkins-ci.org/commit/build-timeout-plugin/4b827f5a1c6000a737841b072e326444d93b1f20 Log: Merge pull request #35 from mattmoor/master JENKINS-25403 Add support for the upcoming '$class' annotation change while maintaining support for older cores. Compare: https://github.com/jenkinsci/build-timeout-plugin/compare/db17163973b6...4b827f5a1c60

            ikedam ikedam
            ikedam ikedam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: