Skip to content

Add shared EnsureGeometry to storage/internal - #1220

Open
roger2hk wants to merge 1 commit into
transparency-dev:mainfrom
roger2hk:ensure-geometry-api
Open

roger2hk wants to merge 1 commit into
transparency-dev:mainfrom
roger2hk:ensure-geometry-api

Conversation

@roger2hk

Copy link
Copy Markdown
Contributor

This PR only adds the shared API. Nothing calls it yet:

  • PartialResourceIO: the tile and entry bundle I/O, provided by each storage implementation.
  • EnsureGeometry: ported from storage/posix (ensureGeometry, ensurePartialBundle, ensurePartialTile, maxLevel).
  • MarshalTlogEntryBundle: ported from storage/posix (marshalTlogEntryBundle).

Differences from the existing POSIX implementation:

  • I/O is injected via PartialResourceIO.
  • The existence check uses an exact read instead of stat. These reads must not fall back to the full resource, as LogReader.ReadTile/ReadEntryBundle do. Otherwise, whenever the tree's tile is already full, a missing partial is never created.
  • Source resources are length-checked before truncation, so short or corrupt data returns an error instead of panic.
  • Errors are wrapped with %w.

The next few PRs will wire POSIX and GCP to this new API.

@roger2hk
roger2hk requested a review from AlCutter October 12, 2026 14:34
@roger2hk
roger2hk requested a review from a team as a code owner October 12, 2026 14:34
@roger2hk roger2hk added the technical debt Cleanup or other forms of technical debt label Oct 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical debt Cleanup or other forms of technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants