Skip to content

refactor(mapper): move cache-path helpers into internal/mapper#193

Open
yushan8 wants to merge 3 commits into
entity/domain-typesfrom
entity/cache-path-helpers
Open

refactor(mapper): move cache-path helpers into internal/mapper#193
yushan8 wants to merge 3 commits into
entity/domain-typesfrom
entity/cache-path-helpers

Conversation

@yushan8

@yushan8 yushan8 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move cache-path helpers (GetGraphByTreeHash, GetTreehashCachePath, GetComparedTargetsCachePath, GetReqURLsHash, HashRequestOptions) from core/common into internal/mapper, entity-typed (entity.BuildDescription / entity.ComputationStrategy / entity.ChangeRequest / []string).
  • Callers (controller, orchestrator) still only hold proto BuildDescription values at this point, so each converts once, inline, via the existing mapper.ProtoToBuildDescription before calling the new helpers.

Test plan

  • go build ./...
  • go test ./controller/... ./orchestrator/... ./internal/mapper/... ./core/common/...
  • bazel build/bazel test on the same packages
  • grep -rn "buildDescriptionToProto\|computationStrategyToProto" returns nothing

Stack (bottom to top):

  1. feat(entity): add domain types for BuildDescription and GetTargetGraphRequest #189
  2. @ refactor(mapper): move cache-path helpers into internal/mapper #193
  3. refactor(repomanager): entity-type RepoManager.Lease #192
  4. refactor(orchestrator): accept entity.GetTargetGraphRequest in orchestrator.GetTargetGraph #187

Cache-path helpers (GetGraphByTreeHash, GetTreehashCachePath,
GetComparedTargetsCachePath, GetReqURLsHash, HashRequestOptions) move from
core/common into internal/mapper, retyped for entity.BuildDescription /
entity.ComputationStrategy / entity.ChangeRequest / []string instead of
tangopb types.

Callers (controller, orchestrator) still only hold proto BuildDescription
values at this point, so each converts once, inline, via the existing
mapper.ProtoToBuildDescription before calling the new helpers. RepoManager.Lease
and the Orchestrator interface are unchanged in this commit — no entity->proto
bridge is introduced or ever needed, since the conversion only ever goes
proto->entity.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@yushan8 yushan8 force-pushed the entity/domain-types branch from 9af8885 to 08f7409 Compare July 13, 2026 06:08
@yushan8 yushan8 force-pushed the entity/cache-path-helpers branch from dddbffc to ac7c716 Compare July 13, 2026 06:09
yushan8 and others added 2 commits July 12, 2026 23:28
…doc comment

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@justinwon777

Copy link
Copy Markdown
Contributor

I had a PR to create a cachekey package with these functions. Do you think these belong in mapper instead?

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