Bug 2064607

Summary: Pipeline builder makes too many (100+) API calls upfront
Product: OpenShift Container Platform Reporter: Christoph Jerolimov <cjerolim>
Component: Dev ConsoleAssignee: Karthik Jeeyar <kjeeyar>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9CC: kjeeyar, nmukherj
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:54:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2072440    
Attachments:
Description Flags
too-many-tekton-hub-api-calls.mp4 none

Description Christoph Jerolimov 2022-03-16 09:16:53 UTC
Description of problem:
When the user opens the Pipeline builder it makes over 100 API calls to https://api.hub.tekton.dev/ to get the available versions of all installable tasks. This information is not needed until the user press 'Add task' AND selects one installable task.

Version-Release number of selected component (if applicable):
4.9+

How reproducible:
Always

Steps to Reproduce:
1. Install OpenShift Pipelines operator
2. Switch to the developer perspective
3. Open the browser network inspector and filter for "api.hub.tekton.dev"
4. Navigate to Pipelines and press on "Create Pipeline"
5. Press "Cancel"
6. Press "Create Pipeline" again
7. Click on "Add task"

Actual results:
Step 4 and 6 fetches https://api.hub.tekton.dev/v1/resources
and for each task https://api.hub.tekton.dev/v1/resource/$id/versions

This happens 135 times while writing this issue and could increase in the future when new tasks are published on Tekton Hub.

Expected results:
Max. one API call to the Tekton API to pre-fetch all available tasks.

When the user selects an installable Task in the QuickSearch it should lazy fetch the available versions from the subresource.

In best case this API call will not be called when switching back and forth, but this is not required for this fix. We can also ask for a short living caching header here.

Additional info:

Comment 1 Christoph Jerolimov 2022-03-16 09:17:19 UTC
Created attachment 1866158 [details]
too-many-tekton-hub-api-calls.mp4

Comment 4 Christoph Jerolimov 2022-04-06 10:12:03 UTC
Verified on 4.11.0-0.nightly-2022-04-01-172551

Comment 7 errata-xmlrpc 2022-08-10 10:54:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069