Repository navigation
fix(capabilities): list a project's builds by date and narrow the rows - #613
Conversation
list_project_builds_by_name now says how to list every build in a period in one call, that the project's display name works in the path, how rows are ordered, and that the build counts arrive on the first page only. Its build rows are narrowable, so `select` keeps a page of builds small. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
sarve-shreyas
left a comment
There was a problem hiding this comment.
Reviewed the full diff at 97d5640 against main. npm run build passes, the full vitest suite passes locally (169 files, 2642 tests), and npm run check:contract reports no new disagreements (12 / 47, same as baseline). The fixture is byte-identical to the shipped index.
No blocking issues. The guidance additions are the right ones for the "today's builds" case. Four notes inline: the default state filter versus the "every build" wording, where/limit now being unlocked but page-local, which timestamp dateRange filters on, and a few useful fields missing from the narrowable list. I couldn't verify the display-name claim beyond what the PR says was checked live; the binder encodeURIComponents the segment, so a space goes out as %20. Was a name with other punctuation (&, ., /) checked, or only spaces?
| "Takes the project's NORMALISED NAME in the path, not a numeric id. Uses the same large filter object as the build-groups listing.", | ||
| "PREFERRED build listing for agents: newest-first, `pageLimit` sets the page size (keep it at or below 50), `search` filters by build name, and rows carry buildNumber, `buildRunId` (CI run id), statusStats, historyAggregate (flaky / newFailure / alwaysFailing counts) and qualityGateStatus, so one call answers 'last N builds with status'.", | ||
| "Takes the project's normalised name in the path, not a numeric id. The display name works as is (`My Project` and `My+Project` both resolve), so no project lookup is needed first. Uses the same large filter object as the build-groups listing.", | ||
| "For builds in a period ('today', 'last night', two dates) pass `dateRange` with the window in epoch milliseconds: one call lists every build in it, including several builds with the same name. listBuildId and getBuildId return only the latest build for one name and take no date.", |
There was a problem hiding this comment.
Non-blocking: "one call lists every build in it": state defaults to active (per the query param description), so closed builds in the window are left out unless the agent also passes state. For "today's builds" an agent will read this as complete.
Suggestion: mention state here (which value returns active and closed together), or say "every active build".
Question: does dateRange filter on startedAt or createdAt, and is end inclusive? Worth one clause so an agent building a "last night" window knows which timestamp to compare against the rows.
| "activeCount", | ||
| "closedCount" | ||
| ], | ||
| "narrowable": { |
There was a problem hiding this comment.
Non-blocking: declaring narrowable unlocks where, distinct and limit as well as fields, and all of them run on the one page that came back. select: { where: { displayStatus: "failed" } } on a 10-row page reads like "the failed builds" but is "the failed builds among these 10". The narrowing echo mitigates it, but the guidance only talks about fields.
Suggestion: add to the select guidance line that where/limit apply to the returned page only, and to filter server-side with statuses / search / dateRange and page with pageLimit.
| "versionControlInfo" | ||
| ], | ||
| "path": "builds", | ||
| "note": "The endpoint has no field selection, so this narrowing is applied after the call." |
There was a problem hiding this comment.
Nit: sessionCount, closedAt and normalisedName are declared on BuildSummary but not in the narrowable list, so fields: ["sessionCount"] is refused. sessionCount in particular is useful for a triage listing.
…build listing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarve-shreyas
left a comment
There was a problem hiding this comment.
Re-reviewed 97d5640..afe8d97. Build passes, the full suite passes locally (169 files, 2642 tests), check:contract reports no new mismatches, and the fixture still matches the index.
Resolved:
state: the param now listsactive/closed/all/deleted, and thedateRangeguidance says to passallto include closed builds.dateRangenow says it matchesstartedAtand includes both ends.where/distinct/limitare documented as page-only, with server-side filters named instead.
Deferred by the author: narrowable fields nit (sessionCount etc.); punctuation in display names (only spaces were checked, so the guidance's claim holds for spaces).
No remaining blockers from my side.
sarve-shreyas
left a comment
There was a problem hiding this comment.
Approved at afe8d97. All blocking-level notes resolved; deferred by the author: narrowable-fields nit and display names with punctuation (guidance only claims spaces).
What
list_project_builds_by_name(TRA) is the capability an agent uses for "today's builds" or "the last N builds" of a project. Its contract now covers the cases agents were working around:listBuildId, which returns only the latest build for one name, or paged the 10-row public listingdateRangeto list every build in the window in one call, including several builds with the same nameMy ProjectandMy+Projectboth resolve)selectrefused, so a page of 50 builds is ~175 KBnarrowableonbuilds:selectwithfieldskeeps only the named fields, withpagingParamsand the counts keptsortOrdernot explainedAsc. There is no sort bystartedAtactiveCountand the other countsnullafter, unexplainedtests/fixtures/capability/tra.capability-index.jsonis kept identical to the shipped index.Tests
tests/tools/capabilityBuildListingSelect.test.ts:selectkeeps the named fields on every build, keepspagingParamsandactiveCount, refuses an undeclared field before the request, and leaves the response as sent withoutselect.dateRangeand the page-1 counts checked against the live API.npm run buildandnpm run check:contractpass on Node 22.🤖 Generated with Claude Code