Skip to content

feat(reporting): Azure Blob provider for object row bindings - #3166

Merged
bokelley merged 1 commit into
bokelley/reporting-s3-row-providerfrom
bokelley/reporting-azure-row-provider
Oct 8, 2026
Merged

bokelley merged 1 commit into
bokelley/reporting-s3-row-providerfrom
bokelley/reporting-azure-row-provider

Conversation

@bokelley

@bokelley bokelley commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Stacked on #3164 (S3 provider). Third of three cloud providers for the shared SDK persistence spec (adcontextprotocol/adcp#7996 §3.4).

What

New subpath @adcp/sdk/reporting/azure exporting createAzureBlobReportingRowObjectProviderV1({ client, clients }), with a new optional peer @azure/storage-blob (^12.23.0). The provider only imports types from the SDK, because the host injects BlobServiceClient instances. Loading the subpath therefore never loads the Azure SDK. The devDependency is pinned to ~12.32.0, the last line with engines.node >=20, since CI runs Node 20. The emulator test is the only place the SDK is loaded.

  • Location / clients: closed { account, container }; the account name and container name are validated. The client chosen by credentialRef must report accountName === location.account, else UNSAFE_BINDING. The endpoint and credentials come only from the client.
  • putIfAbsent: block-blob upload with conditions: { ifNoneMatch: '*' }, content type, no-store, and no content encoding. Metadata names are converted to C# identifiers (adcp-intent → adcp_intent) because Azure rejects hyphens. A 409 BlobAlreadyExists or a 412 triggers getProperties and returns created: false.
  • nativeVersion: the versionId when blob versioning is enabled, else the quoted ETag.
  • get: withVersion(versionId) or conditions.ifMatch, plus download(offset, count). The contentLength check and the streaming cap both enforce maxBytes. 404/412, and a 400 for a malformed version, read as null. A response that does not echo the pinned versionId/ETag also reads as null. Azurite ignores versionid, and this check is what made conformance pass against it. 416 → ROWS_INTEGRITY_FAILED.
  • delete:
    • ETag versions: delete({ conditions: { ifMatch } }); 404/412 → absent.
    • Version IDs: the provider first confirms the store echoes that exact version.
    • If that version is still current, the base blob is deleted with ifMatch on the current ETag, which turns it into a previous version.
    • The version itself is then deleted. This works whether or not the service allows deleting the current version by versionid, and repeat deletes are idempotent.
  • probe: the container must exist (404/401/403 → UNSAFE_BINDING) and must not have blobPublicAccess set. It then runs an empirical create-only check: upload a probe blob twice with If-None-Match: * and require the second upload to fail with 409/412. The probe blob and its versions are cleaned up.
  • Deadlines: abortSignal is passed on every call, and the shared helper settles on abort. Raw RestErrors, whose URLs can carry SAS tokens, never escape.

Tests

  • test/lib/reporting-azure-row-provider.test.js (12 tests) uses an in-memory fake of the BlobServiceClient surface in both versioned and unversioned modes. The fake refuses to delete the current version by version ID, the conservative assumption. Tests cover:
    • conformance, with all blobs and versions cleaned up;
    • the If-None-Match write, content headers and identifier-safe metadata;
    • adopt on 409 and on 412;
    • version and ETag pinning, ranges, and the byte cap with and without contentLength;
    • a store that ignores versionid never serves or deletes another version;
    • exact and idempotent deletes;
    • probe refusals: missing, public, forbidden, wrong account, and a store that ignores If-None-Match;
    • the closed credentialRef map, endpoint/SAS fields rejected in location, secret-free errors, and deadline/abort.
  • Opt-in emulator test (not in CI): REPORTING_AZURE_TEST_CONNECTION_STRING=UseDevelopmentStorage=true node --test test/lib/reporting-azure-row-provider.test.js. Passed locally against Azurite 3.37 (azurite-blob --inMemoryPersistence).
  • Ran by hand (not committed): a full engine round trip on local PostgreSQL through the real client against Azurite, with gzip and uncompressed (ranged) bindings.
  • Clean build:lib, typecheck, publint --strict, arethetypeswrong (no problems; covers reporting/gcs, reporting/s3 and reporting/azure), and check-package-size (+4 files; bytes within the existing budget) all pass.

Risks

  • Azure lifecycle management policies are account-level ARM resources and cannot be read from the data-plane client, so the probe cannot refuse them. The docs say so.
  • Versioned-path deletes were tested only against the fake: Azurite does not implement blob versioning.
  • Unversioned containers have the same ETag-identifies-content caveat as S3.

🤖 Generated with Claude Code

Add the @adcp/sdk/reporting/azure subpath with
createAzureBlobReportingRowObjectProviderV1({ client, clients }), backed by
the new optional peer @azure/storage-blob (type-only import; the host
injects BlobServiceClient instances).

- location { account, container }; the selected client must belong to the
  bound account; endpoint and credentials come only from the client.
- putIfAbsent: block-blob upload with If-None-Match: *; 409
  BlobAlreadyExists / 412 -> getProperties adopts the existing blob.
- nativeVersion: versionId when blob versioning is enabled, else the quoted
  ETag; reads (ranged, byte-capped) and deletes pin it and only count a
  response that echoes that exact version.
- delete: ETag-conditional, or for versions: confirm the version, delete the
  base blob if it is still that version, then delete the version.
- probe: container exists, no anonymous access, and an empirical
  create-only check with a probe blob under the prefix.
- Metadata names are stored as C# identifiers (adcp-intent -> adcp_intent).

An opt-in emulator test (REPORTING_AZURE_TEST_CONNECTION_STRING) runs the
conformance suite through the official client; verified locally against
Azurite.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ladon verdict: Approve

Approve.

Adds @adcp/sdk/reporting/azure Blob row-object provider (new src/lib/reporting/azure/index.ts), mirroring the vetted S3 provider and sharing row-storage-provider-io helpers.

What I checked:

  • Changeset present and correct (minor, additive new subpath) — satisfies changeset-vs-wire-impact.
  • Official @azure/storage-blob client only, injected by host; no custom HTTP/SSE reimplementation.
  • package.json exports/typesVersions dual-format wiring matches s3/gcs; tsup glob auto-includes the new file; check-package-size.mjs bumped +4.
  • Operational readiness: every blob call forwards abortSignal; errors mapped to PROVIDER_UNAVAILABLE; probe cleanup best-effort/abort-aware.
  • Correctness: version pinning refuses stores that ignore versionid; versioned delete dance and create-only probe verified; ACCOUNT/CONTAINER regexes reject malformed inputs.
  • Witness-not-translator: no fabricated/normalized wire data.

No blocking or medium findings. No high-risk flag, no gated paths, no author team gate. Falls through to row 9.

@bokelley
bokelley force-pushed the bokelley/reporting-s3-row-provider branch from 0016fe1 to 31f9bed Compare October 8, 2026 16:47
@bokelley
bokelley force-pushed the bokelley/reporting-azure-row-provider branch from 7919df7 to 2f4bf27 Compare October 8, 2026 16:49
@bokelley
bokelley merged commit 5bbe487 into bokelley/reporting-s3-row-provider Oct 8, 2026
3 of 4 checks passed
@bokelley
bokelley deleted the bokelley/reporting-azure-row-provider branch October 8, 2026 16:50

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ladon verdict: Approve

Approve — new @adcp/sdk/reporting/azure provider ports the approved S3 provider to Azure Blob with no blocking or medium findings.

What I checked:

  • No findings of any severity from the reviewer (clean approve).
  • gated_paths: false and review_decision: APPROVED — no hard approval gate blocks this.
  • high_risk: false; no no-auto-approve team match.
  • Changeset present (.changeset/reporting-azure-row-provider.md), minor/additive, matching the new subpath export, typesVersions, package-size budget, and optional peer dep — satisfies changeset-vs-wire-impact.
  • Provider is a witness: create-only writes (If-None-Match: *), version-pinned reads/deletes that require the store to echo the exact version, empty-range and version-ignoring-store paths fail closed to null — no fabrication/re-shaping.
  • Errors route through runReportingRowProviderOperation with secret-free codes and abort/deadline propagation; every I/O call carries abortSignal.
  • Tests are comprehensive (versioned/unversioned conformance, byte caps, closed credential map, secret-free RestError mapping, abort propagation, emulator opt-in).

Prior decision was also approve on an earlier head; no new findings. Decision table: rows 1–8 do not fire → row 9 approve.

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.

1 participant