Skip to content

feat: key BranchSummary by project name#83

Merged
liamcervante merged 1 commit into
mainfrom
liamcervante/branch-summary-by-project-name
Jul 17, 2026
Merged

feat: key BranchSummary by project name#83
liamcervante merged 1 commit into
mainfrom
liamcervante/branch-summary-by-project-name

Conversation

@liamcervante

Copy link
Copy Markdown
Contributor

Summary

Reworks BranchSummary so per-project cache data is keyed by project name instead of BreakdownSHA.

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 single map<string, ProjectSummary> projects keyed by name, where ProjectSummary holds breakdown_id, breakdown_hash, flavor, and dependency_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_hash moves 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: when projects is empty, callers reconstruct it by joining the old maps on their shared SHA key (sha_to_project_name_map supplies each SHA's project name). New code must not write them.

Notes

  • Generated Go/TS regenerated via make.

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
liamcervante marked this pull request as ready for review July 16, 2026 14:19
@liamcervante
liamcervante requested a review from a team July 16, 2026 14:19

@liamg liamg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner 👍

@liamcervante
liamcervante merged commit f178349 into main Jul 17, 2026
2 checks passed
@liamcervante
liamcervante deleted the liamcervante/branch-summary-by-project-name branch July 17, 2026 08:15
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