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

See what could be reused from better-labels-plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      See what could be reused (ideas and/or code) from Daniel's similar plugin.

        Attachments

          Activity

          Hide
          dominiquebrice Dominique Brice added a comment - - edited

          Here are the two main differences I found between label-linked-jobs and better-labels.

          1.
          I included the description feature in the plugin. I didn't make it a separate section in the label configuration, because I don't see a reason to activate the Description link and not the Linked Jobs link.
          It's nice to be able to add a description to a label but doing so via a plugin is a bit of an overkill from a usability perspective in my opinion. To have to click an additional link to see it is one too much click. The description field should be supported directly on the label page by core Jenkins, just like the description field on a job page.

          2.
          to list all jobs (to find the jobs linked to a particular label) I copied code from hudson.model.Label.getTiedJobs(), see getJobsGroups in this class. This function calls Jenkins.getInstance().getAllItems(AbstractProject.class). better-labels does the same. The different is that label-linked-jobs, like the jenkins core class, adds an additional filter by keeping only jobs implementing the interface hudson.model.TopLevelItem.
          In the class/interface tree of Jenkins 1.580-SNAPSHOT only one non-abstract class extends AbstractProject : FreeStyleProject (via abstract class Project). Since this class also implements TopLevelItem, it makes no difference. However in Jenkins 1.532, there are more classes extending AbstractProject (they have since been taken to separate modules if I understand correctly), so the additional filter would indeed leave out some classes:

          • MavenModule, extends AbstractProject via AbstractMavenProject, does NOT implement TopLevelItem
          • MavenModuleSet, extends AbstractProject via AbstractMavenProject, implements TopLevelItem
          • MatrixProject, extends AbstractProject and implements TopLevelItem
          • FreeStyleProject, extends AbstractProject via abstract class Project, implements TopLevelItem
          • MatrixConfiguration, extends AbstractProject via abstract class Project, does NOT implements TopLevelItem

          So better-labels would list the jobs from the following classes: MavenModule, MavenModuleSet, MatrixProject, FreeStyleProject, MatrixConfiguration while label-linked-jobs excludes MavenModule and MatrixConfiguration. I don't have enough knowledge of these two features in jenkins to determine if this is a problem or not.

          Show
          dominiquebrice Dominique Brice added a comment - - edited Here are the two main differences I found between label-linked-jobs and better-labels . 1. I included the description feature in the plugin. I didn't make it a separate section in the label configuration, because I don't see a reason to activate the Description link and not the Linked Jobs link. It's nice to be able to add a description to a label but doing so via a plugin is a bit of an overkill from a usability perspective in my opinion. To have to click an additional link to see it is one too much click. The description field should be supported directly on the label page by core Jenkins, just like the description field on a job page. 2. to list all jobs (to find the jobs linked to a particular label) I copied code from hudson.model.Label.getTiedJobs(), see getJobsGroups in this class . This function calls Jenkins.getInstance().getAllItems(AbstractProject.class). better-labels does the same. The different is that label-linked-jobs, like the jenkins core class, adds an additional filter by keeping only jobs implementing the interface hudson.model.TopLevelItem. In the class/interface tree of Jenkins 1.580-SNAPSHOT only one non-abstract class extends AbstractProject : FreeStyleProject (via abstract class Project). Since this class also implements TopLevelItem, it makes no difference. However in Jenkins 1.532, there are more classes extending AbstractProject (they have since been taken to separate modules if I understand correctly), so the additional filter would indeed leave out some classes: MavenModule, extends AbstractProject via AbstractMavenProject, does NOT implement TopLevelItem MavenModuleSet, extends AbstractProject via AbstractMavenProject, implements TopLevelItem MatrixProject, extends AbstractProject and implements TopLevelItem FreeStyleProject, extends AbstractProject via abstract class Project, implements TopLevelItem MatrixConfiguration, extends AbstractProject via abstract class Project, does NOT implements TopLevelItem So better-labels would list the jobs from the following classes: MavenModule, MavenModuleSet, MatrixProject, FreeStyleProject, MatrixConfiguration while label-linked-jobs excludes MavenModule and MatrixConfiguration. I don't have enough knowledge of these two features in jenkins to determine if this is a problem or not.
          Hide
          danielbeck Daniel Beck added a comment -

          Jenkins 1.580 includes label descriptions already, no need to do it in a plugin anymore.

          Show
          danielbeck Daniel Beck added a comment - Jenkins 1.580 includes label descriptions already, no need to do it in a plugin anymore.
          Hide
          danielbeck Daniel Beck added a comment -

          I don't think there's anything in the better-labels plugin that adds anything of value to your plugin (except I like my plugin's name better ). Descriptions are now in core, and you're doing a better job (checking for TopLevelItem is correct!) of finding related labels. I don't think more than that was ever implemented.

          Show
          danielbeck Daniel Beck added a comment - I don't think there's anything in the better-labels plugin that adds anything of value to your plugin (except I like my plugin's name better ). Descriptions are now in core, and you're doing a better job (checking for TopLevelItem is correct!) of finding related labels. I don't think more than that was ever implemented.
          Hide
          dominiquebrice Dominique Brice added a comment -

          Thanks! I removed again description from the plugin. Nice to have it in Jenkins core.

          Show
          dominiquebrice Dominique Brice added a comment - Thanks! I removed again description from the plugin. Nice to have it in Jenkins core.
          Hide
          dominiquebrice Dominique Brice added a comment -

          Covered by version 1.0.1 of the plugin.

          Show
          dominiquebrice Dominique Brice added a comment - Covered by version 1.0.1 of the plugin.

            People

            Assignee:
            dominiquebrice Dominique Brice
            Reporter:
            dominiquebrice Dominique Brice
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: