Repository navigation
Pin the adcp.reporting.ledger public API before 9.0.0 GA #1490
Description
Problem
The row-storage series added 10 names to adcp.reporting.ledger.__all__, and the row_*.py modules declare 82 __all__ names between them. test_public_api_surface_matches_snapshot guards adcp, adcp.types, adcp.types._generated, and the adcp.types.domains.* packages only, so a rename, removal, or re-pointing under adcp.reporting.ledger ships without a test noticing. 9.0.0 is in beta (#1465 is the 9.0.0-beta.4 release PR), which makes this the last cheap moment to decide which of those names are public.
Evidence
All references are to main at 47084e83a.
-
src/adcp/reporting/ledger/__init__.py:__all__holds 132 names, 11 of them row-storage names:ReportingObjectRowBindingV1,ReportingPostgresRowBindingV1,ReportingRowBindingSelectionInputV1,ReportingRowIntentSweepV1,ReportingRowPage,ReportingRowPruneV1,ReportingRowStorageOptionsV1,ReportingRowStoreError,ReportingRowStoreErrorCode,recompute_revision_content_sha256, andrevision_binding_algorithm.ReportingRowPagepredates the series (feat(reporting): add the reporting.core obligation ledger and producer #1153); the other 10 were added by feat(reporting): store revision rows as verified chunks in PostgreSQL #1464, feat(reporting): write row chunks to object storage with fenced uploads #1467, and feat(reporting): sweep abandoned uploads and prune expired row sets #1469. -
src/adcp/reporting/ledger/row_*.py: 82__all__names in total (row_encoding.py24,row_storage_object.py20,row_storage.py12,row_storage_provider_io.py6,row_migration.py5,row_retention.py4,row_write.py4,row_storage_errors.py3,row_storage_gcs.py2,row_storage_azure.py1,row_storage_s3.py1). -
scripts/export_resolution.py:34-46,snapshot_modules():return ( ("adcp", "adcp"), ("adcp.types", "adcp.types"), ("adcp.types._generated", "adcp.types._generated"), *( (f"adcp.types.domains.{domain}", f"adcp.types.domains.{domain}") for domain in adcp.types.domains.DOMAINS ), )
tests/fixtures/public_api_snapshot.jsonhas exactly those keys;adcp.reportingandadcp.reporting.ledgerare absent.
Suggested fix
- Decide which of the 82 row-module names adopters are meant to import (the binding and options dataclasses, the error types, the provider factory functions, and the encoding constants are the likely set) and drop the rest from the module
__all__lists. - Add
adcp.reporting.ledger(andadcp.reportingif it has a public surface) tosnapshot_modules(), regeneratepublic_api_snapshot.jsonwithscripts/regenerate_public_api_snapshot.py, and let the existing snapshot test guard additions, removals, and re-pointings from then on.
Activity