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

Double-counting of health reports from child folders

    Details

    • Similar Issues:

      Description

      Folder.getBuildHealthReports looks like it is double-counting each child Folder. It does a recursive traversal of the folder, applying FolderHealthMetric.Reporter to each node (leaf or not). But a typical FolderHealthMetric like WorstChildHealthMetric also calls getHealthReport on the child Folder, which winds up calling Folder.getBuildHealthReports recursively! This seems like a mistake.

      Possible fixes:

      • Make WorstChildHealthMetric.ReporterImpl.observe (and any other similar impls) ignore a Folder it is given.
      • Make Folder.getBuildHealthReports not ask a reporter to observe a Folder.
      • Make Folder.getBuildHealthReports not do a recursive traversal, only asking about direct children.

      My preference is for the third fix, as it leaves the reporter in control of the logic; if it needs a recursive call it can do one.

      By the way, the awkward reflection code in getHealthReport suggests that we need an interface in Jenkins core, such as

      interface ItemWithHealthReport extends Item {
          HealthReport getBuildHealth();
          List<HealthReport> getBuildHealthReports();
      }
      

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-25075 [ JENKINS-25075 ]
            jglick Jesse Glick made changes -
            Labels health performance api health performance
            jglick Jesse Glick made changes -
            Assignee stephenconnolly [ stephenconnolly ] Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 158974 ] JNJira + In-Review [ 195953 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: