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

OPTIMIZATION: Pre-load Runs on pipeline activity page

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • blueocean-plugin
    • None
    • arctic, tasman, frank

      Preload/prefetch pipeline runs on the pipeline activity page.

      Create an extension point to make it easy to do the same thing for other data that can be prefectched for other pages e.g. see JENKINS-40487.

      In Scope

      • This data is attached to the $.blueOceanConfig object
      • When the page loads the data is injected into the store
      • We never have to do a XHR when loading the run details

          [JENKINS-39625] OPTIMIZATION: Pre-load Runs on pipeline activity page

          Tom FENNELLY added a comment -

          Parking this until JENKINS-39737 and JENKINS-39661 are addressed.

          Tom FENNELLY added a comment - Parking this until JENKINS-39737 and JENKINS-39661 are addressed.

          James Dumay added a comment -

          tfennelly Instead of waiting for JENKINS-39737 to be completed just make getArtifacts() return an empty collection (effectively removing it from the result) and continue experimenting here to see if there are any other gains to be made.

          AbstractRunImpl.java

              @Override
              public Container<BlueArtifact> getArtifacts() {
          //        Map<String, BlueArtifact> m = new HashMap<>();
          //        List<Run.Artifact> artifacts = run.getArtifacts();
          //        for (final Run.Artifact artifact: artifacts) {
          //            m.put(artifact.getFileName(), new BlueArtifact() {
          //                @Override
          //                public String getName() {
          //                    return artifact.getFileName();
          //                }
          //
          //                @Override
          //                public String getUrl() {
          //                    return Stapler.getCurrentRequest().getContextPath() +
          //                        "/" + run.getUrl()+"artifact/"+ artifact.getHref();
          //                }
          //
          //                @Override
          //                public long getSize() {
          //                    try {
          //                        return artifact.getFileSize();
          //                    } catch (NumberFormatException e) {
          //                        return 0;
          //                    }
          //                }
          //
          //                @Override
          //                public Link getLink() {
          //                    return new Link(getUrl());
          //                }
          //
          //            });
          //        }
                  return Containers.fromResourceMap(getLink(), Maps.<String, BlueArtifact>newConcurrentMap());
              }
          

          James Dumay added a comment - tfennelly Instead of waiting for JENKINS-39737 to be completed just make getArtifacts() return an empty collection (effectively removing it from the result) and continue experimenting here to see if there are any other gains to be made. AbstractRunImpl.java @Override public Container<BlueArtifact> getArtifacts() { // Map< String , BlueArtifact> m = new HashMap<>(); // List<Run.Artifact> artifacts = run.getArtifacts(); // for ( final Run.Artifact artifact: artifacts) { // m.put(artifact.getFileName(), new BlueArtifact() { // @Override // public String getName() { // return artifact.getFileName(); // } // // @Override // public String getUrl() { // return Stapler.getCurrentRequest().getContextPath() + // "/" + run.getUrl()+ "artifact/" + artifact.getHref(); // } // // @Override // public long getSize() { // try { // return artifact.getFileSize(); // } catch (NumberFormatException e) { // return 0; // } // } // // @Override // public Link getLink() { // return new Link(getUrl()); // } // // }); // } return Containers.fromResourceMap(getLink(), Maps.< String , BlueArtifact>newConcurrentMap()); }

          Tom FENNELLY added a comment -

          jamesdumay don't need to do that ... for now, just use pipelines that don't have artifacts and we avoid this.

          Tom FENNELLY added a comment - jamesdumay don't need to do that ... for now, just use pipelines that don't have artifacts and we avoid this.

          James Dumay added a comment -

          tfennelly righto

          James Dumay added a comment - tfennelly righto

          Tom FENNELLY added a comment -

          Tom FENNELLY added a comment - Wip PRs: Part 1: https://github.com/jenkinsci/blueocean-plugin/pull/612 Part 2: https://github.com/jenkinsci/blueocean-plugin/pull/613

          James Dumay added a comment -

          What happened to the original scope of this ticket? Is there a different ticket for doing this to the run page?

          James Dumay added a comment - What happened to the original scope of this ticket? Is there a different ticket for doing this to the run page?

          Tom FENNELLY added a comment -

          There, added them back for you now

          Tom FENNELLY added a comment - There, added them back for you now

          James Dumay added a comment -

          No I meant prefetch for the run page

          James Dumay added a comment - No I meant prefetch for the run page

          Tom FENNELLY added a comment -

          I didn't add them there because I didn't think they were of any benefit. Added now.

          Tom FENNELLY added a comment - I didn't add them there because I didn't think they were of any benefit. Added now.

          James Dumay added a comment -

          Thanks tfennelly

          James Dumay added a comment - Thanks tfennelly

            tfennelly Tom FENNELLY
            jamesdumay James Dumay
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: