From 59593338a6b9704c4c40a8de85a00c83a35edf65 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 28 Mar 2024 19:15:10 +0000 Subject: [PATCH] defaulting compression level --- .../artifact/src/internal/upload/blob-upload.ts | 16 ++++++---------- .../src/internal/upload/upload-artifact.ts | 5 ++++- packages/artifact/src/internal/upload/zip.ts | 2 +- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/artifact/src/internal/upload/blob-upload.ts b/packages/artifact/src/internal/upload/blob-upload.ts index bc045c09..b244861a 100644 --- a/packages/artifact/src/internal/upload/blob-upload.ts +++ b/packages/artifact/src/internal/upload/blob-upload.ts @@ -60,20 +60,16 @@ export async function uploadZipToBlobStorage( core.info(`is the upload stream readable? ${uploadStream.readable}`) core.info(`is the upload stream writable? ${uploadStream.writable}`) core.info(`are we exceeding the max concurrency? ${maxConcurrency}`) - // is the blob client ready? - core.info(`blob client props: ${blockBlobClient.url}`) try { core.info( '1 Even more beginning upload of artifact content to blob storage' ) - await blockBlobClient - .uploadStream(uploadStream, bufferSize, maxConcurrency, options) - .catch(error => { - core.info(`Upload stream error: ${error}`) - }) - .then(response => { - core.info(`Upload stream response: ${response}`) - }) + await blockBlobClient.uploadStream( + uploadStream, + bufferSize, + maxConcurrency, + options + ) core.info( '2 Even more beginning upload of artifact content to blob storage' ) diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index 30b6978c..1e0c9d09 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -75,7 +75,10 @@ export async function uploadArtifact( return uploadZipToBlobStorage( createArtifactResp.signedUploadUrl, zipUploadStream - ) + ).catch(err => { + core.error(`Error uploading artifact: ${err}`) + throw err + }) }) .then(async uploadResult => { const finalizeArtifactReq: FinalizeArtifactRequest = { diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index e4966858..8bcc09c2 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -30,7 +30,7 @@ export async function createZipUploadStream( `Creating Artifact archive with compressionLevel: ${compressionLevel}` ) const zlibOptions = { - zlib: {level: compressionLevel, bufferSize: getUploadChunkSize()} + zlib: {level: DEFAULT_COMPRESSION_LEVEL, bufferSize: getUploadChunkSize()} } const zip = new ZipStream.default(zlibOptions) // register callbacks for various events during the zip lifecycle