From c5a779b34eb4bf5371fefbcd382ab2df1b7d499a Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Tue, 12 Jan 2021 11:13:43 +0800 Subject: [PATCH 1/2] bump up version --- common/config/rush/common-versions.json | 6 +++--- sdk/eventhub/eventhubs-checkpointstore-blob/package.json | 2 +- sdk/storage/storage-blob-changefeed/package.json | 2 +- sdk/storage/storage-blob/CHANGELOG.md | 2 +- sdk/storage/storage-blob/package.json | 4 ++-- .../storage-blob/src/generated/src/storageClientContext.ts | 2 +- sdk/storage/storage-blob/src/utils/constants.ts | 2 +- sdk/storage/storage-file-datalake/CHANGELOG.md | 2 +- sdk/storage/storage-file-datalake/package.json | 4 ++-- sdk/storage/storage-file-datalake/src/utils/constants.ts | 2 +- sdk/storage/storage-file-share/CHANGELOG.md | 3 ++- sdk/storage/storage-file-share/package.json | 4 ++-- .../src/generated/src/storageClientContext.ts | 2 +- sdk/storage/storage-file-share/src/utils/constants.ts | 2 +- sdk/storage/storage-queue/CHANGELOG.md | 3 ++- sdk/storage/storage-queue/package.json | 4 ++-- .../storage-queue/src/generated/src/storageClientContext.ts | 2 +- sdk/storage/storage-queue/src/utils/constants.ts | 2 +- 18 files changed, 26 insertions(+), 24 deletions(-) diff --git a/common/config/rush/common-versions.json b/common/config/rush/common-versions.json index 7863c2776b88..05d6bb4a6b9d 100644 --- a/common/config/rush/common-versions.json +++ b/common/config/rush/common-versions.json @@ -42,9 +42,9 @@ */ "allowedAlternativeVersions": { // The following is required for eventhubs-checkpointstore-blob, - // since there is a new 12.4-beta version which is being maintained in the repo - // To be reverted when the storage-blob releases a stable version. - "@azure/storage-blob": ["^12.3.0"], + // when there is a new beta version which is being maintained in the repo. + // Comment this out when the storage-blob releases a stable version. + // "@azure/storage-blob": ["^12.3.0"], "@azure/ms-rest-js": ["^2.0.0"], /** diff --git a/sdk/eventhub/eventhubs-checkpointstore-blob/package.json b/sdk/eventhub/eventhubs-checkpointstore-blob/package.json index bb220f53178f..43bea7e3760d 100644 --- a/sdk/eventhub/eventhubs-checkpointstore-blob/package.json +++ b/sdk/eventhub/eventhubs-checkpointstore-blob/package.json @@ -62,7 +62,7 @@ "dependencies": { "@azure/event-hubs": "^5.0.0", "@azure/logger": "^1.0.0", - "@azure/storage-blob": "^12.3.0", + "@azure/storage-blob": "^12.4.0", "events": "^3.0.0", "tslib": "^2.0.0" }, diff --git a/sdk/storage/storage-blob-changefeed/package.json b/sdk/storage/storage-blob-changefeed/package.json index 91234539807a..28728d1acc64 100644 --- a/sdk/storage/storage-blob-changefeed/package.json +++ b/sdk/storage/storage-blob-changefeed/package.json @@ -94,7 +94,7 @@ ] }, "dependencies": { - "@azure/storage-blob": "^12.4.0-beta.1", + "@azure/storage-blob": "^12.4.0", "@azure/abort-controller": "^1.0.0", "@azure/core-http": "^1.2.0", "@azure/core-lro": "^1.0.2", diff --git a/sdk/storage/storage-blob/CHANGELOG.md b/sdk/storage/storage-blob/CHANGELOG.md index 013882254578..fb567437a970 100644 --- a/sdk/storage/storage-blob/CHANGELOG.md +++ b/sdk/storage/storage-blob/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.4.0-beta.2 (Unreleased) +## 12.4.0 (2021-01-12) - Added a new `from(permissionLike)` function to `AccountSASPermissions`, `BlobSASPermissions` and `ContainerSASPermissions` for creating such a permission from a raw permission-like object. Addressed issue [9714](https://github.com/Azure/azure-sdk-for-js/issues/9714). diff --git a/sdk/storage/storage-blob/package.json b/sdk/storage/storage-blob/package.json index 0831ada96904..5ef8635b3c5a 100644 --- a/sdk/storage/storage-blob/package.json +++ b/sdk/storage/storage-blob/package.json @@ -1,7 +1,7 @@ { "name": "@azure/storage-blob", "sdk-type": "client", - "version": "12.4.0-beta.2", + "version": "12.4.0", "description": "Microsoft Azure Storage SDK for JavaScript - Blob", "main": "./dist/index.js", "module": "./dist-esm/storage-blob/src/index.js", @@ -32,7 +32,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 --package-version=12.4.0-beta.1 --use=@microsoft.azure/autorest.typescript@5.0.1", + "build:autorest": "autorest ./swagger/README.md --typescript --package-version=12.4.0 --use=@microsoft.azure/autorest.typescript@5.0.1", "build:es6": "tsc -p tsconfig.json", "build:nodebrowser": "rollup -c 2>&1", "build:samples": "npm run clean && cross-env ONLY_NODE=true npm run build && npm run build:prep-samples", diff --git a/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts b/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts index 343a05089901..f82987aab044 100644 --- a/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts +++ b/sdk/storage/storage-blob/src/generated/src/storageClientContext.ts @@ -11,7 +11,7 @@ import * as coreHttp from "@azure/core-http"; const packageName = "azure-storage-blob"; -const packageVersion = "12.4.0-beta.1"; +const packageVersion = "12.4.0"; export class StorageClientContext extends coreHttp.ServiceClient { url: string; diff --git a/sdk/storage/storage-blob/src/utils/constants.ts b/sdk/storage/storage-blob/src/utils/constants.ts index 1b759ff19893..b801ac12c604 100644 --- a/sdk/storage/storage-blob/src/utils/constants.ts +++ b/sdk/storage/storage-blob/src/utils/constants.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export const SDK_VERSION: string = "12.4.0-beta.2"; +export const SDK_VERSION: string = "12.4.0"; export const SERVICE_VERSION: string = "2020-04-08"; export const BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES: number = 256 * 1024 * 1024; // 256MB diff --git a/sdk/storage/storage-file-datalake/CHANGELOG.md b/sdk/storage/storage-file-datalake/CHANGELOG.md index 2020f74660fa..2446ff1be6fe 100644 --- a/sdk/storage/storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/storage-file-datalake/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 12.3.0-beta.2 (Unreleased) +## 12.3.0 (2021-01-12) - Bug fix - `DataLakePathClient.move()` now supports source and destination authenticated with SAS. Fixed bug [12758](https://github.com/Azure/azure-sdk-for-js/issues/12758). - Now you can get the functionality of the root directory via the `DataLakeDirectoryClient` created via `FileSystemClient.getDirectoryClient("")`. Fixed bug [12813](https://github.com/Azure/azure-sdk-for-js/issues/12813). diff --git a/sdk/storage/storage-file-datalake/package.json b/sdk/storage/storage-file-datalake/package.json index eacc57d66164..9621882bb57e 100644 --- a/sdk/storage/storage-file-datalake/package.json +++ b/sdk/storage/storage-file-datalake/package.json @@ -1,6 +1,6 @@ { "name": "@azure/storage-file-datalake", - "version": "12.3.0-beta.2", + "version": "12.3.0", "description": "Microsoft Azure Storage SDK for JavaScript - DataLake", "sdk-type": "client", "main": "./dist/index.js", @@ -101,7 +101,7 @@ "@azure/core-paging": "^1.1.1", "@azure/core-tracing": "1.0.0-preview.9", "@azure/logger": "^1.0.0", - "@azure/storage-blob": "^12.4.0-beta.1", + "@azure/storage-blob": "^12.4.0", "events": "^3.0.0", "tslib": "^2.0.0" }, diff --git a/sdk/storage/storage-file-datalake/src/utils/constants.ts b/sdk/storage/storage-file-datalake/src/utils/constants.ts index 3d7484614110..99d9e1a6dffc 100644 --- a/sdk/storage/storage-file-datalake/src/utils/constants.ts +++ b/sdk/storage/storage-file-datalake/src/utils/constants.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export const SDK_VERSION: string = "12.3.0-beta.2"; +export const SDK_VERSION: string = "12.3.0"; export const SERVICE_VERSION: string = "2020-04-08"; export const KB: number = 1024; diff --git a/sdk/storage/storage-file-share/CHANGELOG.md b/sdk/storage/storage-file-share/CHANGELOG.md index 3e669bca3e5e..d0134df5c04b 100644 --- a/sdk/storage/storage-file-share/CHANGELOG.md +++ b/sdk/storage/storage-file-share/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 12.4.0-beta.2 (Unreleased) +## 12.4.0 (2021-01-12) +- This release contains bug fixes to improve quality. ## 12.4.0-beta.1 (2020-12-09) diff --git a/sdk/storage/storage-file-share/package.json b/sdk/storage/storage-file-share/package.json index c72811c8e8c6..4c33e00cdc66 100644 --- a/sdk/storage/storage-file-share/package.json +++ b/sdk/storage/storage-file-share/package.json @@ -1,7 +1,7 @@ { "name": "@azure/storage-file-share", "sdk-type": "client", - "version": "12.4.0-beta.2", + "version": "12.4.0", "description": "Microsoft Azure Storage SDK for JavaScript - File", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", @@ -28,7 +28,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 --package-version=12.4.0-beta.1 --use=@microsoft.azure/autorest.typescript@5.0.1", + "build:autorest": "autorest ./swagger/README.md --typescript --package-version=12.4.0 --use=@microsoft.azure/autorest.typescript@5.0.1", "build:es6": "tsc -p tsconfig.json", "build:nodebrowser": "rollup -c 2>&1", "build:samples": "npm run clean && cross-env ONLY_NODE=true npm run build && npm run build:prep-samples", diff --git a/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts b/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts index 2956ed9c626d..e117598c842e 100644 --- a/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts +++ b/sdk/storage/storage-file-share/src/generated/src/storageClientContext.ts @@ -11,7 +11,7 @@ import * as coreHttp from "@azure/core-http"; const packageName = "azure-storage-file-share"; -const packageVersion = "12.4.0-beta.2"; +const packageVersion = "12.4.0"; export class StorageClientContext extends coreHttp.ServiceClient { version: string; diff --git a/sdk/storage/storage-file-share/src/utils/constants.ts b/sdk/storage/storage-file-share/src/utils/constants.ts index a10e42d0b608..4da07056ce23 100644 --- a/sdk/storage/storage-file-share/src/utils/constants.ts +++ b/sdk/storage/storage-file-share/src/utils/constants.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export const SDK_VERSION: string = "12.4.0-beta.2"; +export const SDK_VERSION: string = "12.4.0"; export const SERVICE_VERSION: string = "2020-04-08"; export const FILE_MAX_SIZE_BYTES: number = 4 * 1024 * 1024 * 1024 * 1024; // 4TB diff --git a/sdk/storage/storage-queue/CHANGELOG.md b/sdk/storage/storage-queue/CHANGELOG.md index b5affb426a2c..3690a2e5ec90 100644 --- a/sdk/storage/storage-queue/CHANGELOG.md +++ b/sdk/storage/storage-queue/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 12.3.0-beta.2 (Unreleased) +## 12.3.0 (2021-01-12) +- This release contains bug fixes to improve quality. ## 12.3.0-beta.1 (2020-12-09) diff --git a/sdk/storage/storage-queue/package.json b/sdk/storage/storage-queue/package.json index f9568115e087..3ecef3916555 100644 --- a/sdk/storage/storage-queue/package.json +++ b/sdk/storage/storage-queue/package.json @@ -1,7 +1,7 @@ { "name": "@azure/storage-queue", "sdk-type": "client", - "version": "12.3.0-beta.2", + "version": "12.3.0", "description": "Microsoft Azure Storage SDK for JavaScript - Queue", "main": "./dist/index.js", "module": "./dist-esm/src/index.js", @@ -25,7 +25,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 --package-version=12.3.0-beta.1 --use=@microsoft.azure/autorest.typescript@5.0.1", + "build:autorest": "autorest ./swagger/README.md --typescript --package-version=12.3.0 --use=@microsoft.azure/autorest.typescript@5.0.1", "build:es6": "tsc -p tsconfig.json", "build:nodebrowser": "rollup -c 2>&1", "build:samples": "npm run clean && cross-env ONLY_NODE=true npm run build && npm run build:prep-samples", diff --git a/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts b/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts index 26cc5c4cbc4e..09486c3d9198 100644 --- a/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts +++ b/sdk/storage/storage-queue/src/generated/src/storageClientContext.ts @@ -11,7 +11,7 @@ import * as coreHttp from "@azure/core-http"; const packageName = "azure-storage-queue"; -const packageVersion = "12.3.0-beta.2"; +const packageVersion = "12.3.0"; export class StorageClientContext extends coreHttp.ServiceClient { url: string; diff --git a/sdk/storage/storage-queue/src/utils/constants.ts b/sdk/storage/storage-queue/src/utils/constants.ts index 2c276d66e5e0..f089a09cb991 100644 --- a/sdk/storage/storage-queue/src/utils/constants.ts +++ b/sdk/storage/storage-queue/src/utils/constants.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -export const SDK_VERSION: string = "12.3.0-beta.2"; +export const SDK_VERSION: string = "12.3.0"; export const SERVICE_VERSION: string = "2020-04-08"; /** From 2746bbc2b8bb4b722e9b43f9eec664ac9971f618 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Tue, 12 Jan 2021 22:21:23 +0800 Subject: [PATCH 2/2] fix re-use generator bug in BlobQuickQueryStream --- .../src/utils/BlobQuickQueryStream.ts | 27 +++++++++++-------- .../storage-blob/test/node/blobclient.spec.ts | 3 +-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts b/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts index c060c284cefa..96b0abfba761 100644 --- a/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts +++ b/sdk/storage/storage-blob/src/utils/BlobQuickQueryStream.ts @@ -46,6 +46,7 @@ export class BlobQuickQueryStream extends Readable { private source: NodeJS.ReadableStream; private avroReader: AvroReader; private avroIter: AsyncIterableIterator; + private avroPaused: boolean = true; private onProgress?: (progress: TransferProgressEvent) => void; private onError?: (error: BlobQueryError) => void; @@ -66,19 +67,27 @@ export class BlobQuickQueryStream extends Readable { } public _read() { - this.readInternal().catch((err) => { - this.emit("error", err); - }); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } private async readInternal() { - for await (const obj of this.avroIter) { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; const schema = (obj as any).$schema; if (typeof schema !== "string") { throw Error("Missing schema in avro record."); } - let exit = false; switch (schema) { case "com.microsoft.azure.storage.queryBlobContents.resultData": const data = (obj as any).data; @@ -86,7 +95,7 @@ export class BlobQuickQueryStream extends Readable { throw Error("Invalid data in avro result record."); } if (!this.push(Buffer.from(data))) { - exit = true; + this.avroPaused = true; } break; case "com.microsoft.azure.storage.queryBlobContents.progress": @@ -137,10 +146,6 @@ export class BlobQuickQueryStream extends Readable { default: throw Error(`Unknown schema ${schema} in avro progress record.`); } - - if (exit) { - break; - } - } + } while (!avroNext.done && !this.avroPaused); } } diff --git a/sdk/storage/storage-blob/test/node/blobclient.spec.ts b/sdk/storage/storage-blob/test/node/blobclient.spec.ts index 3ac6c3bfc130..b80f2aabf04a 100644 --- a/sdk/storage/storage-blob/test/node/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobclient.spec.ts @@ -38,7 +38,6 @@ describe("BlobClient Node.js only", () => { let blockBlobClient: BlockBlobClient; const content = "Hello World"; const tempFolderPath = "temp"; - const timeoutForLargeFile = 20 * 60 * 1000; let recorder: Recorder; @@ -500,7 +499,7 @@ describe("BlobClient Node.js only", () => { unlinkSync(tempFileLarge); assert.ok(downloadedData.equals(uploadedData)); - }).timeout(timeoutForLargeFile); + }); it("query should work with aborter", async function() { recorder.skip("node", "Temp file - recorder doesn't support saving the file");