From 16f3fae3e171e9d344069845cac44f08cb4db2a0 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Mon, 27 Apr 2026 18:02:38 -0400 Subject: [PATCH] controllers/root: fetch jobs separately with fields filter `GET /runs//` in paddles no longer embeds full job objects in the response (see companion paddles change). Update `RunController.get_run()` to fetch jobs separately via `GET /runs//jobs/?fields=`, requesting only the fields pulpito actually needs to render the run page. This drops run page load time from 8-16s to under 1s for large runs, and prevents pulpito's CherryPy thread pool from being exhausted by slow paddles responses. Signed-off-by: David Galloway --- pulpito/controllers/root.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pulpito/controllers/root.py b/pulpito/controllers/root.py index a17429a..699fec5 100644 --- a/pulpito/controllers/root.py +++ b/pulpito/controllers/root.py @@ -139,9 +139,12 @@ def get_run(self): if 'scheduled' in run: run['scheduled_day'] = run['scheduled'].split()[0] - if 'jobs' in run: - for job in run['jobs']: - prettify_job(job) + FIELDS = 'job_id,status,description,failure_reason,duration,machine_type,os_type,os_version,log_href,name,posted,started,updated,last_in_suite,targets' + jobs_url = urljoin(base_url, '/runs/%s/jobs/?fields=%s' % (self.name, FIELDS)) + run['jobs'] = requests.get(jobs_url).json() + + for job in run.get('jobs', []): + prettify_job(job) prettify_run(run) self.run = run