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

Folders should have health metrics based on a single job

      Folders plugin is a great way to organize per project jobs.
      But in case of a feature branch builds its healt metrics is useless, currently it shows the worst child metric, which in case of feature builds will very often be bad, and doesn't bring any information to the user.

      I propose to have another metric: copy the health from a single job inside the folder.

      This way i could make the folder health metric be based on master branch build, and ignore the feature branches.

          [JENKINS-34502] Folders should have health metrics based on a single job

          Mike Kobit added a comment - - edited

          It would also be great if this could be represented as a properties element, too

          Taking a quick look, it doesn't seem like this would be too difficult to do from a contributor standpoint, but I have no knowledge around all the semantics of writing an extension for Jenkins (serialization, handling input, concurrency issues). Looking through the source code is semi-helpful, but I am still not 100% sure how I would actually write the code for this.

          Any tips or links to figuring out the right way to contribute this?

          Mike Kobit added a comment - - edited It would also be great if this could be represented as a properties element, too Taking a quick look, it doesn't seem like this would be too difficult to do from a contributor standpoint, but I have no knowledge around all the semantics of writing an extension for Jenkins (serialization, handling input, concurrency issues). Looking through the source code is semi-helpful, but I am still not 100% sure how I would actually write the code for this. Any tips or links to figuring out the right way to contribute this?

          Mike Kobit added a comment -

          I'm a Jenkins newbie, but this seemed like it might be an easy to pickup and contribute.

          Checked out the source code from https://github.com/jenkinsci/cloudbees-folder-plugin.

          mvn -version
          Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T10:41:47-06:00)
          Maven home: /usr/local/Cellar/maven/3.3.9/libexec
          Java version: 1.8.0_60, vendor: Oracle Corporation
          Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
          Default locale: en_US, platform encoding: UTF-8
          OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"
          

          I attempted to build it with mvn verify and saw a few Javadoc errors with malformed tags. I fixed these, and then mvn verify again and a success.

          I'm now trying to run by following some of the steps on the Jenkins Plugin Tutorial wiki page. I run mvn hpi:run and I see a SEVERE in the output logs:

          SEVERE: found cycle in plugin dependencies: (root=Plugin:cloudbees-folder, deactivating all involved) Plugin:cloudbees-folder -> Plugin:matrix-auth -> Plugin:cloudbees-folder
          

          I also see the "The following plugins are deactivated because of cyclic dependencies, most likely you can resolve the issue by updating these to a newer version." with both plugins at http://localhost:8080/jenkins/manage.

          I commented out the matrix-auth for now because it seems like that is being copied into the run container.

          <!--<dependency>-->
            <!--<groupId>org.jenkins-ci.plugins</groupId>-->
            <!--<artifactId>matrix-auth</artifactId>-->
            <!--<version>1.3</version>-->
            <!--<scope>test</scope>-->
            <!--<type>jar</type>-->
          <!--</dependency>
          

          This seems sort of wonky, but I'm having a hard time figuring out how to contribute here.

          Mike Kobit added a comment - I'm a Jenkins newbie, but this seemed like it might be an easy to pickup and contribute. Checked out the source code from https://github.com/jenkinsci/cloudbees-folder-plugin . mvn -version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T10:41:47-06:00) Maven home: /usr/local/Cellar/maven/3.3.9/libexec Java version: 1.8.0_60, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac" I attempted to build it with mvn verify and saw a few Javadoc errors with malformed tags. I fixed these, and then mvn verify again and a success. I'm now trying to run by following some of the steps on the Jenkins Plugin Tutorial wiki page . I run mvn hpi:run and I see a SEVERE in the output logs: SEVERE: found cycle in plugin dependencies: (root=Plugin:cloudbees-folder, deactivating all involved) Plugin:cloudbees-folder -> Plugin:matrix-auth -> Plugin:cloudbees-folder I also see the "The following plugins are deactivated because of cyclic dependencies, most likely you can resolve the issue by updating these to a newer version." with both plugins at http://localhost:8080/jenkins/manage . I commented out the matrix-auth for now because it seems like that is being copied into the run container. <!--<dependency> --> <!--<groupId> org.jenkins-ci.plugins </groupId> --> <!--<artifactId> matrix-auth </artifactId> --> <!--<version> 1.3 </version> --> <!--<scope> test </scope> --> <!--<type> jar </type> --> <!--</dependency> This seems sort of wonky, but I'm having a hard time figuring out how to contribute here.

          This is an old issue but still relevant in my opinion. I just created a pull request that implements the requested behavior: https://github.com/jenkinsci/cloudbees-folder-plugin/pull/196

          Daniel Krämer added a comment - This is an old issue but still relevant in my opinion. I just created a pull request that implements the requested behavior: https://github.com/jenkinsci/cloudbees-folder-plugin/pull/196

          James Nord added a comment - - edited

          This is possible with the branch api today - so this should likely be closed.

          the metric you need to add (and remove the others) is "Health of the primary branch of a repository" 

          configuration option:

          view of the folder: 

           
          view inside the folder:

          James Nord added a comment - - edited This is possible with the branch api today - so this should likely be closed. the metric you need to add (and remove the others) is "Health of the primary branch of a repository"  configuration option: view of the folder:    view inside the folder:

          James Nord added a comment - - edited

          James Nord added a comment - - edited https://github.com/jenkinsci/branch-api-plugin/pull/146  / https://github.com/jenkinsci/branch-api-plugin/pull/169

          Jesse Glick added a comment -

          And https://github.com/jenkinsci/branch-api-plugin/pull/147 there is a Child Health metrics property for organization folders.

          Jesse Glick added a comment - And https://github.com/jenkinsci/branch-api-plugin/pull/147 there is a Child Health metrics property for organization folders.

          Jesse Glick added a comment -

          Now filed as https://github.com/jenkinsci/cloudbees-folder-plugin/pull/243. Is there still a valid use case here not covered by the branch-api change? If so, this should be reopened.

          Jesse Glick added a comment - Now filed as https://github.com/jenkinsci/cloudbees-folder-plugin/pull/243 . Is there still a valid use case here not covered by the branch-api change? If so, this should be reopened.

          jglick
          As for https://github.com/jenkinsci/branch-api-plugin/pull/147 it only covers OrganizationFolders from what I understand.
          https://github.com/jenkinsci/branch-api-plugin/pull/146 does not cover simpler use cases, like a folder with multiple build jobs in it such as build / deploy / test.
          Another issue is that not all SCM (and respective Jenkins SCM providers) do have a concept for "primary branches".
          My PR in https://github.com/jenkinsci/cloudbees-folder-plugin/pull/243 would cover that.

          Daniel Krämer added a comment - jglick As for https://github.com/jenkinsci/branch-api-plugin/pull/147 it only covers OrganizationFolders from what I understand. https://github.com/jenkinsci/branch-api-plugin/pull/146 does not cover simpler use cases, like a folder with multiple build jobs in it such as build / deploy / test. Another issue is that not all SCM (and respective Jenkins SCM providers) do have a concept for "primary branches". My PR in https://github.com/jenkinsci/cloudbees-folder-plugin/pull/243 would cover that.

            Unassigned Unassigned
            krzyk krzyk
            Votes:
            21 Vote for this issue
            Watchers:
            27 Start watching this issue

              Created:
              Updated: