feat: key BranchSummary by project name#83
Merged
Conversation
Rework BranchSummary so per-project cache data is keyed by project name via a new projects map of ProjectSummary (breakdown_id, breakdown_hash, flavor, dependency_paths), instead of the four separate SHA-keyed maps. This lets callers look a project up by its stable identity (name) rather than by content hash: the previous run's dependency paths can be fetched up front and folded into the current run's breakdown hash, and the stored breakdown_hash is compared to detect changes. The old sha_to_* maps are kept but marked deprecated so summaries written by older code can still be read (reconstruct projects by joining them on the shared SHA key); new code must not write them.
liamcervante
marked this pull request as ready for review
July 16, 2026 14:19
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
Reworks
BranchSummaryso per-project cache data is keyed by project name instead ofBreakdownSHA.The four separate SHA-keyed maps (
sha_to_id_map,sha_to_project_name_map,sha_to_flavor_map,sha_to_dependency_paths_map) are collapsed into a singlemap<string, ProjectSummary> projectskeyed by name, whereProjectSummaryholdsbreakdown_id,breakdown_hash,flavor, anddependency_paths.Why: the dependency paths are a per-project fact ("what did this project read last run"), so they want the project's stable identity (name) as the key — not a content hash. Keying by name lets a run fetch the previous run's deps up front and fold them into the freshly computed breakdown hash (no circularity), while the
breakdown_hashmoves from being the map key to a per-project value used to detect whether the project changed.Backwards compatibility
The old
sha_to_*maps are retained but marked[deprecated = true]so summaries written by older code can still be read: whenprojectsis empty, callers reconstruct it by joining the old maps on their shared SHA key (sha_to_project_name_mapsupplies each SHA's project name). New code must not write them.Notes
make.