Skip to content

Support aggregate backfills on both clients and add getAggregateBackfillJob - #218

Merged
dovie-shalev merged 2 commits into
mainfrom
dovie/get-aggregate-backfill-job
Nov 5, 2026
Merged

dovie-shalev merged 2 commits into
mainfrom
dovie/get-aggregate-backfill-job

Conversation

@dovie-shalev

@dovie-shalev dovie-shalev commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New: ChalkClient.getAggregateBackfillJob(GetAggregateBackfillJobParams) wraps AggregateService.GetAggregateBackfillJob, so you can poll a backfill's status (QUEUED, WORKING, COMPLETED, FAILED, ...).
  • HTTP support: triggerAggregateBackfill and getAggregateBackfillJob now work on the HTTP client as well as the gRPC client. Previously the HTTP client threw "only supported by the gRPC client".
AggregateBackfillJob job = client.getAggregateBackfillJob(
    GetAggregateBackfillJobParams.builder().withAggregateBackfillId(backfillId).build()
);
job.getStatus();

How

  • AggregateBackfills now runs over a small package-private AggregateRpc interface (one generic unary call(MethodDescriptor, request)) instead of a gRPC stub. The trigger logic (V2, legacy fallback, error wrapping) and the new get logic are shared by both clients.
  • gRPC client: AggregateRpc.grpc(stub), using the existing AggregateService stub. No behavior change.
  • HTTP client: calls the same RPCs with the Connect protocol. It POSTs application/proto to {apiServer}/chalk.aggregate.v1.AggregateService/<Method> through the existing RequestHandler, so auth, 401 refresh and timeouts are reused. The API server mounts AggregateService as a Connect handler, and the chalk aggregate backfill CLI already calls it this way. Headers mirror the gRPC client's AggregateService calls: x-chalk-server: go-api, env, and no deployment-routing headers.
  • Connect errors ({"code": "invalid_argument", ...}) decode to the same StatusRuntimeException codes gRPC throws, so the UNIMPLEMENTED fallback and error wrapping behave identically on both clients.
  • SendRequestParams gains headers (override defaults; null removes) and returnErrorResponses (so the caller can read the Connect error body).
  • ChalkClient: both methods are now abstract, like the other methods both clients implement. Any third-party ChalkClient implementation must add them.

Testing

  • TestAggregateBackfillClient: the HTTP test now runs trigger and get against a fake Connect server. It checks the path, application/proto, auth and env headers, x-chalk-server, and that an invalid_argument error surfaces as AggregateBackfillException. The gRPC test also covers get.
  • ./gradlew test: all tests that don't need credentials pass. TestAllClients, TestChalkClient, TestChalkClientDeploymentTag and TestGrpcClient need CHALK_CLIENT_ID/CHALK_CLIENT_SECRET, which CI provides.
  • Not yet verified against a live API server. The Connect path matches the CLI's, but a quick getAggregateBackfillJob with the HTTP client against a real environment would confirm it.

🤖 Generated with Claude Code

dovie-shalev and others added 2 commits November 5, 2026 09:00
Wraps AggregateService.GetAggregateBackfillJob so callers can poll a backfill
started with triggerAggregateBackfill. gRPC client only, like the trigger call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
triggerAggregateBackfill and getAggregateBackfillJob now work on both clients.
AggregateBackfills runs over a small AggregateRpc transport: the gRPC client
uses its AggregateService stub, and the HTTP client calls the same RPCs with
the Connect protocol, which the API server accepts over plain HTTP (as the
chalk CLI does). Connect errors decode to the same status codes as gRPC, so
the V2 fallback and error wrapping behave identically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dovie-shalev dovie-shalev changed the title Add getAggregateBackfillJob to poll aggregate backfill status Support aggregate backfills on both clients and add getAggregateBackfillJob Nov 5, 2026
@dovie-shalev
dovie-shalev marked this pull request as ready for review November 5, 2026 19:47
@dovie-shalev
dovie-shalev merged commit c6b252f into main Nov 5, 2026
1 check 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.

2 participants