feat(DM01-6255): add lightweight builds summary API for faster build list - #642
Merged
Conversation
…list Replace the heavy /jobs/ endpoint (one row per job with full job details) with an enhanced /builds/ endpoint that returns one aggregated row per build. The new query computes build state server-side via bool_or() aggregation and only returns the fields needed for the build list view: state, start/end dates, commit branch/author, PR info. Frontend switches _loadJobs() and loadBuilds() to the new /builds/ endpoint and adds an addBuilds store mutation to populate Build objects from the lightweight response format. For a build with 20 jobs this reduces API response size by ~90%.
- build.py: switch LEFT JOIN job to INNER JOIN so builds with no jobs (newly triggered, not yet scheduled) are excluded rather than showing a false 'finished' state - build.py: replace NOT j.restarted with j.restarted IS NOT TRUE to safely handle nullable restarted column - build.py: replace EXISTS state filter with HAVING on computed state so ?state=running correctly matches builds where jobs are queued or scheduled (not just literally 'running') - store.js: guard project._updateState() with builds.length > 0 to avoid crash when addBuilds is called with an empty response - store.js: fix ESLint indentation in new Build() constructor call - Project.js: fix getBuild() to call _loadBuild() when build is cached but has no jobs loaded, preventing empty graph on build detail page
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the heavy /jobs/ endpoint (one row per job with full job details) with an enhanced /builds/ endpoint that returns one aggregated row per build. The new query computes build state server-side via bool_or() aggregation and only returns the fields needed for the build list view: state, start/end dates, commit branch/author, PR info.
Frontend switches _loadJobs() and loadBuilds() to the new /builds/ endpoint and adds an addBuilds store mutation to populate Build objects from the lightweight response format.
For a build with 20 jobs this reduces API response size by ~90%.