Conversation
* bump latest service version from 2026_04_06 to 2026_06_06 for stg102 * refactor transformutils to use switch * made changes based on comments
- filePropertySemantics was not getting passed as an arg for the function in ShareDirectoryClient or ShareDirectoryAsyncClient - created recordings for the new tests
There was a problem hiding this comment.
Pull request overview
Reintroduces the “create file with initial content” and “file property semantics” support (previously pulled) for Azure Storage File Share, while also bumping storage service versions to 2026-06-06 across related modules.
Changes:
- Add
filePropertySemanticsandBinaryDatapayload support back intoShareFileCreateOptionsand wire it through sync/async create calls. - Add
filePropertySemanticssupport back intoShareDirectoryCreateOptionsand wire it through sync/async create calls. - Update service version enums/defaults/tests to
2026-06-06and re-enable the previously pulled tests.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/azure-storage-queue/src/main/java/com/azure/storage/queue/QueueServiceVersion.java | Add 2026-06-06 service version and set it as latest. |
| sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileAsyncApiTests.java | Re-enable async tests for create-with-data and property semantics; bump required version. |
| sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java | Re-enable sync tests for create-with-data and property semantics; bump required version. |
| sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java | Re-enable async directory tests for property semantics; bump required version. |
| sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java | Re-enable sync directory tests for property semantics; bump required version. |
| sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareFileCreateOptions.java | Restore filePropertySemantics + BinaryData fields and accessors. |
| sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareDirectoryCreateOptions.java | Restore filePropertySemantics field and accessors. |
| sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceVersion.java | Add 2026-06-06 service version and set it as latest. |
| sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileClient.java | Wire filePropertySemantics + initial data into sync create request. |
| sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareFileAsyncClient.java | Wire filePropertySemantics + initial data into async create request and MD5 handling. |
| sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java | Wire filePropertySemantics into sync directory create request. |
| sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java | Wire filePropertySemantics into async directory create requests. |
| sdk/storage/azure-storage-file-share/assets.json | Update assets tag reference. |
| sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/TransformUtils.java | Refactor version conversion logic and add 2026-06-06 mapping. |
| sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceVersion.java | Add 2026-06-06 service version and set it as latest. |
| sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/UploadUtils.java | Restore sync computeMd5(ByteBuffer, ...) helper. |
| sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/Constants.java | Bump default SAS service version/target version string to 2026-06-06. |
| sdk/storage/azure-storage-common/ci.system.properties | Update CI system properties to use 2026-06-06. |
| sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceVersion.java | Add 2026-06-06 service version and set it as latest. |
| smbPropertiesLocal.getFileChangeTimeString(), requestConditionsLocal.getLeaseId(), | ||
| filePosixPropertiesLocal.getOwner(), filePosixPropertiesLocal.getGroup(), | ||
| filePosixPropertiesLocal.getFileMode(), filePosixPropertiesLocal.getFileType(), fluxMD5wrapper.getMd5(), | ||
| filePropertySemantics, contentLength, binaryData != null ? binaryData.toFluxByteBuffer() : null, |
There was a problem hiding this comment.
This computes MD5 from binaryData.toFluxByteBuffer() and then separately passes binaryData.toFluxByteBuffer() as the request body. That results in multiple reads/subscriptions of the underlying content and can break for non-replayable BinaryData (or produce a Content-MD5 that doesn't match the uploaded bytes). Prefer materializing/replaying the data once (e.g., make it replayable first) and then use the same data source for both MD5 computation and the request body.
| filePropertySemantics, contentLength, binaryData != null ? binaryData.toFluxByteBuffer() : null, | |
| filePropertySemantics, contentLength, fluxMD5wrapper.getFlux(), |
| @@ -215,31 +217,31 @@ public FilePropertySemantics getFilePropertySemantics() { | |||
| * | |||
| * @param filePropertySemantics {@link FilePropertySemantics} | |||
| * @return The updated options. | |||
|
|
|||
| */ | |||
| public ShareFileCreateOptions setFilePropertySemantics(FilePropertySemantics filePropertySemantics) { | |||
| this.filePropertySemantics = filePropertySemantics; | |||
| return this; | |||
| } | |||
There was a problem hiding this comment.
setFilePropertySemantics is a public API but its comment is a non-Javadoc block (/* ... */). This breaks consistency with the rest of the options class and may omit it from generated API docs. Please convert it to proper JavaDoc (/** ... */).
| /* | ||
| * Optional, valid for version 2026-02-06 and later. | ||
| * Sets the content to upload to the file when it is created. Must be less than or equal to 4 MiB in size. | ||
| * | ||
| * @param binaryData The {@link BinaryData}. | ||
| * @return The updated options. | ||
|
|
||
| */ | ||
| public ShareFileCreateOptions setData(BinaryData binaryData) { | ||
| this.binaryData = binaryData; | ||
| return this; | ||
| } */ | ||
| } |
There was a problem hiding this comment.
setData is a public API but its comment is a non-Javadoc block (/* ... */). Please convert it to JavaDoc (/** ... */) so it appears in generated API docs and matches the style of the other setters in this class.
| /** | ||
| * | ||
| * @param data The data. | ||
| * @param logger Logger to log errors. | ||
| * @return The md5 of the data. | ||
| */ | ||
| public static byte[] computeMd5(ByteBuffer data, ClientLogger logger) { |
There was a problem hiding this comment.
The JavaDoc for computeMd5(ByteBuffer, ClientLogger) is missing a summary sentence (it starts with a blank *). Please add a brief description (for example, that it computes the MD5 of the provided buffer) to align with JavaDoc conventions and avoid doclint warnings.
| @@ -549,16 +549,17 @@ public Response<ShareFileInfo> createWithResponse(ShareFileCreateOptions options | |||
| } else { | |||
| contentLength = null; | |||
| contentMD5 = null; | |||
| } */ | |||
| } | |||
|
|
|||
| Callable<ResponseBase<FilesCreateHeaders, Void>> operation = () -> this.azureFileStorageClient.getFiles() | |||
| .createWithResponse(shareName, filePath, options.getSize(), null, options.getMetadata(), | |||
| options.getFilePermission(), options.getFilePermissionFormat(), smbProperties.getFilePermissionKey(), | |||
| smbProperties.getNtfsFileAttributesString(), smbProperties.getFileCreationTimeString(), | |||
| smbProperties.getFileLastWriteTimeString(), smbProperties.getFileChangeTimeString(), | |||
| requestConditions.getLeaseId(), fileposixProperties.getOwner(), fileposixProperties.getGroup(), | |||
| fileposixProperties.getFileMode(), fileposixProperties.getFileType(), null, null, null, null, | |||
| options.getShareFileHttpHeaders(), finalContext); | |||
| fileposixProperties.getFileMode(), fileposixProperties.getFileType(), contentMD5, | |||
| options.getFilePropertySemantics(), contentLength, options.getData(), options.getShareFileHttpHeaders(), | |||
| finalContext); | |||
There was a problem hiding this comment.
When options.getData() is set, this computes MD5 from options.getData().toByteBuffer() but then sends the original BinaryData in the request. If the BinaryData isn't replayable (or is backed by a one-shot source), the bytes used for the MD5 may not match the bytes actually sent (or the body may be empty on the second read). Consider first converting to a replayable BinaryData (and using that instance for both MD5/length and the request body), or explicitly validating replayability and failing fast.
Readding the feature that was pulled from STG100