Loading
fix: deal with GitLab graphql timeouts with smaller faster queries
Problem
Listing all Renovate MRs (when no single project is selected) almost always timed out, even when only a handful of rows were requested. Two separate causes:
- Query complexity — the old all-projects query fetched the heavy per-MR
fields (
headPipeline,labels,approved,detailedStatus, …) acrosscurrentUser.reviewRequestedMergeRequestsfor every project at once, blowing past GitLab's GraphQL complexity/timeout limits. - Label join — filtering with
labelName: "maintenance::dependency"forced an expensive label join on the GitLab side that timed out regardless of page size.
Changes to avoid timeouts
-
Compose the list per-project instead of one big query. When no project filter is set, we now:
- Discover which projects have open Renovate MRs via a lightweight query that
selects only
project { fullPath }+labels(no heavy nested fields), paged client-side. - Iterate those projects sequentially, running the proven per-project
query and accumulating MRs until
n(the page size) rows are collected, or all projects are exhausted. Each query is bounded to a single project, so it stays well under the complexity limit.
- Discover which projects have open Renovate MRs via a lightweight query that
selects only
-
Drop
labelNamefrom both queries; filter themaintenance::dependencylabel client-side. This removes the slow server-side label join. Filtering is done in JS viahasRenovateLabel(), and the per-project fetch pages within each project (bounded byMAX_PAGES_PER_PROJECT) so matching MRs sitting below non-Renovate ones aren't missed. -
The single-project filter path also filters by label client-side, since that query is no longer label-scoped either.
Behaviour notes
- The composed list is grouped by project (each project's MRs in
UPDATED_DESC), not globally sorted across projects. n(page size) is a hard cap in compose mode; Reload re-runs composition from the top (cross-project Next/Previous is disabled).
Also included
- Configure mise to load env vars/secrets from the gitignored
.envfile.
Verification
npm run buildpasses (type-check + lint).- Manual: load with no project filter and confirm rows populate without a timeout at various page sizes.
Edited by Andrew Newdigate