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

Blue Ocean Artifact tab not showing all artifacts

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • blueocean-plugin

      The `artifacts` tab in blue ocean is not displaying all the build artifacts.

      Using pipelines, we have 6 test suites running on 6 different instances of our site. Each of these runs produces logs that we archive. The logs have different path names, based on the site they're running on, but when viewed in the Blue Ocean artifacts view, only one instance of each log is displayed. When going through the old Jenkins UI you can find all the expected log files.

       

      Expected results (as found when looking in jenkins/jobs/OurJob/branches/PR-4294/builds/1/archive or when looking through old UI):
      test_suite_1/logs/error.log

      test_suite_1/logs/other.log

      test_suite_1/logs/this_thing.log

      test_suite_2/logs/error.log

      test_suite_3/logs/error.log

      test_suite_3/logs/other.log

      test_suite_3/logs/this_thing.log

      test_suite_3/logs/new_thing.log

       

      Results when viewed on "Artifacts" tab in Blue Ocean:

      test_suite_1/logs/error.log

      test_suite_1/logs/this_thing.log

      test_suite_3/logs/other.log

      test_suite_3/logs/new_thing.log

          [JENKINS-51533] Blue Ocean Artifact tab not showing all artifacts

          Sam Gleske added a comment - - edited

          This occurs on my Jenkins instance as well. Look at the artifacts in blue ocean vs the old UI on the following:

          Sam Gleske added a comment - - edited This occurs on my Jenkins instance as well. Look at the artifacts in blue ocean vs the old UI on the following: (old UI) https://build.gimp.org/job/gimp/job/master/117/ (Blue Ocean) https://build.gimp.org/blue/organizations/jenkins/gimp/detail/master/117/artifacts (missing artifacts)

          Sam Gleske added a comment -

          In blue ocean source I found:
          https://github.com/jenkinsci/blueocean-plugin/blob/9297c30ac8e2ae1d6380325008c2622308d41aaa/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/ArtifactImpl.java

          Analyzing my web console I found that the full artifact list is properly returned in the REST call.

          https://build.gimp.org/blue/rest/organizations/jenkins/pipelines/gimp/branches/master/runs/117/artifacts/?start=0&limit=101

          I hypothesize the problem is in blue ocean JavaScript rendering that rest call (because the rest call returns all artifacts properly).

          Sam Gleske added a comment - In blue ocean source I found: https://github.com/jenkinsci/blueocean-plugin/blob/9297c30ac8e2ae1d6380325008c2622308d41aaa/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/ArtifactImpl.java Analyzing my web console I found that the full artifact list is properly returned in the REST call. https://build.gimp.org/blue/rest/organizations/jenkins/pipelines/gimp/branches/master/runs/117/artifacts/?start=0&limit=101 I hypothesize the problem is in blue ocean JavaScript rendering that rest call (because the rest call returns all artifacts properly).

          Sam Gleske added a comment -

          Found some JavaScript related to rendering. https://github.com/jenkinsci/blueocean-plugin/blob/7eaa5286473fa537e0c19a79185b1d4065a0c283/blueocean-core-js/src/js/services/ActivityService.js#L88-L100 I'm currently looking into how I can debug this in my web console.

          Sam Gleske added a comment - Found some JavaScript related to rendering. https://github.com/jenkinsci/blueocean-plugin/blob/7eaa5286473fa537e0c19a79185b1d4065a0c283/blueocean-core-js/src/js/services/ActivityService.js#L88-L100 I'm currently looking into how I can debug this in my web console.

          Sam Gleske added a comment -

          I think I've figured out the problem:

          curl 'https://build.gimp.org/blue/rest/organizations/jenkins/pipelines/gimp/branches/master/runs/117/artifacts/?start=0&limit=101'
          

          You'll notice that there are duplicate IDs which are meant to be unique. So if one is collecting files with the same name but under multiple paths, then their ID will conflict and only one ID will show up in blue ocean.

          For example, my problem is collecting multiple files under different paths named "test-suite.log". So only one "test-suite.log" shows up. oubre's problem appears to be having multiple "error.log" files.

          I'm going to try to submit a patch which fixes this.

          Sam Gleske added a comment - I think I've figured out the problem: curl 'https://build.gimp.org/blue/rest/organizations/jenkins/pipelines/gimp/branches/master/runs/117/artifacts/?start=0&limit=101' You'll notice that there are duplicate IDs which are meant to be unique. So if one is collecting files with the same name but under multiple paths, then their ID will conflict and only one ID will show up in blue ocean. For example, my problem is collecting multiple files under different paths named "test-suite.log". So only one "test-suite.log" shows up. oubre 's problem appears to be having multiple "error.log" files. I'm going to try to submit a patch which fixes this.

          Sam Gleske added a comment -

          Opened a pull request with a fix from my findings https://github.com/jenkinsci/blueocean-plugin/pull/1748

          Sam Gleske added a comment - Opened a pull request with a fix from my findings https://github.com/jenkinsci/blueocean-plugin/pull/1748

          Sam Gleske added a comment -

          This is fixed.  It will be available in the next blue ocean release.

          Sam Gleske added a comment - This is fixed.  It will be available in the next blue ocean release.

            sag47 Sam Gleske
            oubre Stephanie Oubre
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: