Skip to content

Commit

Permalink
[Storage] Azure Storage SDK 2018-11-09 Feature Release (#4418)
Browse files Browse the repository at this point in the history
* [Storage] Fixed a bug of `downloadBlobToBuffer()` and `downloadAzureFileToBuffer()` when provided offset is not 0.

* [Storage] Fixed a bug that `Aborter` cannot work during retry interval.

* [Storage] * Export `RetryPolicyType`.

* [Storage] Fixed a bug that Aborter throws timeout error even though it succeeds of blobURL or fileURL download

* [Storage] Aborter doesn't require `dom` as tsconfig lib requirement anymore for `Event` type.

* [Storage] * Fixed a bug that "err.code.toUpperCase is not a function" when retries in browser

* [Storage] Resolved CR comments

* [Storage-Queue] Updated queue API version to 2018-11-09

* [Storage][Blob] Regenerated blob protocol layer code against swagger 2018-11-09; Updated to autorest 4.1.1 and ms-rest-js ^1.8.1

* [Storage-File] Updated API version to 2018-11-09; Updated to autorest.typescript 4.1.1 and ms-rest-js ^1.8.1;

* [Storage-File] Fixed FileURL.create() and setHTTPHeaders() issues introduced by re-generation

* Added `DirectoryURL.listHandlesSegment()` and `FileURL.listHandlesSegment()` to returns a list of open handles on a directory or a file.

* Added `DirectoryURL.forceCloseHandlesSegment()`, `FileURL.forceCloseHandlesSegment()`, `DirectoryURL.forceCloseHandle()` and `FileURL.forceCloseHandle()` to  close handles

* [Storage-File] Updated recorded tests

* [Storage-File] Updated package version to 10.2.0

* Rename handlerID parameter to handlerId

* [Storage] Updated contribution.md about record and play

* [Storage-File] Updated changelog and comments to make them clearer

* [Storage-Blob] Updated ChangeLog

* [Storage-Blob]  PageBlobURL.uploadPagesFromURL() AppendBlobURL.appendBlockFromURL() BlobURL.syncCopyFromURL()

* [Storage] Resolved CR comments

* [Storage][Blob] Added ServiceURL.getUserDelegationKey()

* [Storage] Update to [email protected]; Updated HTTP client from axios to node-fetch in Node.js runtime. Support keepalive;

* [Storage] Updated samples about keepAliveOptions

* [Storage] Updated changelog; Fixed testcases; Updated pnpmlock;

* [Storage] Added vinjiang and Jason Fan as storage code owners

* [Storage] Record test cases

* [Storage] Force to YYYY-MM-DDThh:mmTZD precision for getUserDelegationKey start and expiry time

* [Storage] Resolved PR comments; Updated contribution.md & API comments; Optimized generated code import paths;
  • Loading branch information
XiaoningLiu authored Jul 26, 2019
1 parent ad35404 commit a0e8338
Show file tree
Hide file tree
Showing 566 changed files with 23,091 additions and 16,532 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/sdk/identity/ @daviwil
/sdk/keyvault/ @jonathandturner @sadasant
/sdk/storage/ @XiaoningLiu @jeremymeng @HarshaNalluru
/sdk/storage/ @XiaoningLiu @jeremymeng @HarshaNalluru @vinjiang @jiacfan

# Management Plane
/**/*Management*.ts @yaohaizh
Expand Down
5 changes: 3 additions & 2 deletions common/config/rush/common-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/common-versions.schema.json",

/**
* A table that specifies a "preferred version" for a dependency package. The "preferred version"
* is typically used to hold an indirect dependency back to a specific version, however generally
Expand All @@ -18,7 +17,6 @@
*/
// "some-library": "1.2.3"
},

/**
* The "rush check" command can be used to enforce that every project in the repo must specify
* the same SemVer range for a given dependency. However, sometimes exceptions are needed.
Expand All @@ -30,6 +28,9 @@
* This design avoids unnecessary churn in this file.
*/
"allowedAlternativeVersions": {
"@azure/ms-rest-js": [
"^2.0.0"
]
/**
* For example, allow some projects to use an older TypeScript compiler
* (in addition to whatever "usual" version is being used by other projects in the repo):
Expand Down
79 changes: 70 additions & 9 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions sdk/storage/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ npm run test:browser

Browser testing is based on Karma, you can change default testing browser by modifying karma.conf.js file.

### Record & Play

By default, above test commands are live testing against real Azure Storage accounts. Before running above tests, set environment value `TEST_MODE` to switch to offline mock test mode or test recording mode.

Playback mode is for offline mock test, which doesn't require a storage account, it's quick but less coverage:

`export TEST_MODE=playback`

Record tests for next playback. Recording is necessary after adding or updating test cases:

`export TEST_MODE=record`

Live tests by clearing `TEST_MODE` environment variable:

`export TEST_MODE=`

### Testing Features

As you develop a feature, you'll need to write tests to ensure quality. You should also run existing tests related to your change to address any unexpected breaks in both Node.js and Browsers.
Expand Down
17 changes: 17 additions & 0 deletions sdk/storage/storage-blob/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# Changelog

2019.07 10.4.0

* Updated Azure Storage Service API version to [2018-11-09](https://docs.microsoft.com/en-us/rest/api/storageservices/version-2018-11-09).
* Improved comments for `BlockBlobURL.upload()`.
* Exported `HttpRequestBody` type for who wants to implement a customized HTTP client.
* Fixed a bug of `downloadBlobToBuffer()` and `downloadAzureFileToBuffer()` when provided offset is not 0.
* Fixed a bug that `Aborter` cannot work during retry interval.
* Fixed a bug that `Aborter` throws timeout error even though it succeeds of `BlockBlobUrl.download()`.
* Fixed a bug that "err.code.toUpperCase is not a function" when retries in browser.
* Export `RetryPolicyType`.
* `Aborter` doesn't require `dom` as tsconfig lib requirement anymore for `Event` type.
* Service SAS generation now supports snapshot access control from 2018-11-09 in `generateBlobSASQueryParameters()`.
* Service SAS generation now supports snapshot access control from API version 2018-11-09 in `generateBlobSASQueryParameters()`.
* A new API `PageBlobURL.uploadPagesFromURL()` allows pages in a page blob to be written using a range of another blob as a source. This permits synchronous server-side copies to be orchestrated for page blobs of any size.
* A new API `AppendBlobURL.appendBlockFromURL()` commits a new block of data to the end of an append blob. Method uses a range of another blob as a source. This permits synchronous server-side copies to be orchestrated for append blobs of any size.
* A new API `BlobURL.syncCopyFromURL()` allows a block blob to be copied synchronously using a URL as a source. This API has a maximum size of 256 MB and preserves metadata and block list.
* A new API `ServiceURL.getUserDelegationKey()` added to get a key that can be used to generate a user delegation SAS (shared access signature).
* Updated HTTP client from axios to node-fetch in Node.js runtime.
* A new option `keepAliveOptions` added to parameter of `StorageURL.newPipeline()` which controls keep-alive configurations. Keep-alive is enabled by default.

2018.12 10.3.0

Expand Down
6 changes: 3 additions & 3 deletions sdk/storage/storage-blob/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@azure/storage-blob",
"sdk-type": "client",
"version": "10.3.0",
"version": "10.4.0",
"description": "Microsoft Azure Storage SDK for JavaScript - Blob",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
Expand All @@ -19,7 +19,7 @@
},
"scripts": {
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
"build:autorest": "autorest ./swagger/README.md --typescript [email protected]/autorest.typescript@2.1.3",
"build:autorest": "autorest ./swagger/README.md --typescript [email protected]/autorest.typescript@4.1.1",
"build:browserzip": "gulp zip",
"build:es6": "tsc -p tsconfig.json",
"build:nodebrowser": "rollup -c 2>&1",
Expand Down Expand Up @@ -74,7 +74,7 @@
"homepage": "https://github.com/Azure/azure-sdk-for-js#readme",
"sideEffects": false,
"dependencies": {
"@azure/ms-rest-js": "^1.2.6",
"@azure/ms-rest-js": "^2.0.0",
"events": "^3.0.0",
"tslib": "^1.9.3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"recordings": [
{
"method": "PUT",
"url": "https://fakestorageaccount.blob.core.windows.net/container156058697809306189",
"url": "https://fakestorageaccount.blob.core.windows.net/container156404691376603837",
"query": {
"restype": "container"
},
"requestBody": null,
"status": 201,
"response": "",
"responseHeaders": {
"date": "Sat, 15 Jun 2019 08:22:57 GMT",
"last-modified": "Sat, 15 Jun 2019 08:22:58 GMT",
"date": "Thu, 25 Jul 2019 09:24:55 GMT",
"last-modified": "Thu, 25 Jul 2019 09:24:55 GMT",
"server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"etag": "\"0x8D6F16AAC77E5A4\"",
"x-ms-request-id": "9567147c-201e-0039-5053-233a35000000",
"x-ms-version": "2018-03-28",
"etag": "\"0x8D710E1F4EE47A0\"",
"x-ms-request-id": "d494aae0-c01e-0075-17ca-42b92d000000",
"x-ms-version": "2018-11-09",
"content-length": "0"
}
}
],
"uniqueTestInfo": {
"container": "container156058697809306189"
"container": "container156404691376603837"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"recordings": [
{
"method": "PUT",
"url": "https://fakestorageaccount.blob.core.windows.net/container156058697901900409",
"url": "https://fakestorageaccount.blob.core.windows.net/container156404691415106119",
"query": {
"restype": "container"
},
"requestBody": null,
"status": 201,
"response": "",
"responseHeaders": {
"date": "Sat, 15 Jun 2019 08:22:58 GMT",
"last-modified": "Sat, 15 Jun 2019 08:22:58 GMT",
"date": "Thu, 25 Jul 2019 09:24:55 GMT",
"last-modified": "Thu, 25 Jul 2019 09:24:56 GMT",
"server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"etag": "\"0x8D6F16AAC978151\"",
"x-ms-request-id": "9567151f-201e-0039-6753-233a35000000",
"x-ms-version": "2018-03-28",
"etag": "\"0x8D710E1F505A468\"",
"x-ms-request-id": "d494ab49-c01e-0075-62ca-42b92d000000",
"x-ms-version": "2018-11-09",
"content-length": "0"
}
}
],
"uniqueTestInfo": {
"container": "container156058697901900409"
"container": "container156404691415106119"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recordings": [],
"uniqueTestInfo": {
"container": "container156058697808401937"
"container": "container156404691375200388"
}
}
Loading

0 comments on commit a0e8338

Please sign in to comment.