Skip to content

Comments

Stg102/datalake tags#48057

Open
browndav-msft wants to merge 25 commits intoAzure:feature/storage/stg102basefrom
browndav-msft:stg102/datalakeTags
Open

Stg102/datalake tags#48057
browndav-msft wants to merge 25 commits intoAzure:feature/storage/stg102basefrom
browndav-msft:stg102/datalakeTags

Conversation

@browndav-msft
Copy link
Member

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Feb 20, 2026
…n DataLakeTestBase

This matches the behavior in BlobBaseTest https://github.com/Azure/azure-sdk-for-java/blob/a86d1fbe0002f087552c78e32df5447665d53939/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobTestBase.java#L202
- This adds x-ms-blob-if-modified/unmodified. Four tests use NEW_DATE and OLD_DATE, which change the date in the header. We can't change this because the data comes from a supplier that is used by other tests and the other tests pass.
- The reason we have to do this is because getTagsWithResponse and setTagsWithResponse both delegate to blockBlobClient, which uses  instead of  like the rest of DFS.
@github-actions
Copy link
Contributor

API Change Check

APIView identified API level changes in this PR and created the following API reviews

com.azure:azure-storage-file-datalake

@browndav-msft browndav-msft changed the base branch from main to feature/storage/stg102base February 23, 2026 20:16
@ibrandes ibrandes marked this pull request as ready for review February 24, 2026 23:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR cherry-picks the “Datalake tags” work into this branch, adding tag support to the Data Lake path APIs (directory/file) and updating SAS permission models and tests accordingly.

Changes:

  • Added getTags/setTags APIs (sync + async) for Data Lake paths, with request-conditions options types.
  • Extended SAS permission models/tests to support tags permission (t).
  • Added/updated directory tag tests (including OAuth, lease, and SAS scenarios) and test utilities.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/DirectoryApiTests.java Adds coverage for get/set tags across auth/lease/SAS scenarios and access-condition cases.
sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/DataLakeTestBase.java Adds a helper to generate tags and updates test playback matching headers.
sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/DataLakeServiceSasModelsTests.java Updates SAS permission parse/toString tests to include tags permission.
sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/PathSasPermission.java Adds t (tags) permission support to path SAS permission model.
sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/sas/FileSystemSasPermission.java Adds t (tags) permission support to filesystem SAS permission model.
sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeSetTagsOptions.java Introduces options bag for set-tags including request conditions.
sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/DataLakeGetTagsOptions.java Introduces options bag for get-tags including request conditions.
sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java Adds sync getTags/setTags APIs delegating to the underlying blob client.
sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java Adds async getTags/setTags APIs delegating to the underlying blob async client.
sdk/storage/azure-storage-file-datalake/assets.json Updates assets tag for test recordings/assets.

Comment on lines +3830 to +3835
public void getTagsAC() {
Map<String, String> t = getTags();
dc.setTags(t);

String leaseID = setupPathLeaseCondition(dc, RECEIVED_LEASE_ID);
DataLakeRequestConditions dac = new DataLakeRequestConditions().setLeaseId(leaseID);
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

getTagsAC is annotated as a @ParameterizedTest with a @MethodSource("modifiedMatchAndLeaseIdSupplier"), but the test method doesn't declare any parameters. JUnit will fail to resolve arguments at runtime. Either remove @ParameterizedTest/@MethodSource (make it a regular @Test) or add the expected parameters and use them to populate the DataLakeRequestConditions (similar to setTagsAC).

Suggested change
public void getTagsAC() {
Map<String, String> t = getTags();
dc.setTags(t);
String leaseID = setupPathLeaseCondition(dc, RECEIVED_LEASE_ID);
DataLakeRequestConditions dac = new DataLakeRequestConditions().setLeaseId(leaseID);
public void getTagsAC(OffsetDateTime modified, OffsetDateTime unmodified, String match, String noneMatch,
String leaseID) {
Map<String, String> t = getTags();
dc.setTags(t);
DataLakeRequestConditions dac = new DataLakeRequestConditions()
.setLeaseId(setupPathLeaseCondition(dc, leaseID))
.setIfMatch(setupPathMatchCondition(dc, match))
.setIfNoneMatch(noneMatch)
.setIfModifiedSince(modified)
.setIfUnmodifiedSince(unmodified);

Copilot uses AI. Check for mistakes.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> setTags(Map<String, String> tags) {
return this.setTagsWithResponse(new DataLakeSetTagsOptions(tags)).map(Response::getValue);
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

setTags returns Mono<Void> but maps Response::getValue, which will be null for Response<Void>. Reactor doesn't allow emitting null, so this will likely fail with an NPE when subscribed. Use the same pattern as other void-returning APIs in this client (e.g., setMetadata): convert the Mono<Response<Void>> to a completion-only Mono<Void> (such as flatMap(FluxUtil::toMono) or then()).

Suggested change
return this.setTagsWithResponse(new DataLakeSetTagsOptions(tags)).map(Response::getValue);
return this.setTagsWithResponse(new DataLakeSetTagsOptions(tags))
.flatMap(FluxUtil::toMono);

Copilot uses AI. Check for mistakes.

private static Stream<Arguments> sasPermissionsToStringSupplier() {
return Stream.of(
// read | write | delete | create | add | list | move | execute | owner | permission || expectedString
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The argument table comment above sasPermissionsToStringSupplier() doesn't reflect the added tag parameter/column anymore. Updating it to include the tag flag will keep the test data easier to read and maintain.

Suggested change
// read | write | delete | create | add | list | move | execute | owner | permission || expectedString
// read | write | delete | create | add | list | move | execute | owner | permission | tag || expectedString

Copilot uses AI. Check for mistakes.
Copy link
Member

@ibrandes ibrandes left a comment

Choose a reason for hiding this comment

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

looks good, just a couple small suggestions. copilot had some relevant comments too

* Extended options that may be passed when getting tags for a path.
*/
@Fluent
public class DataLakeGetTagsOptions {
Copy link
Member

Choose a reason for hiding this comment

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

We can make this final; from the wise words of the azure sdk api view bot, "Consider making all classes final by default - only make non-final if subclassing is supported."

* Extended options that may be passed when setting tags for a path.
*/
@Fluent
public class DataLakeSetTagsOptions {
Copy link
Member

Choose a reason for hiding this comment

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

Also can be final.

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

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants