feat: filter builds by CI build id - #355
Merged
pashidlos merged 1 commit intoJul 27, 2026
Merged
Conversation
Add an optional ciBuildId query param to GET /builds. It matches a case insensitive substring and is applied to both the count and the page query, so pagination stays consistent with the filtered result.
pashidlos
merged commit Jul 27, 2026
267bb23
into
Visual-Regression-Tracker:master
1 of 2 checks passed
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.
What & why
GET /buildsonly supports pagination, so finding a specific run in a project with a long history means paging through the build list. This adds an optional server-side filter on the CI build id, which the UI can use to search the whole history instead of the loaded page.Changes
ciBuildIdquery param onGET /builds. It matches a case-insensitive substring (contains+mode: insensitive).whereclause is built once and passed to bothcountandfindMany, sototalstays consistent with the filtered page and pagination doesn't lie.@ApiQuery({ required: false }).No schema change and no new index:
ILIKE '%x%'can't use the existing@@unique([projectId, ciBuildId])b-tree anyway, and the scan is bounded by one project's builds (defaultmaxBuildAllowedis 100).Notes for reviewers
Prisma's
containsdoes not escape LIKE wildcards, so%and_typed by a user act as wildcards. That's a false-positive match, not an injection — the query stays parameterised. Happy to escape them if you'd prefer strict literal matching.Testing
npm run buildandeslintclean.findManycases (filter applied to both queries; empty value ignored).REGRESSION→ 10 (case-insensitive),19.5→ 2, no match → 0, empty value → unfiltered, invalidprojectId→ 400.Screenshots
Screen.Recording.2026-07-27.at.11.11.14.mov