oscerd opened a new pull request, #23554:
URL: https://github.com/apache/camel/pull/23554
## Motivation
CAMEL-23330 added the read-path `CamelAzureStorageBlobVersionId` header so
`getBlob`,
`downloadBlobToFile` and `downloadLink` can target a specific version of a
blob when
versioning is enabled on the storage account. There was, however, no
operation to
**list** the versions of a blob — needed for auditing and compliance
scenarios where
the full version history must be inspectable. The Azure SDK supports this via
`BlobContainerClient.listBlobs()` with
`BlobListDetails.setRetrieveVersions(true)`,
but the Camel component did not expose it.
## What this changes
Adds a new container-level producer operation `listBlobVersions` that:
- Reuses the same `ListBlobsOptions` plumbing as `listBlobs` (so the existing
`prefix`, `regex` and `maxResultsPerPage` options/headers all still apply).
- Forces `BlobListDetails.setRetrieveVersions(true)` before issuing the
request,
preserving any other `BlobListDetails` flags the caller already set via the
`CamelAzureStorageBlobListDetails` header.
- Returns a `List<BlobItem>` where each item carries its own `versionId` and
`isCurrentVersion` flag, populated by the Azure SDK.
Implemented as a separate operation (rather than a flag on `listBlobs`)
because
the result shape differs from `listBlobs` (one row per version vs. one row
per
blob), which matches how the rest of the API treats shape-changing variants
(`findBlobsByTags`, `createBlobSnapshot`, etc.).
## Files touched
- `BlobOperationsDefinition` — new `listBlobVersions` enum value
(container-level).
- `BlobContainerOperations` — new `listBlobVersions(Exchange)`.
- `BlobProducer` — switch case wired to the new operation.
- `BlobContainerOperationsTest` — two new mock-based tests (basic + regex),
with
an `ArgumentCaptor` to assert `retrieveVersions=true` actually reaches the
request.
- `azure-storage-blob-component.adoc` — operation table row + example block.
- `camel-4x-upgrade-guide-4_21.adoc` — new-feature note for 4.21.
- Regenerated: `azure-storage-blob.json` catalog metadata and component
metadata
(picked up by a full reactor build from root, as required by the CI regen
guard).
## Compatibility
Additive only:
- `BlobOperationsDefinition` is an enum — adding a value is
backward-compatible.
- `BlobContainerOperations.listBlobVersions` is a new public method on a
class
that is part of the component's public API surface.
- No existing operation behaviour changes.
## Test plan
- [x] Unit tests pass: `mvn test -Dtest=BlobContainerOperationsTest` (6/6,
including the two new tests).
- [x] Module build clean: `mvn -DskipTests install` in
`components/camel-azure/camel-azure-storage-blob`.
- [x] Full reactor build from root clean: `mvn clean install -DskipTests`
(regen artifacts committed in the same commit).
- [ ] Integration tests against a versioning-enabled storage account are not
included; the existing `BlobContainerOperationsIT` exercises the live
`listBlobs` path. Happy to add an IT in a follow-up if reviewers
prefer.
## Related
- JIRA: https://issues.apache.org/jira/browse/CAMEL-23342
- Builds on CAMEL-23330 (read-path version targeting).
---
_Claude Code on behalf of Andrea Cosentino_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]