Skip to content

fix(capabilities): list a project's builds by date and narrow the rows - #613

Merged
Dave3130 merged 2 commits into
browserstack:mainfrom
SavioBS629:fix/build-listing
Nov 27, 2026
Merged

Dave3130 merged 2 commits into
browserstack:mainfrom
SavioBS629:fix/build-listing

Conversation

@SavioBS629

Copy link
Copy Markdown
Collaborator

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:

Before After
Builds in a period Not described. Agents walked listBuildId, which returns only the latest build for one name, or paged the 10-row public listing Guidance: pass dateRange to list every build in the window in one call, including several builds with the same name
Project name The path is described as the normalised name, so agents looked the project up first The display name works as is (My Project and My+Project both resolve)
Row size About 3.5 KB per build and select refused, so a page of 50 builds is ~175 KB Rows are narrowable on builds: select with fields keeps only the named fields, with pagingParams and the counts kept
Order sortOrder not explained Rows are ordered by internal build id, which follows creation order: newest first by default, oldest first with Asc. There is no sort by startedAt
activeCount and the other counts Present on page 1, null after, unexplained They count the whole filtered result and are sent on page 1 only, by design; read them there

tests/fixtures/capability/tra.capability-index.json is kept identical to the shipped index.

Tests

  • tests/tools/capabilityBuildListingSelect.test.ts: select keeps the named fields on every build, keeps pagingParams and activeCount, refuses an undeclared field before the request, and leaves the response as sent without select.
  • Display-name paths, dateRange and the page-1 counts checked against the live API.
  • npm run build and npm run check:contract pass on Node 22.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto (fallback from Default branch)
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited), Workspace UI (inherited); Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 34961dcf-3c4b-43d6-ab76-2c440bfa6d17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@sarve-shreyas sarve-shreyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread capability/tra.capability-index.json Outdated
"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.",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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": {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sarve-shreyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 lists active / closed / all / deleted, and the dateRange guidance says to pass all to include closed builds.
  • dateRange now says it matches startedAt and includes both ends.
  • where / distinct / limit are 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 sarve-shreyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at afe8d97. All blocking-level notes resolved; deferred by the author: narrowable-fields nit and display names with punctuation (guidance only claims spaces).

@Dave3130
Dave3130 merged commit 19d421a into browserstack:main Nov 27, 2026
4 checks passed
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.

3 participants