Skip to content

refactor: migrate callsites to entity types and consolidate config#212

Closed
yushan8 wants to merge 4 commits into
yushan/storage-jsonfrom
yushan/migrate-callsites
Closed

refactor: migrate callsites to entity types and consolidate config#212
yushan8 wants to merge 4 commits into
yushan/storage-jsonfrom
yushan/migrate-callsites

Conversation

@yushan8

@yushan8 yushan8 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Controller reads entity.GetTargetGraphResponse and entity.GetChangedTargetsResponse internally, converting to proto via mapper only at stream.Send
  • Changed-targets pipeline (compareTargetGraphs, serveChangedTargetsFromCache, cacheComparedTargets, sendTrimmedChangedTargets) fully migrated to entity types
  • Removes old chunking code from core/common (ResultToGetTargetGraphResponse, ChunkMetadata, chunkTargets, splitMap, and associated tests)
  • Updates query-bench example to use mapper.ResultToTargetGraph

Test plan

  • make build && make test — all 19 test targets pass
  • Controller tests updated: proto gogio writes replaced with JSON entity encoding
  • make gazelle — BUILD files in sync

Stack

  1. feat(entity): add entity types for target graph and changed targets #210 (entity types)
  2. feat(mapper): add entity-proto mappers #211 (mappers + streaming)
  3. refactor: replace proto serialization with JSON and migrate callsites #222 (storage JSON rewrite + orchestrator + config)
  4. refactor: migrate callsites to entity types and consolidate config #212 — this PR (controller migration + cleanup)

🤖 Generated with Claude Code

@yushan8
yushan8 requested review from a team as code owners July 17, 2026 03:57
@yushan8
yushan8 marked this pull request as draft July 17, 2026 04:11
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch from 9bd4bdf to d05117c Compare July 17, 2026 05:13
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from 94857f0 to 042586a Compare July 17, 2026 05:13
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch from d05117c to 7025afd Compare July 17, 2026 16:10
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from 042586a to c367538 Compare July 17, 2026 16:10
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch from 7025afd to ecb2996 Compare July 17, 2026 17:08
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from c367538 to 24ef6fd Compare July 17, 2026 17:08
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch from ecb2996 to 36f3f33 Compare July 17, 2026 22:57
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch 2 times, most recently from 36f5b20 to 89506ef Compare July 17, 2026 23:07
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch from 36f3f33 to 91d9a76 Compare July 17, 2026 23:07
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from 89506ef to 194fded Compare July 17, 2026 23:32
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch from 91d9a76 to 9e0abdd Compare July 17, 2026 23:32
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from 194fded to cb43482 Compare July 18, 2026 00:23
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch 2 times, most recently from b621c93 to 03833f5 Compare July 20, 2026 02:03
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch 2 times, most recently from 9579e85 to db209e2 Compare July 20, 2026 03:20
@yushan8
yushan8 force-pushed the yushan/streaming-and-mappers branch 2 times, most recently from 8ba38ac to 6fc3266 Compare July 20, 2026 03:28
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from db209e2 to 6c4ce11 Compare July 20, 2026 03:28
@yushan8
yushan8 changed the base branch from yushan/streaming-and-mappers to yushan/storage-json July 20, 2026 03:28
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from 6c4ce11 to abb1587 Compare July 20, 2026 03:42
@yushan8
yushan8 force-pushed the yushan/storage-json branch from dcd9bff to 1a54757 Compare July 20, 2026 03:42
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from abb1587 to 8f18d39 Compare July 20, 2026 03:46
@yushan8
yushan8 force-pushed the yushan/storage-json branch from 1a54757 to 2252f29 Compare July 20, 2026 03:46
yushan8 and others added 4 commits July 19, 2026 21:52
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…code

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@yushan8
yushan8 force-pushed the yushan/storage-json branch from 2252f29 to 8677311 Compare July 20, 2026 04:52
@yushan8
yushan8 force-pushed the yushan/migrate-callsites branch from 8f18d39 to 3969f67 Compare July 20, 2026 04:52
@yushan8
yushan8 force-pushed the yushan/storage-json branch from 8677311 to 614cddf Compare July 20, 2026 05:27
@yushan8

yushan8 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Merged into #222 — the storage and controller changes need to land together for CI to pass.

@yushan8 yushan8 closed this Jul 20, 2026
yushan8 added a commit that referenced this pull request Jul 20, 2026
…210)

## Summary
- Add `entity.OptimizedTarget`, `entity.Metadata`, and
`entity.GetTargetGraphResponse` as compact, proto-free representations
of the target graph wire types
- Add `entity.ChangedTarget` and `entity.GetChangedTargetsResponse` for
the changed-targets path
- These entity types mirror the proto definitions but live in a
dependency-free package, preventing proto from leaking into storage,
orchestrator, and other non-transport layers

## Test plan
- [x] `make build && make test && make gazelle`

## Stack
1. **#210 — this PR** (entity types)
2. #211 (mappers + streaming)
3. #222 (storage JSON rewrite)
4. #212 (callsite migration + cleanup)

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
yushan8 added a commit that referenced this pull request Jul 20, 2026
## Summary
- Adds entity-proto mappers for target graph and changed targets
responses
- `ResultToTargetGraph` — converts `targethasher.Result` into ID-mapped
entity types
- `GetTargetGraphResponseToProto` / `ChangedTargetsResponseToProto` —
entity→proto conversions for gRPC streaming
- `ProtoToGetTargetGraphRequest` — proto→entity request conversion

This PR is addresses this comment to split up the Result -> Optimized
target entity conversion, and OptimizedTarget ->
`GetTargetGraphResponseToProto` #206.
These mappers are used to avoid leaking proto definitions into internals
such as storage and orchestrator.

## Stack
1. #224 (streaming split utilities)
2. **This PR** (entity-proto mappers)
3. #222 (storage JSON rewrite)
4. #212 (callsite migration)

## Test plan
- [x] `make build && make test && make gazelle`

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant