Hive Hive
Sign in

feat(server): add cache run date filters

GitHub issue · Closed

Metadata
Source
tuist/tuist #11577
Updated
Jul 5, 2026
Domains
Kura
Details

Adds field-scoped date range filtering to the cache runs endpoint so reporting clients can request runs within a specific execution window without walking the full history.

What changed

  • Added a ran_at query filter object to the cache runs listing endpoint.
  • Supports ran_at[gt], ran_at[gte], ran_at[lt], and ran_at[lte] with Unix timestamps in seconds.
  • Invalid negative or out-of-range timestamp filters now return a bad request response with a concrete message.
  • Cache run responses now serialize ran_at from the stored ran_at value instead of deriving it from created_at.
  • Regenerated the server contract and Swift command-line client files, including handling for the new bad request response.

Why

Cache hit-rate reporting needs to ask for cache runs inside a time window. Without a date range filter, clients have to paginate through all cache run history and bound the result set themselves.

Approach

The filter shape follows the field-scoped operator style used by Stripe list filters. Applying the operator to ran_at keeps the parameter explicit today and leaves room to add other date fields later without introducing new top-level names for every range.

Impact

Clients can request cache runs by execution window while existing git reference, branch, commit, and pagination filters keep working. The generated Swift client now exposes a typed ran_at query payload and surfaces validation failures from the server.

Screenshots

Not applicable. This changes a JSON endpoint and generated command-line client files, with no browser-rendered surface to capture before and after.

How to test locally

  • mix test test/tuist_web/controllers/api/cache_runs_controller_test.exs
  • mise run generate-api-cli-code
  • tuist generate tuist ProjectDescription --no-open
  • xcodebuild build -workspace Tuist.xcworkspace -scheme tuist CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=""
  • git diff --check
Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments
T
tuist[bot] Jun 30, 2026

🛠️ Tuist Run Report 🛠️

Tests 🧪
Scheme Status Cache hit rate Tests Skipped Ran Commit
TuistAcceptanceTests 90 % 194 0 194 8933a6961
TuistUnitTests 91 % 3041 6 3035 8933a6961
Flaky Tests ⚠️
  • TuistUnitTests: 3 flaky tests (View all)
Test case Module Suite
parseTestStatuses_extractsModuleAndSuiteNames() TuistXCResultServiceTests XCResultServiceTests
parseTestWithCustomLabelXCResult() TuistXCResultServiceTests XCResultServiceTests
parseTestXCResult() TuistXCResultServiceTests XCResultServiceTests
Builds 🔨
Scheme Status Duration Commit
TuistAcceptanceTests 2m 37s 8933a6961
TuistUnitTests 3m 39s 8933a6961
F
fortmarek Jun 30, 2026

This matches Stripe’s list-filter shape (for example, created[gte]/created[lte]) rather than Stripe’s Search Query Language (query=created>…). That feels like the right level of scope here: typed, endpoint-local range filters without introducing a general query parser.