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

No support for Cloudbees Folders, Templates in Job Type Column

      Please incorporate Job Type Column Plugin's PR3 into Extra Columns.

      https://github.com/jenkinsci/jobtype-column-plugin/pull/3

      Screenshot for comparison attached. 'Folder' is, well, a folder, and 'Gradle Job' is a freestyle job-based job template instance with a custom pronoun (it also says e.g. 'Delete Gradle Job' in the job's menu).

          [JENKINS-20278] No support for Cloudbees Folders, Templates in Job Type Column

          Fred G added a comment - - edited

          I started playing around with this. So far I'm planning to have a config option that lets the user switch between "Short name" and "Pronoun" as the source for the job type column.
          This switch will only be available on Jenkins version 1.519 and higher.

          Unfortunately I can't test the template plug-in. Is there any other way, apart from the pronoun, to find out if a job is a template (e.g. class/simple name)?

          Fred G added a comment - - edited I started playing around with this. So far I'm planning to have a config option that lets the user switch between "Short name" and "Pronoun" as the source for the job type column. This switch will only be available on Jenkins version 1.519 and higher. Unfortunately I can't test the template plug-in. Is there any other way, apart from the pronoun, to find out if a job is a template (e.g. class/simple name)?

          Daniel Beck added a comment -

          Template job instances internally are regular e.g. free-style jobs, but they have a JobProperty specifying the template and its parameters. Sample job (basically an empty freestyle project with equally empty template):

          <?xml version='1.0' encoding='UTF-8'?>
          <project>
            <actions/>
            <description></description>
            <keepDependencies>false</keepDependencies>
            <properties>
              <com.cloudbees.hudson.plugins.modeling.impl.jobTemplate.JobPropertyImpl plugin="cloudbees-template@3.17">
                <instance>
                  <model>TestTempl</model>
                  <values>
                    <entry>
                      <string>name</string>
                      <string>jobname1234</string>
                    </entry>
                  </values>
                  <item class="project" reference="../../../.."/>
                </instance>
              </com.cloudbees.hudson.plugins.modeling.impl.jobTemplate.JobPropertyImpl>
            </properties>
            <scm class="hudson.scm.NullSCM"/>
            <canRoam>true</canRoam>
            <disabled>false</disabled>
            <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
            <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
            <triggers/>
            <concurrentBuild>false</concurrentBuild>
            <builders/>
            <publishers/>
            <buildWrappers/>
          </project>
          

          But I doubt it's a good idea to rely on such internals!

          I'd be willing to test snapshots of your plugin, and can also build them myself if you tell me the repo/branch.

          Note that Cloudbees requires just an email address for a trial license allowing you to test your plugin with templates. And Templates 4.0-beta-x and Custom Update Center Plugins also introduce a whole bunch of new TopLevelItems that might be useful to support in this column.

          Daniel Beck added a comment - Template job instances internally are regular e.g. free-style jobs, but they have a JobProperty specifying the template and its parameters. Sample job (basically an empty freestyle project with equally empty template): <?xml version= '1.0' encoding= 'UTF-8' ?> <project> <actions/> <description></description> <keepDependencies> false </keepDependencies> <properties> <com.cloudbees.hudson.plugins.modeling.impl.jobTemplate.JobPropertyImpl plugin= "cloudbees-template@3.17" > <instance> <model>TestTempl</model> <values> <entry> <string>name</string> <string>jobname1234</string> </entry> </values> <item class= "project" reference= "../../../.." /> </instance> </com.cloudbees.hudson.plugins.modeling.impl.jobTemplate.JobPropertyImpl> </properties> <scm class= "hudson.scm.NullSCM" /> <canRoam> true </canRoam> <disabled> false </disabled> <blockBuildWhenDownstreamBuilding> false </blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding> false </blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild> false </concurrentBuild> <builders/> <publishers/> <buildWrappers/> </project> But I doubt it's a good idea to rely on such internals! — I'd be willing to test snapshots of your plugin, and can also build them myself if you tell me the repo/branch. Note that Cloudbees requires just an email address for a trial license allowing you to test your plugin with templates. And Templates 4.0-beta-x and Custom Update Center Plugins also introduce a whole bunch of new TopLevelItems that might be useful to support in this column.

          Code changed in jenkins
          User: Fred G
          Path:
          src/main/java/jenkins/plugins/extracolumns/JobTypeColumn.java
          src/main/resources/jenkins/plugins/extracolumns/JobTypeColumn/config.jelly
          src/main/resources/jenkins/plugins/extracolumns/JobTypeColumn/config_de.properties
          src/main/resources/jenkins/plugins/extracolumns/Messages.properties
          src/main/resources/jenkins/plugins/extracolumns/Messages_de.properties
          http://jenkins-ci.org/commit/extra-columns-plugin/9d38ff274686255270e08e19d16fc75ce89bd278
          Log:
          JENKINS-20278 - Added option to use 'pronoun' instead of 'simple name'
          to query job type

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Fred G Path: src/main/java/jenkins/plugins/extracolumns/JobTypeColumn.java src/main/resources/jenkins/plugins/extracolumns/JobTypeColumn/config.jelly src/main/resources/jenkins/plugins/extracolumns/JobTypeColumn/config_de.properties src/main/resources/jenkins/plugins/extracolumns/Messages.properties src/main/resources/jenkins/plugins/extracolumns/Messages_de.properties http://jenkins-ci.org/commit/extra-columns-plugin/9d38ff274686255270e08e19d16fc75ce89bd278 Log: JENKINS-20278 - Added option to use 'pronoun' instead of 'simple name' to query job type

          Fred G added a comment -

          I committed a first version in the branch "JENKINS-20278".
          With Jenkins version below 1.519, only simple name is used to get the job type. This now also includes folders, but not templates (not sure if it's worthwhile to support them below 1.519)!

          With Jenkins version 1.519 and higher, users can optionally use pronouns. With pronouns, template names are supported.

          I hope this a good compromise, because some people (me included) like the shorter "simple names" instead of the pronouns.

          @Daniel: I'd appreciate, if you could give it a try and let me know what you think.

          Fred G added a comment - I committed a first version in the branch " JENKINS-20278 ". With Jenkins version below 1.519, only simple name is used to get the job type. This now also includes folders, but not templates (not sure if it's worthwhile to support them below 1.519)! With Jenkins version 1.519 and higher, users can optionally use pronouns. With pronouns, template names are supported. I hope this a good compromise, because some people (me included) like the shorter "simple names" instead of the pronouns. @Daniel: I'd appreciate, if you could give it a try and let me know what you think.

          Daniel Beck added a comment - - edited

          1.532 is not recognized as being >=1.519, so the checkbox is disabled. Maybe because of this?

          Manually patching the config.xml produces a result as attached (unchecked and checked job type columns), with template job and template folder with custom pronouns defined. Looks great!

          Daniel Beck added a comment - - edited 1.532 is not recognized as being >=1.519, so the checkbox is disabled. Maybe because of this ? Manually patching the config.xml produces a result as attached (unchecked and checked job type columns), with template job and template folder with custom pronouns defined. Looks great!

          Fred G added a comment -

          I removed the version check for now. The "Use pronoun" option also works with versions before 1.519, it's just not really useful.

          Fred G added a comment - I removed the version check for now. The "Use pronoun" option also works with versions before 1.519, it's just not really useful.

            fredg Fred G
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: