File listing v2 - #21720
Conversation
regenerated files swagger for listing hooked up generated and handwritten models expanded client API to support new models
expanded test parameters for file listing. swagger transform added.
also fixed a method name casing
REST api accepts true or an absence of value. Alligning with .NET for now on Boolean vs boolean.
|
Currently aligning with .NET on |
| ### Code generation settings | ||
| ``` yaml | ||
| input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.FileStorage/preview/2020-04-08/file.json | ||
| input-file: https://raw.githubusercontent.com/seanmcc-msft/azure-rest-api-specs/feature/storage/listFilesV2/specification/storage/data-plane/Microsoft.FileStorage/preview/2020-10-02/file.json |
There was a problem hiding this comment.
revert this before merge (after making sure the swagger is merged too)
gapra-msft
left a comment
There was a problem hiding this comment.
lgtm. I have a few design related comments
other minor fixes rerecorded tests
extendedInfo boolean => Boolean renamed options class
| final ShareListFilesAndDirectoriesOptions modifiedOptions = options == null | ||
| ? new ShareListFilesAndDirectoriesOptions() : options; | ||
|
|
||
| List<ListFilesIncludeType> includeTypes = new LinkedList<>(); |
There was a problem hiding this comment.
I'm not sure why we'd choose LinkedList here. It should matter much with this size of data but we should by default pick ArrayList unless we hava a good reason to use LinkedList.
| * @param lastModified Datetime the item was last modified. | ||
| * @param eTag ETag of the item. | ||
| */ | ||
| public ShareFileItemProperties(OffsetDateTime createdOn, OffsetDateTime lastAccessedOn, |
There was a problem hiding this comment.
If this is new type then I'd recommend to convert it into interface and have actual implementation in the "implementation" package. This will help us manage growing model without worry about breaking ctors.
Let's do this for all immutable models we add.
| if (includeTimestamps || includeETag || includeAttributes || includePermissionKey) { | ||
| throw logger.logExceptionAsError( | ||
| new IllegalStateException("includeExtendedInfo must be true in the current state.")); | ||
| } |
There was a problem hiding this comment.
we should remove this validation. service makes sure data is pulled from right place implicitly if extra attributes are requested. there's no need for us validating this.
| if (includeTimestamps) { | ||
| this.includeExtendedInfo = true; | ||
| } |
There was a problem hiding this comment.
This isn't necessary as well. service will do the right thing. Please remove this and similar logic.
| def options = new ShareListFilesAndDirectoriesOptions() | ||
| .setPrefix(namer.getResourcePrefix() + extraPrefix) | ||
| .setMaxResultsPerPage(maxResults) | ||
| .setIncludeExtendedInfo(includeExtendedInfo) // set FIRST since subsequent can autoset this one | ||
| .setIncludeTimestamps(timestamps) | ||
| .setIncludeETag(etag) | ||
| .setIncludeAttributes(attributes) | ||
| .setIncludePermissionKey(permissionKey) | ||
| def returnedFileList = primaryDirectoryClient.listFilesAndDirectories(options, null, null).collect() |
There was a problem hiding this comment.
let's keep tests with extended and without extended info separate. We'd like to run existing form of test for older service versions - if we mix them together we'll loose that ability.
You may need to annotate tests that take extended info with @RequiredServiceVersion annotation.
* Set up STG78 branch (#21634) * Generated off latest version of blob swagger (#21644) * Reenabled quick query parquet support (#21785) * Implemented Immutable Storage with Versioning (#21718) * File listing v2 (#21720) * swagger generation and hookup regenerated files swagger for listing hooked up generated and handwritten models expanded client API to support new models * testing and fixes expanded test parameters for file listing. swagger transform added. * rerecorded file listing test * more testing also fixed a method name casing * docstrings and samples * checkstyle * reverted primative boolean extended info arg REST api accepts true or an absence of value. Alligning with .NET for now on Boolean vs boolean. * checkpoint * pr feedback * misused variable fix * fixed test * send nothing, not false: include-extended-info other minor fixes rerecorded tests * import cleanup * swagger regeneration and test fixes * API comments extendedInfo boolean => Boolean renamed options class * reidentified samples for options class name change Co-authored-by: jschrepp-MSFT <41338290+jschrepp-MSFT@users.noreply.github.com> * Fix test. * Implemented list deleted root blob with versions (#21996) * Addressed comments for immutable storage with versioning (#22388) * Develop on main, part 1 (#22451) * move back service version. * pin CI. * fix ci. * fix ci ? * fix live tests ? * use latest service version to filter if not specified in variable. * use latest service version to filter if not specified in variable. * does this work ?? * missing stuff. * move that piece to parent as well. * rollback yml changes in favor of pom.xml * fix build ? * how about this ? * more ? * not this. * rollback some. * does this work ?? Co-authored-by: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Co-authored-by: gapra <gapra@microsoft.com> Co-authored-by: James <41338290+jaschrep-msft@users.noreply.github.com> Co-authored-by: jschrepp-MSFT <41338290+jschrepp-MSFT@users.noreply.github.com>
* Set up STG78 branch (#21634) * Generated off latest version of blob swagger (#21644) * swagger generation and public API overloads * blob clients obey new generation * minor changes to bearer token logic * TEST WORKING * extra testing * ported oauthcopy source to blobs * options API changes and docstrings * fixed constructor issues * fix missed source auth misses * script tags on pom * removes arg checks in option model constructors rerecorded tests * pom fix * fix misnamed page blob tests * Test fixes adds missing recording. extra playback logic for oauth tokens that should fix a CI-specific issue. * fixed pom script comment * downgrade some depenency verions * rerecord sas tests * snippets and checkstyle * rerecorded tests fixed recording infra for file share tests * test fixes * rerecorded versioning tests * HttpAuthorization added to core-experimental azure-storage-blob and azure-storage-file-share now depend on core-experimental for new class and updated their APIs to use the new class. * refactored options type names * Reenabled quick query parquet support (#21785) * reidentified samples for options class name change * Implemented Immutable Storage with Versioning (#21718) * File listing v2 (#21720) * swagger generation and hookup regenerated files swagger for listing hooked up generated and handwritten models expanded client API to support new models * testing and fixes expanded test parameters for file listing. swagger transform added. * rerecorded file listing test * more testing also fixed a method name casing * docstrings and samples * checkstyle * reverted primative boolean extended info arg REST api accepts true or an absence of value. Alligning with .NET for now on Boolean vs boolean. * checkpoint * pr feedback * misused variable fix * fixed test * send nothing, not false: include-extended-info other minor fixes rerecorded tests * import cleanup * swagger regeneration and test fixes * API comments extendedInfo boolean => Boolean renamed options class * reidentified samples for options class name change Co-authored-by: jschrepp-MSFT <41338290+jschrepp-MSFT@users.noreply.github.com> * Fix test. * remove HttpAuthorization in prep for merge added in separate PR. removing to be ready for that offical addition. * fix build from merge * fix pom versioning CI issues * snippet line length * fix merge error with immutable versioning * PR feedback * Minor cleanup * generator cleanup and regeneration * Keep files-shares tests dependent on latest blob * test refactor/rerecord * deleted old tests that were copied instead of moved * min service version reformat * import cleanup * post-merge. * getOauthToken refactor * reformatting Co-authored-by: Gauri Prasad <51212198+gapra-msft@users.noreply.github.com> Co-authored-by: jschrepp-MSFT <41338290+jschrepp-MSFT@users.noreply.github.com> Co-authored-by: gapra <gapra@microsoft.com> Co-authored-by: Kamil Sobol <kasobol@microsoft.com> Co-authored-by: Kamil Sobol <61715331+kasobol-msft@users.noreply.github.com>
Incorporates new file and directory listing parameters and response fields for file shares.