refactor(mapper): move cache-path helpers into internal/mapper#193
Open
yushan8 wants to merge 3 commits into
Open
refactor(mapper): move cache-path helpers into internal/mapper#193yushan8 wants to merge 3 commits into
yushan8 wants to merge 3 commits into
Conversation
4 tasks
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>
9af8885 to
08f7409
Compare
dddbffc to
ac7c716
Compare
…doc comment Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
|
I had a PR to create a cachekey package with these functions. Do you think these belong in mapper instead? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetGraphByTreeHash,GetTreehashCachePath,GetComparedTargetsCachePath,GetReqURLsHash,HashRequestOptions) fromcore/commonintointernal/mapper, entity-typed (entity.BuildDescription/entity.ComputationStrategy/entity.ChangeRequest/[]string).controller,orchestrator) still only hold protoBuildDescriptionvalues at this point, so each converts once, inline, via the existingmapper.ProtoToBuildDescriptionbefore calling the new helpers.Test plan
go build ./...go test ./controller/... ./orchestrator/... ./internal/mapper/... ./core/common/...bazel build/bazel teston the same packagesgrep -rn "buildDescriptionToProto\|computationStrategyToProto"returns nothingStack (bottom to top):
entity.GetTargetGraphRequestinorchestrator.GetTargetGraph#187