Skip to content

feat(DM01-6255): add lightweight builds summary API for faster build list - #642

Merged
liuwei08 merged 2 commits into
masterfrom
feat/DM01-6255
Sep 9, 2026
Merged

feat(DM01-6255): add lightweight builds summary API for faster build list#642
liuwei08 merged 2 commits into
masterfrom
feat/DM01-6255

Conversation

@liuwei08

@liuwei08 liuwei08 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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%.

…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
@liuwei08

liuwei08 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

@liuwei08
liuwei08 merged commit 66bec5e into master Sep 9, 2026
2 checks passed
@liuwei08
liuwei08 deleted the feat/DM01-6255 branch September 9, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant