From f2aa430c9d0b572c38be8cfc168a4fd3b0db5cc7 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 10:05:34 +0000 Subject: [PATCH 01/41] Add debug statements --- packages/cache/src/internal/cacheUtils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index ea1e7de6..02a2e98e 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -95,7 +95,9 @@ async function getVersion(app: string): Promise { // Use zstandard if possible to maximize cache performance export async function getCompressionMethod(): Promise { const versionOutput = await getVersion('zstd') + core.debug(`versionOutput: ${versionOutput}`) const version = semver.clean(versionOutput) + core.debug(`version: ${version}`) if (!versionOutput.toLowerCase().includes('zstd command line interface')) { // zstd is not installed From 652109d32c9e7257ff1544a53629e2b0cdb6fb0b Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 10:30:41 +0000 Subject: [PATCH 02/41] Test passing quiet as argument --- packages/cache/src/internal/cacheUtils.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 02a2e98e..e413d10d 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -3,6 +3,7 @@ import * as exec from '@actions/exec' import * as glob from '@actions/glob' import * as io from '@actions/io' import * as fs from 'fs' +import { type } from 'os' import * as path from 'path' import * as semver from 'semver' import * as util from 'util' @@ -71,11 +72,13 @@ export async function unlinkFile(filePath: fs.PathLike): Promise { return util.promisify(fs.unlink)(filePath) } -async function getVersion(app: string): Promise { +async function getVersion(app: string, args?: string[]): Promise { core.debug(`Checking ${app} --version`) let versionOutput = '' + typeof args !== 'undefined' ? args : (args = []) + args.push('--version') try { - await exec.exec(`${app} --version`, [], { + await exec.exec(`${app}`, args, { ignoreReturnCode: true, silent: true, listeners: { @@ -94,7 +97,7 @@ async function getVersion(app: string): Promise { // Use zstandard if possible to maximize cache performance export async function getCompressionMethod(): Promise { - const versionOutput = await getVersion('zstd') + const versionOutput = await getVersion('zstd', ['--quiet']) core.debug(`versionOutput: ${versionOutput}`) const version = semver.clean(versionOutput) core.debug(`version: ${version}`) From c2d3089f8337053c39f7c368d6786a52077ea90b Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 10:32:34 +0000 Subject: [PATCH 03/41] bump version --- packages/cache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/package.json b/packages/cache/package.json index f274e00c..3d5dda6b 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "3.1.3", + "version": "3.1.4", "preview": true, "description": "Actions cache lib", "keywords": [ From 3630ea6eed1c094d7edb197f1603055a92cb0d76 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 12:51:49 +0000 Subject: [PATCH 04/41] Fix bug with version shortcircuiting because of version being null --- packages/cache/src/internal/cacheUtils.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index e413d10d..f9aa379f 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -98,20 +98,13 @@ async function getVersion(app: string, args?: string[]): Promise { // Use zstandard if possible to maximize cache performance export async function getCompressionMethod(): Promise { const versionOutput = await getVersion('zstd', ['--quiet']) - core.debug(`versionOutput: ${versionOutput}`) const version = semver.clean(versionOutput) - core.debug(`version: ${version}`) - - if (!versionOutput.toLowerCase().includes('zstd command line interface')) { - // zstd is not installed - return CompressionMethod.Gzip - } else if (!version || semver.lt(version, 'v1.3.2')) { - // zstd is installed but using a version earlier than v1.3.2 - // v1.3.2 is required to use the `--long` options in zstd + if (version) { return CompressionMethod.ZstdWithoutLong } else { - return CompressionMethod.Zstd + return CompressionMethod.Gzip } + } export function getCacheFileName(compressionMethod: CompressionMethod): string { From 9e06993ffc59ffd276dbcc0303827bb64adb7b26 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 13:08:22 +0000 Subject: [PATCH 05/41] Hotfix zstd version change only --- packages/cache/src/internal/cacheUtils.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index f9aa379f..b767f963 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -99,12 +99,17 @@ async function getVersion(app: string, args?: string[]): Promise { export async function getCompressionMethod(): Promise { const versionOutput = await getVersion('zstd', ['--quiet']) const version = semver.clean(versionOutput) - if (version) { + + if (versionOutput === '') { + // zstd is not installed + return CompressionMethod.Gzip + } else if (!version || semver.lt(version, 'v1.3.2')) { + // zstd is installed but using a version earlier than v1.3.2 + // v1.3.2 is required to use the `--long` options in zstd return CompressionMethod.ZstdWithoutLong } else { - return CompressionMethod.Gzip + return CompressionMethod.Zstd } - } export function getCacheFileName(compressionMethod: CompressionMethod): string { From 1d1d5456e3c92aeeec8af0404a40baedd7b671d1 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 13:27:45 +0000 Subject: [PATCH 06/41] Removed code that checks for version less than 1.3.2 as it was not working. Defaulting to zstd without long as that is what is always happening currently. --- packages/cache/src/internal/cacheUtils.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index b767f963..e2580286 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -3,7 +3,6 @@ import * as exec from '@actions/exec' import * as glob from '@actions/glob' import * as io from '@actions/io' import * as fs from 'fs' -import { type } from 'os' import * as path from 'path' import * as semver from 'semver' import * as util from 'util' @@ -100,15 +99,11 @@ export async function getCompressionMethod(): Promise { const versionOutput = await getVersion('zstd', ['--quiet']) const version = semver.clean(versionOutput) - if (versionOutput === '') { + if (versionOutput === '' || version === null) { // zstd is not installed return CompressionMethod.Gzip - } else if (!version || semver.lt(version, 'v1.3.2')) { - // zstd is installed but using a version earlier than v1.3.2 - // v1.3.2 is required to use the `--long` options in zstd + } else{ return CompressionMethod.ZstdWithoutLong - } else { - return CompressionMethod.Zstd } } From 83dffb7746ddb42f33770cc8169b86cd25c5e665 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 13:33:16 +0000 Subject: [PATCH 07/41] Fix lint issues --- packages/cache/src/internal/cacheUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index e2580286..1c4f55c0 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -102,7 +102,7 @@ export async function getCompressionMethod(): Promise { if (versionOutput === '' || version === null) { // zstd is not installed return CompressionMethod.Gzip - } else{ + } else { return CompressionMethod.ZstdWithoutLong } } From 4fd425926c62c6a79c4b3eab3abee280f5b8eb7d Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 13:43:24 +0000 Subject: [PATCH 08/41] Fix version number --- packages/cache/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/package.json b/packages/cache/package.json index 3d5dda6b..f274e00c 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "3.1.4", + "version": "3.1.3", "preview": true, "description": "Actions cache lib", "keywords": [ From e18b2d8a33401c0cdcc032df7eaa28d77ee825e7 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 13:43:31 +0000 Subject: [PATCH 09/41] 0.0.1 --- package-lock.json | 6 ++++-- package.json | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e12fe8d2..ec7c14ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,8 @@ "prettier": "^1.19.1", "ts-jest": "^27.0.5", "typescript": "^3.9.9" - } + }, + "version": "0.0.1" }, "node_modules/@babel/code-frame": { "version": "7.0.0", @@ -29851,5 +29852,6 @@ "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", "dev": true } - } + }, + "version": "0.0.1" } diff --git a/package.json b/package.json index 235b6d2a..3ad9aeb8 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,6 @@ "prettier": "^1.19.1", "ts-jest": "^27.0.5", "typescript": "^3.9.9" - } + }, + "version": "0.0.1" } From 0f91c9c203215174cac3148f1607d783634538c3 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 13:44:07 +0000 Subject: [PATCH 10/41] Bump version using npm --- package-lock.json | 6 ++---- package.json | 3 +-- packages/cache/package-lock.json | 4 ++-- packages/cache/package.json | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec7c14ad..e12fe8d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,7 @@ "prettier": "^1.19.1", "ts-jest": "^27.0.5", "typescript": "^3.9.9" - }, - "version": "0.0.1" + } }, "node_modules/@babel/code-frame": { "version": "7.0.0", @@ -29852,6 +29851,5 @@ "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", "dev": true } - }, - "version": "0.0.1" + } } diff --git a/package.json b/package.json index 3ad9aeb8..235b6d2a 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,5 @@ "prettier": "^1.19.1", "ts-jest": "^27.0.5", "typescript": "^3.9.9" - }, - "version": "0.0.1" + } } diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index f9a20106..408660cb 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/cache", - "version": "3.1.3", + "version": "3.1.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/cache", - "version": "3.1.3", + "version": "3.1.4", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/cache/package.json b/packages/cache/package.json index f274e00c..3d5dda6b 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "3.1.3", + "version": "3.1.4", "preview": true, "description": "Actions cache lib", "keywords": [ From 6ec51745adc59fc2b3eb5302f3b56df2f52bfcb0 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 14:23:53 +0000 Subject: [PATCH 11/41] Update debug statement to include latest command --- packages/cache/src/internal/cacheUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 1c4f55c0..0ab64eae 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -72,10 +72,10 @@ export async function unlinkFile(filePath: fs.PathLike): Promise { } async function getVersion(app: string, args?: string[]): Promise { - core.debug(`Checking ${app} --version`) let versionOutput = '' typeof args !== 'undefined' ? args : (args = []) args.push('--version') + core.debug(`Checking ${app} ${args.join(' ')}`) try { await exec.exec(`${app}`, args, { ignoreReturnCode: true, From cf3dd065b8bdc38aa24319052f35499510f0e035 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 14:59:12 +0000 Subject: [PATCH 12/41] Add default value and rename args --- packages/cache/src/internal/cacheUtils.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 0ab64eae..8de857f4 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -71,13 +71,12 @@ export async function unlinkFile(filePath: fs.PathLike): Promise { return util.promisify(fs.unlink)(filePath) } -async function getVersion(app: string, args?: string[]): Promise { +async function getVersion(app: string, additionalArgs: string[] = []): Promise { let versionOutput = '' - typeof args !== 'undefined' ? args : (args = []) - args.push('--version') - core.debug(`Checking ${app} ${args.join(' ')}`) + additionalArgs.push('--version') + core.debug(`Checking ${app} ${additionalArgs.join(' ')}`) try { - await exec.exec(`${app}`, args, { + await exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { From a9d266bb7c5a69f6a69f3774d68c19cdad6b06a3 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 15:26:04 +0000 Subject: [PATCH 13/41] Fix lint issues --- packages/cache/src/internal/cacheUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 8de857f4..8ccae2f7 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -71,7 +71,10 @@ export async function unlinkFile(filePath: fs.PathLike): Promise { return util.promisify(fs.unlink)(filePath) } -async function getVersion(app: string, additionalArgs: string[] = []): Promise { +async function getVersion( + app: string, + additionalArgs: string[] = [] +): Promise { let versionOutput = '' additionalArgs.push('--version') core.debug(`Checking ${app} ${additionalArgs.join(' ')}`) From bc713ab90db83260febb7830c952039ed85e8e6e Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 18:38:47 +0000 Subject: [PATCH 14/41] Add release info --- packages/cache/RELEASES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cache/RELEASES.md b/packages/cache/RELEASES.md index b1d52116..76bec600 100644 --- a/packages/cache/RELEASES.md +++ b/packages/cache/RELEASES.md @@ -114,4 +114,7 @@ - Fix issue with symlink restoration on windows. ### 3.1.3 -- Fix to prevent from setting MYSYS environement variable globally [#1329](https://github.com/actions/toolkit/pull/1329). \ No newline at end of file +- Fix to prevent from setting MYSYS environement variable globally [#1329](https://github.com/actions/toolkit/pull/1329). + +### 3.1.4 +- Fix zstd not being used due to `zstd --version` output change in zstd 1.5.4 release. See [#1353](https://github.com/actions/toolkit/pull/1353). \ No newline at end of file From 7c15bf6f4020cd866eff61b63b74f798b0128b8f Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 18:50:26 +0000 Subject: [PATCH 15/41] Fix failing windows test --- packages/cache/src/internal/cacheUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index 8ccae2f7..ea69b7cc 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -79,7 +79,7 @@ async function getVersion( additionalArgs.push('--version') core.debug(`Checking ${app} ${additionalArgs.join(' ')}`) try { - await exec.exec(`${app}`, additionalArgs, { + await exec.exec(`${app} `, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { From e6e29846f21d19e4a9cd07debd48bb7dfdf85b93 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Mon, 20 Feb 2023 19:03:44 +0000 Subject: [PATCH 16/41] Add debug statement for exact zstd version value and remove dependence on version for now --- packages/cache/src/internal/cacheUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cache/src/internal/cacheUtils.ts b/packages/cache/src/internal/cacheUtils.ts index ea69b7cc..650653ad 100644 --- a/packages/cache/src/internal/cacheUtils.ts +++ b/packages/cache/src/internal/cacheUtils.ts @@ -79,7 +79,7 @@ async function getVersion( additionalArgs.push('--version') core.debug(`Checking ${app} ${additionalArgs.join(' ')}`) try { - await exec.exec(`${app} `, additionalArgs, { + await exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, silent: true, listeners: { @@ -100,9 +100,9 @@ async function getVersion( export async function getCompressionMethod(): Promise { const versionOutput = await getVersion('zstd', ['--quiet']) const version = semver.clean(versionOutput) + core.debug(`zstd version: ${version}`) - if (versionOutput === '' || version === null) { - // zstd is not installed + if (versionOutput === '') { return CompressionMethod.Gzip } else { return CompressionMethod.ZstdWithoutLong From eb06c2179487a20f7c19e16fc559670c4aa664bf Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 23 Dec 2022 12:44:35 +0100 Subject: [PATCH 17/41] Add cache restore dryRun option --- packages/cache/__tests__/options.test.ts | 11 ++++-- packages/cache/__tests__/restoreCache.test.ts | 36 +++++++++++++++++++ packages/cache/src/cache.ts | 5 +++ packages/cache/src/options.ts | 17 ++++++++- 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/packages/cache/__tests__/options.test.ts b/packages/cache/__tests__/options.test.ts index 83d9b227..46e540cb 100644 --- a/packages/cache/__tests__/options.test.ts +++ b/packages/cache/__tests__/options.test.ts @@ -9,6 +9,7 @@ const useAzureSdk = true const downloadConcurrency = 8 const timeoutInMs = 30000 const segmentTimeoutInMs = 3600000 +const dryRun = false const uploadConcurrency = 4 const uploadChunkSize = 32 * 1024 * 1024 @@ -19,7 +20,8 @@ test('getDownloadOptions sets defaults', async () => { useAzureSdk, downloadConcurrency, timeoutInMs, - segmentTimeoutInMs + segmentTimeoutInMs, + dryRun }) }) @@ -28,7 +30,8 @@ test('getDownloadOptions overrides all settings', async () => { useAzureSdk: false, downloadConcurrency: 14, timeoutInMs: 20000, - segmentTimeoutInMs: 3600000 + segmentTimeoutInMs: 3600000, + dryRun: true } const actualOptions = getDownloadOptions(expectedOptions) @@ -61,7 +64,8 @@ test('getDownloadOptions overrides download timeout minutes', async () => { useAzureSdk: false, downloadConcurrency: 14, timeoutInMs: 20000, - segmentTimeoutInMs: 3600000 + segmentTimeoutInMs: 3600000, + dryRun: true } process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS = '10' const actualOptions = getDownloadOptions(expectedOptions) @@ -72,4 +76,5 @@ test('getDownloadOptions overrides download timeout minutes', async () => { ) expect(actualOptions.timeoutInMs).toEqual(expectedOptions.timeoutInMs) expect(actualOptions.segmentTimeoutInMs).toEqual(600000) + expect(actualOptions.dryRun).toEqual(expectedOptions.dryRun) }) diff --git a/packages/cache/__tests__/restoreCache.test.ts b/packages/cache/__tests__/restoreCache.test.ts index 5318a007..c7499dc1 100644 --- a/packages/cache/__tests__/restoreCache.test.ts +++ b/packages/cache/__tests__/restoreCache.test.ts @@ -276,3 +276,39 @@ test('restore with cache found for restore key', async () => { expect(extractTarMock).toHaveBeenCalledWith(archivePath, compression) expect(getCompressionMock).toHaveBeenCalledTimes(1) }) + +test('restore with dry run', async () => { + const paths = ['node_modules'] + const key = 'node-test' + const options = {dryRun: true} + + const cacheEntry: ArtifactCacheEntry = { + cacheKey: key, + scope: 'refs/heads/main', + archiveLocation: 'www.actionscache.test/download' + } + const getCacheMock = jest.spyOn(cacheHttpClient, 'getCacheEntry') + getCacheMock.mockImplementation(async () => { + return Promise.resolve(cacheEntry) + }) + + const createTempDirectoryMock = jest.spyOn(cacheUtils, 'createTempDirectory') + const downloadCacheMock = jest.spyOn(cacheHttpClient, 'downloadCache') + + const compression = CompressionMethod.Gzip + const getCompressionMock = jest + .spyOn(cacheUtils, 'getCompressionMethod') + .mockReturnValue(Promise.resolve(compression)) + + const cacheKey = await restoreCache(paths, key, undefined, options) + + expect(cacheKey).toBe(key) + expect(getCompressionMock).toHaveBeenCalledTimes(1) + expect(getCacheMock).toHaveBeenCalledWith([key], paths, { + compressionMethod: compression, + enableCrossOsArchive: false + }) + // creating a tempDir and downloading the cache are skipped + expect(createTempDirectoryMock).toHaveBeenCalledTimes(0) + expect(downloadCacheMock).toHaveBeenCalledTimes(0) +}) diff --git a/packages/cache/src/cache.ts b/packages/cache/src/cache.ts index ffa13e78..d464bf96 100644 --- a/packages/cache/src/cache.ts +++ b/packages/cache/src/cache.ts @@ -100,6 +100,11 @@ export async function restoreCache( return undefined } + if (options?.dryRun) { + core.info('Dry run - skipping download') + return cacheEntry.cacheKey + } + archivePath = path.join( await utils.createTempDirectory(), utils.getCacheFileName(compressionMethod) diff --git a/packages/cache/src/options.ts b/packages/cache/src/options.ts index 652899a2..49101572 100644 --- a/packages/cache/src/options.ts +++ b/packages/cache/src/options.ts @@ -53,6 +53,15 @@ export interface DownloadOptions { * @default 3600000 */ segmentTimeoutInMs?: number + + /** + * Weather to skip downloading the cache entry. + * If dryRun is set to true, the restore function will only check if + * a matching cache entry exists and return the cache key if it does. + * + * @default false + */ + dryRun?: boolean } /** @@ -92,7 +101,8 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { useAzureSdk: true, downloadConcurrency: 8, timeoutInMs: 30000, - segmentTimeoutInMs: 3600000 + segmentTimeoutInMs: 3600000, + dryRun: false } if (copy) { @@ -111,6 +121,10 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { if (typeof copy.segmentTimeoutInMs === 'number') { result.segmentTimeoutInMs = copy.segmentTimeoutInMs } + + if (typeof copy.dryRun === 'boolean') { + result.dryRun = copy.dryRun + } } const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'] @@ -129,6 +143,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { `Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}` ) core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`) + core.debug(`Dry run: ${result.dryRun}`) return result } From a3849b77aead53f9f89da9a7551f19dde8247f86 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Tue, 17 Jan 2023 17:12:42 +0100 Subject: [PATCH 18/41] Rename option to lookupOnly --- packages/cache/__tests__/options.test.ts | 10 +++++----- packages/cache/__tests__/restoreCache.test.ts | 2 +- packages/cache/src/cache.ts | 4 ++-- packages/cache/src/options.ts | 12 ++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/cache/__tests__/options.test.ts b/packages/cache/__tests__/options.test.ts index 46e540cb..79f04241 100644 --- a/packages/cache/__tests__/options.test.ts +++ b/packages/cache/__tests__/options.test.ts @@ -9,7 +9,7 @@ const useAzureSdk = true const downloadConcurrency = 8 const timeoutInMs = 30000 const segmentTimeoutInMs = 3600000 -const dryRun = false +const lookupOnly = false const uploadConcurrency = 4 const uploadChunkSize = 32 * 1024 * 1024 @@ -21,7 +21,7 @@ test('getDownloadOptions sets defaults', async () => { downloadConcurrency, timeoutInMs, segmentTimeoutInMs, - dryRun + lookupOnly }) }) @@ -31,7 +31,7 @@ test('getDownloadOptions overrides all settings', async () => { downloadConcurrency: 14, timeoutInMs: 20000, segmentTimeoutInMs: 3600000, - dryRun: true + lookupOnly: true } const actualOptions = getDownloadOptions(expectedOptions) @@ -65,7 +65,7 @@ test('getDownloadOptions overrides download timeout minutes', async () => { downloadConcurrency: 14, timeoutInMs: 20000, segmentTimeoutInMs: 3600000, - dryRun: true + lookupOnly: true } process.env.SEGMENT_DOWNLOAD_TIMEOUT_MINS = '10' const actualOptions = getDownloadOptions(expectedOptions) @@ -76,5 +76,5 @@ test('getDownloadOptions overrides download timeout minutes', async () => { ) expect(actualOptions.timeoutInMs).toEqual(expectedOptions.timeoutInMs) expect(actualOptions.segmentTimeoutInMs).toEqual(600000) - expect(actualOptions.dryRun).toEqual(expectedOptions.dryRun) + expect(actualOptions.lookupOnly).toEqual(expectedOptions.lookupOnly) }) diff --git a/packages/cache/__tests__/restoreCache.test.ts b/packages/cache/__tests__/restoreCache.test.ts index c7499dc1..7992490e 100644 --- a/packages/cache/__tests__/restoreCache.test.ts +++ b/packages/cache/__tests__/restoreCache.test.ts @@ -280,7 +280,7 @@ test('restore with cache found for restore key', async () => { test('restore with dry run', async () => { const paths = ['node_modules'] const key = 'node-test' - const options = {dryRun: true} + const options = {lookupOnly: true} const cacheEntry: ArtifactCacheEntry = { cacheKey: key, diff --git a/packages/cache/src/cache.ts b/packages/cache/src/cache.ts index d464bf96..f7fadb6f 100644 --- a/packages/cache/src/cache.ts +++ b/packages/cache/src/cache.ts @@ -100,8 +100,8 @@ export async function restoreCache( return undefined } - if (options?.dryRun) { - core.info('Dry run - skipping download') + if (options?.lookupOnly) { + core.info('Lookup only - skipping download') return cacheEntry.cacheKey } diff --git a/packages/cache/src/options.ts b/packages/cache/src/options.ts index 49101572..cdddeeca 100644 --- a/packages/cache/src/options.ts +++ b/packages/cache/src/options.ts @@ -56,12 +56,12 @@ export interface DownloadOptions { /** * Weather to skip downloading the cache entry. - * If dryRun is set to true, the restore function will only check if + * If lookupOnly is set to true, the restore function will only check if * a matching cache entry exists and return the cache key if it does. * * @default false */ - dryRun?: boolean + lookupOnly?: boolean } /** @@ -102,7 +102,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { downloadConcurrency: 8, timeoutInMs: 30000, segmentTimeoutInMs: 3600000, - dryRun: false + lookupOnly: false } if (copy) { @@ -122,8 +122,8 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { result.segmentTimeoutInMs = copy.segmentTimeoutInMs } - if (typeof copy.dryRun === 'boolean') { - result.dryRun = copy.dryRun + if (typeof copy.lookupOnly === 'boolean') { + result.lookupOnly = copy.lookupOnly } } const segmentDownloadTimeoutMins = @@ -143,7 +143,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { `Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}` ) core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`) - core.debug(`Dry run: ${result.dryRun}`) + core.debug(`Lookup only: ${result.lookupOnly}`) return result } From e45a26f77154a0a6b444ddf1424f34503a958a1c Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Tue, 21 Feb 2023 13:56:25 +0100 Subject: [PATCH 19/41] Update package version and changelog --- packages/cache/RELEASES.md | 5 ++++- packages/cache/package-lock.json | 4 ++-- packages/cache/package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/cache/RELEASES.md b/packages/cache/RELEASES.md index 76bec600..424b7688 100644 --- a/packages/cache/RELEASES.md +++ b/packages/cache/RELEASES.md @@ -117,4 +117,7 @@ - Fix to prevent from setting MYSYS environement variable globally [#1329](https://github.com/actions/toolkit/pull/1329). ### 3.1.4 -- Fix zstd not being used due to `zstd --version` output change in zstd 1.5.4 release. See [#1353](https://github.com/actions/toolkit/pull/1353). \ No newline at end of file +- Fix zstd not being used due to `zstd --version` output change in zstd 1.5.4 release. See [#1353](https://github.com/actions/toolkit/pull/1353). + +### 3.2.0 +- Add `lookupOnly` to cache restore `DownloadOptions`. diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index 408660cb..0d568ff5 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/cache", - "version": "3.1.4", + "version": "3.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/cache", - "version": "3.1.4", + "version": "3.2.0", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/cache/package.json b/packages/cache/package.json index 3d5dda6b..b411de1c 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "3.1.4", + "version": "3.2.0", "preview": true, "description": "Actions cache lib", "keywords": [ From 8d92c9c90351cb195ff8bb3c61da483d61db39e7 Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Wed, 1 Mar 2023 13:45:12 +0000 Subject: [PATCH 20/41] Bypass proxy on loopback IPs --- packages/http-client/__tests__/proxy.test.ts | 26 ++++++++++++++------ packages/http-client/src/proxy.ts | 10 ++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/http-client/__tests__/proxy.test.ts b/packages/http-client/__tests__/proxy.test.ts index ccbceec2..368e0d29 100644 --- a/packages/http-client/__tests__/proxy.test.ts +++ b/packages/http-client/__tests__/proxy.test.ts @@ -223,19 +223,29 @@ describe('proxy', () => { expect(_proxyConnects).toEqual(['httpbin.org:443']) }) - it('HttpClient does basic https get request when bypass proxy', async () => { - process.env['https_proxy'] = _proxyUrl - process.env['no_proxy'] = 'httpbin.org' +it('HttpClient bypasses proxy for loopback addresses (localhost, ::1, 127.*)', async () => { + // setup a server listening on localhost:8091 + var server = http.createServer(function (request, response) { + response.writeHead(200); + request.pipe(response); + }); + await server.listen(8091) + try { + process.env['http_proxy'] = _proxyUrl const httpClient = new httpm.HttpClient() const res: httpm.HttpClientResponse = await httpClient.get( - 'https://httpbin.org/get' + 'http://localhost:8091' ) expect(res.message.statusCode).toBe(200) const body: string = await res.readBody() - const obj = JSON.parse(body) - expect(obj.url).toBe('https://httpbin.org/get') - expect(_proxyConnects).toHaveLength(0) - }) + expect(body).toEqual(''); + // proxy at _proxyUrl was ignored + expect(_proxyConnects).toEqual(undefined) + } + finally { + await server.close() + } +}) it('proxyAuth not set in tunnel agent when authentication is not provided', async () => { process.env['https_proxy'] = 'http://127.0.0.1:8080' diff --git a/packages/http-client/src/proxy.ts b/packages/http-client/src/proxy.ts index e4e43a54..e4a3e49a 100644 --- a/packages/http-client/src/proxy.ts +++ b/packages/http-client/src/proxy.ts @@ -25,6 +25,11 @@ export function checkBypass(reqUrl: URL): boolean { return false } + const reqHost = reqUrl.hostname + if (isLoopbackAddress(reqHost)) { + return true + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '' if (!noProxy) { return false @@ -66,3 +71,8 @@ export function checkBypass(reqUrl: URL): boolean { return false } + +function isLoopbackAddress(host: string): boolean { + const hostUpper = host.toUpperCase() + return hostUpper === 'LOCALHOST' || hostUpper.startsWith('127.') || hostUpper.startsWith('::1') +} From 1f4b3fac06b689186037c0a52e1e876e18de521d Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Wed, 1 Mar 2023 13:48:44 +0000 Subject: [PATCH 21/41] Revert "Bypass proxy on loopback IPs" This reverts commit 8d92c9c90351cb195ff8bb3c61da483d61db39e7. --- packages/http-client/__tests__/proxy.test.ts | 26 ++++++-------------- packages/http-client/src/proxy.ts | 10 -------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/packages/http-client/__tests__/proxy.test.ts b/packages/http-client/__tests__/proxy.test.ts index 368e0d29..ccbceec2 100644 --- a/packages/http-client/__tests__/proxy.test.ts +++ b/packages/http-client/__tests__/proxy.test.ts @@ -223,29 +223,19 @@ describe('proxy', () => { expect(_proxyConnects).toEqual(['httpbin.org:443']) }) -it('HttpClient bypasses proxy for loopback addresses (localhost, ::1, 127.*)', async () => { - // setup a server listening on localhost:8091 - var server = http.createServer(function (request, response) { - response.writeHead(200); - request.pipe(response); - }); - await server.listen(8091) - try { - process.env['http_proxy'] = _proxyUrl + it('HttpClient does basic https get request when bypass proxy', async () => { + process.env['https_proxy'] = _proxyUrl + process.env['no_proxy'] = 'httpbin.org' const httpClient = new httpm.HttpClient() const res: httpm.HttpClientResponse = await httpClient.get( - 'http://localhost:8091' + 'https://httpbin.org/get' ) expect(res.message.statusCode).toBe(200) const body: string = await res.readBody() - expect(body).toEqual(''); - // proxy at _proxyUrl was ignored - expect(_proxyConnects).toEqual(undefined) - } - finally { - await server.close() - } -}) + const obj = JSON.parse(body) + expect(obj.url).toBe('https://httpbin.org/get') + expect(_proxyConnects).toHaveLength(0) + }) it('proxyAuth not set in tunnel agent when authentication is not provided', async () => { process.env['https_proxy'] = 'http://127.0.0.1:8080' diff --git a/packages/http-client/src/proxy.ts b/packages/http-client/src/proxy.ts index e4a3e49a..e4e43a54 100644 --- a/packages/http-client/src/proxy.ts +++ b/packages/http-client/src/proxy.ts @@ -25,11 +25,6 @@ export function checkBypass(reqUrl: URL): boolean { return false } - const reqHost = reqUrl.hostname - if (isLoopbackAddress(reqHost)) { - return true - } - const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '' if (!noProxy) { return false @@ -71,8 +66,3 @@ export function checkBypass(reqUrl: URL): boolean { return false } - -function isLoopbackAddress(host: string): boolean { - const hostUpper = host.toUpperCase() - return hostUpper === 'LOCALHOST' || hostUpper.startsWith('127.') || hostUpper.startsWith('::1') -} From d47e0bac601c7f6e8af58074b75edac3d060d66f Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:02:29 +0100 Subject: [PATCH 22/41] Support '*' wildcard (#1355) --- packages/http-client/__tests__/proxy.test.ts | 9 +++++++-- packages/http-client/src/proxy.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/http-client/__tests__/proxy.test.ts b/packages/http-client/__tests__/proxy.test.ts index ccbceec2..60077a58 100644 --- a/packages/http-client/__tests__/proxy.test.ts +++ b/packages/http-client/__tests__/proxy.test.ts @@ -176,11 +176,16 @@ describe('proxy', () => { expect(bypass).toBeTruthy() }) - // Do not match wildcard ("*") as per https://github.com/actions/runner/blob/97195bad5870e2ad0915ebfef1616083aacf5818/docs/adrs/0263-proxy-support.md it('checkBypass returns true if no_proxy is "*"', () => { process.env['no_proxy'] = '*' const bypass = pm.checkBypass(new URL('https://anything.whatsoever.com')) - expect(bypass).toBeFalsy() + expect(bypass).toBeTruthy() + }) + + it('checkBypass returns true if no_proxy contains comma separated "*"', () => { + process.env['no_proxy'] = 'domain.com,* , example.com' + const bypass = pm.checkBypass(new URL('https://anything.whatsoever.com')) + expect(bypass).toBeTruthy() }) it('HttpClient does basic http get request through proxy', async () => { diff --git a/packages/http-client/src/proxy.ts b/packages/http-client/src/proxy.ts index e4e43a54..3c84c586 100644 --- a/packages/http-client/src/proxy.ts +++ b/packages/http-client/src/proxy.ts @@ -52,6 +52,7 @@ export function checkBypass(reqUrl: URL): boolean { .map(x => x.trim().toUpperCase()) .filter(x => x)) { if ( + upperNoProxyItem === '*' || upperReqHosts.some( x => x === upperNoProxyItem || From 94ab8de5f3856fbf78dcc8637bbd8c526c628e5a Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:07:04 +0100 Subject: [PATCH 23/41] Bypass proxy on loopback IPs (localhost, 127.*, ::1 etc) (#1361) * Bypass proxy on loopback IPs * Expect empty array instead of undefined * Restore accidentally deleted test * Fix formatting * Fix linting * Update proxy.ts * Better ipv6 definitions * Fix linting * Update proxy.test.ts --- packages/http-client/__tests__/proxy.test.ts | 25 ++++++++++++++++++++ packages/http-client/src/proxy.ts | 15 ++++++++++++ 2 files changed, 40 insertions(+) diff --git a/packages/http-client/__tests__/proxy.test.ts b/packages/http-client/__tests__/proxy.test.ts index 60077a58..98d85c86 100644 --- a/packages/http-client/__tests__/proxy.test.ts +++ b/packages/http-client/__tests__/proxy.test.ts @@ -242,6 +242,31 @@ describe('proxy', () => { expect(_proxyConnects).toHaveLength(0) }) + it('HttpClient bypasses proxy for loopback addresses (localhost, ::1, 127.*)', async () => { + // setup a server listening on localhost:8091 + const server = http.createServer((request, response) => { + response.writeHead(200) + request.pipe(response) + }) + server.listen(8091) + try { + process.env['http_proxy'] = _proxyUrl + const httpClient = new httpm.HttpClient() + let res = await httpClient.get('http://localhost:8091') + expect(res.message.statusCode).toBe(200) + res = await httpClient.get('http://127.0.0.1:8091') + expect(res.message.statusCode).toBe(200) + + // no support for ipv6 for now + expect(httpClient.get('http://[::1]:8091')).rejects.toThrow() + + // proxy at _proxyUrl was ignored + expect(_proxyConnects).toEqual([]) + } finally { + server.close() + } + }) + it('proxyAuth not set in tunnel agent when authentication is not provided', async () => { process.env['https_proxy'] = 'http://127.0.0.1:8080' const httpClient = new httpm.HttpClient() diff --git a/packages/http-client/src/proxy.ts b/packages/http-client/src/proxy.ts index 3c84c586..1a967e34 100644 --- a/packages/http-client/src/proxy.ts +++ b/packages/http-client/src/proxy.ts @@ -25,6 +25,11 @@ export function checkBypass(reqUrl: URL): boolean { return false } + const reqHost = reqUrl.hostname + if (isLoopbackAddress(reqHost)) { + return true + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '' if (!noProxy) { return false @@ -67,3 +72,13 @@ export function checkBypass(reqUrl: URL): boolean { return false } + +function isLoopbackAddress(host: string): boolean { + const hostLower = host.toLowerCase() + return ( + hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]') + ) +} From 9ba9ae31a93eba5a2e97e34f0ec6ea30f4600649 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:55:21 +0000 Subject: [PATCH 24/41] updated azure storage blob to 12.13.0 --- packages/cache/package-lock.json | 153 +++++++++++++++---------------- packages/cache/package.json | 2 +- 2 files changed, 75 insertions(+), 80 deletions(-) diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index 408660cb..b3296fe0 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -16,7 +16,7 @@ "@actions/io": "^1.0.1", "@azure/abort-controller": "^1.1.0", "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.8.0", + "@azure/storage-blob": "^12.13.0", "semver": "^6.1.0", "uuid": "^3.3.3" }, @@ -112,28 +112,27 @@ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/@azure/core-http": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.3.tgz", - "integrity": "sha512-xr8AeszxP418rI//W38NfJDDr0kbVAPZkURZnZ+Fle+lLWeURjDE5zNIuocA1wUPoKSP8iXc0ApW6nPtbLGswA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.0.tgz", + "integrity": "sha512-BxI2SlGFPPz6J1XyZNIVUf0QZLBKFX+ViFjKOkzqD18J1zOINIQ8JSBKKr+i+v8+MB6LacL6Nn/sP/TE13+s2Q==", "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-asynciterator-polyfill": "^1.0.0", "@azure/core-auth": "^1.3.0", "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-util": "^1.1.1", "@azure/logger": "^1.0.0", "@types/node-fetch": "^2.5.0", "@types/tunnel": "^0.0.3", "form-data": "^4.0.0", - "node-fetch": "^2.6.6", + "node-fetch": "^2.6.7", "process": "^0.11.10", - "tough-cookie": "^4.0.0", "tslib": "^2.2.0", "tunnel": "^0.0.6", "uuid": "^8.3.0", "xml2js": "^0.4.19" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/core-http/node_modules/form-data": { @@ -149,23 +148,10 @@ "node": ">= 6" } }, - "node_modules/@azure/core-http/node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@azure/core-http/node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "node_modules/@azure/core-http/node_modules/uuid": { "version": "8.3.2", @@ -228,6 +214,23 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, + "node_modules/@azure/core-util": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.2.0.tgz", + "integrity": "sha512-ffGIw+Qs8bNKNLxz5UPkz4/VBM/EZY07mPve1ZYFqYUdPwFqRj0RPk0U7LZMOfT7GCck9YjuT1Rfp1PApNl1ng==", + "dependencies": { + "@azure/abort-controller": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@azure/core-util/node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + }, "node_modules/@azure/logger": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz", @@ -269,12 +272,12 @@ } }, "node_modules/@azure/storage-blob": { - "version": "12.8.0", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.8.0.tgz", - "integrity": "sha512-c8+Wz19xauW0bGkTCoqZH4dYfbtBniPiGiRQOn1ca6G5jsjr4azwaTk9gwjVY8r3vY2Taf95eivLzipfIfiS4A==", + "version": "12.13.0", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.13.0.tgz", + "integrity": "sha512-t3Q2lvBMJucgTjQcP5+hvEJMAsJSk0qmAnjDLie2td017IiduZbbC9BOcFfmwzR6y6cJdZOuewLCNFmEx9IrXA==", "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-http": "^2.0.0", + "@azure/core-http": "^3.0.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", "@azure/core-tracing": "1.0.0-preview.13", @@ -283,7 +286,7 @@ "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/storage-blob/node_modules/tslib": { @@ -300,14 +303,14 @@ } }, "node_modules/@types/node": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.14.tgz", - "integrity": "sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng==" + "version": "18.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.6.tgz", + "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==" }, "node_modules/@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", "dependencies": { "@types/node": "*", "form-data": "^3.0.0" @@ -489,7 +492,7 @@ "node_modules/process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "engines": { "node": ">= 0.6.0" } @@ -564,14 +567,6 @@ "node": ">=4.2.0" } }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -700,21 +695,20 @@ } }, "@azure/core-http": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.3.tgz", - "integrity": "sha512-xr8AeszxP418rI//W38NfJDDr0kbVAPZkURZnZ+Fle+lLWeURjDE5zNIuocA1wUPoKSP8iXc0ApW6nPtbLGswA==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.0.tgz", + "integrity": "sha512-BxI2SlGFPPz6J1XyZNIVUf0QZLBKFX+ViFjKOkzqD18J1zOINIQ8JSBKKr+i+v8+MB6LacL6Nn/sP/TE13+s2Q==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-asynciterator-polyfill": "^1.0.0", "@azure/core-auth": "^1.3.0", "@azure/core-tracing": "1.0.0-preview.13", + "@azure/core-util": "^1.1.1", "@azure/logger": "^1.0.0", "@types/node-fetch": "^2.5.0", "@types/tunnel": "^0.0.3", "form-data": "^4.0.0", - "node-fetch": "^2.6.6", + "node-fetch": "^2.6.7", "process": "^0.11.10", - "tough-cookie": "^4.0.0", "tslib": "^2.2.0", "tunnel": "^0.0.6", "uuid": "^8.3.0", @@ -731,20 +725,10 @@ "mime-types": "^2.1.12" } }, - "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "requires": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - } - }, "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" }, "uuid": { "version": "8.3.2", @@ -803,6 +787,22 @@ } } }, + "@azure/core-util": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.2.0.tgz", + "integrity": "sha512-ffGIw+Qs8bNKNLxz5UPkz4/VBM/EZY07mPve1ZYFqYUdPwFqRj0RPk0U7LZMOfT7GCck9YjuT1Rfp1PApNl1ng==", + "requires": { + "@azure/abort-controller": "^1.0.0", + "tslib": "^2.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + } + } + }, "@azure/logger": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.3.tgz", @@ -842,12 +842,12 @@ } }, "@azure/storage-blob": { - "version": "12.8.0", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.8.0.tgz", - "integrity": "sha512-c8+Wz19xauW0bGkTCoqZH4dYfbtBniPiGiRQOn1ca6G5jsjr4azwaTk9gwjVY8r3vY2Taf95eivLzipfIfiS4A==", + "version": "12.13.0", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.13.0.tgz", + "integrity": "sha512-t3Q2lvBMJucgTjQcP5+hvEJMAsJSk0qmAnjDLie2td017IiduZbbC9BOcFfmwzR6y6cJdZOuewLCNFmEx9IrXA==", "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-http": "^2.0.0", + "@azure/core-http": "^3.0.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", "@azure/core-tracing": "1.0.0-preview.13", @@ -869,14 +869,14 @@ "integrity": "sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog==" }, "@types/node": { - "version": "17.0.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.14.tgz", - "integrity": "sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng==" + "version": "18.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.14.6.tgz", + "integrity": "sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA==" }, "@types/node-fetch": { - "version": "2.5.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", - "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", "requires": { "@types/node": "*", "form-data": "^3.0.0" @@ -1016,7 +1016,7 @@ "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" }, "psl": { "version": "1.8.0", @@ -1069,11 +1069,6 @@ "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", "dev": true }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" - }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", diff --git a/packages/cache/package.json b/packages/cache/package.json index 3d5dda6b..a34a8635 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -44,7 +44,7 @@ "@actions/io": "^1.0.1", "@azure/abort-controller": "^1.1.0", "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.8.0", + "@azure/storage-blob": "^12.13.0", "semver": "^6.1.0", "uuid": "^3.3.3" }, From ce1bf116fc290da110c2919ab135facd8d1bffc7 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:56:51 +0000 Subject: [PATCH 25/41] formatted and updated releases file --- packages/cache/RELEASES.md | 44 +++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/packages/cache/RELEASES.md b/packages/cache/RELEASES.md index 76bec600..73cb6a1f 100644 --- a/packages/cache/RELEASES.md +++ b/packages/cache/RELEASES.md @@ -5,116 +5,154 @@ - Initial release ### 0.2.0 + - Fixes issues with the zstd compression algorithm on Windows and Ubuntu 16.04 [#469](https://github.com/actions/toolkit/pull/469) ### 0.2.1 + - Fix to await async function getCompressionMethod ### 1.0.0 + - Downloads Azure-hosted caches using the Azure SDK for speed and reliability - Displays download progress - Includes changes that break compatibility with earlier versions, including: - `retry`, `retryTypedResponse`, and `retryHttpClientResponse` moved from `cacheHttpClient` to `requestUtils` ### 1.0.1 + - Fix bug in downloading large files (> 2 GBs) with the Azure SDK ### 1.0.2 + - Use posix archive format to add support for some tools ### 1.0.3 + - Use http-client v1.0.9 - Fixes error handling so retries are not attempted on non-retryable errors (409 Conflict, for example) - Adds 5 second delay between retry attempts ### 1.0.4 + - Use @actions/core v1.2.6 - Fixes uploadChunk to throw an error if any unsuccessful response code is received ### 1.0.5 + - Fix to ensure Windows cache paths get resolved correctly ### 1.0.6 + - Make caching more verbose [#650](https://github.com/actions/toolkit/pull/650) - Use GNU tar on macOS if available [#701](https://github.com/actions/toolkit/pull/701) ### 1.0.7 + - Fixes permissions issue extracting archives with GNU tar on macOS ([issue](https://github.com/actions/cache/issues/527)) ### 1.0.8 + - Increase the allowed artifact cache size from 5GB to 10GB ([issue](https://github.com/actions/cache/discussions/497)) ### 1.0.9 - - Use @azure/ms-rest-js v2.6.0 - - Use @azure/storage-blob v12.8.0 + +- Use @azure/ms-rest-js v2.6.0 +- Use @azure/storage-blob v12.8.0 ### 1.0.10 + - Update `lockfileVersion` to `v2` in `package-lock.json [#1022](https://github.com/actions/toolkit/pull/1022) ### 1.0.11 + - Fix file downloads > 2GB([issue](https://github.com/actions/cache/issues/773)) ### 2.0.0 + - Added support to check if Actions cache service feature is available or not [#1028](https://github.com/actions/toolkit/pull/1028) ### 2.0.3 + - Update to v2.0.0 of `@actions/http-client` ### 2.0.4 + - Update to v2.0.1 of `@actions/http-client` [#1087](https://github.com/actions/toolkit/pull/1087) ### 2.0.5 + - Fix to avoid saving empty cache when no files are available for caching. ([issue](https://github.com/actions/cache/issues/624)) ### 2.0.6 + - Fix `Tar failed with error: The process '/usr/bin/tar' failed with exit code 1` issue when temp directory where tar is getting created is actually the subdirectory of the path mentioned by the user for caching. ([issue](https://github.com/actions/cache/issues/689)) ### 3.0.0 + - Updated actions/cache to suppress Actions cache server error and log warning for those error [#1122](https://github.com/actions/toolkit/pull/1122) ### 3.0.1 + - Fix [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory. - Fix [#809](https://github.com/actions/cache/issues/809) `zstd -d: no such file or directory` error on AWS self-hosted runners. ### 3.0.2 + - Added 1 hour timeout for the download stuck issue [#810](https://github.com/actions/cache/issues/810). ### 3.0.3 + - Bug fixes for download stuck issue [#810](https://github.com/actions/cache/issues/810). ### 3.0.4 + - Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891). - Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 60 minutes. ### 3.0.5 + - Update `@actions/cache` to use `@actions/core@^1.10.0` ### 3.0.6 + - Added `@azure/abort-controller` to dependencies to fix compatibility issue with ESM [#1208](https://github.com/actions/toolkit/issues/1208) ### 3.1.0-beta.1 + - Update actions/cache on windows to use gnu tar and zstd by default and fallback to bsdtar and zstd if gnu tar is not available. ([issue](https://github.com/actions/cache/issues/984)) ### 3.1.0-beta.2 + - Added support for fallback to gzip to restore old caches on windows. ### 3.1.0-beta.3 + - Bug Fixes for fallback to gzip to restore old caches on windows and bsdtar if gnutar is not available. ### 3.1.0 + - Update actions/cache on windows to use gnu tar and zstd by default - Update actions/cache on windows to fallback to bsdtar and zstd if gnu tar is not available. - Added support for fallback to gzip to restore old caches on windows. ### 3.1.1 + - Reverted changes in 3.1.0 to fix issue with symlink restoration on windows. - Added support for verbose logging about cache version during cache miss. ### 3.1.2 + - Fix issue with symlink restoration on windows. ### 3.1.3 + - Fix to prevent from setting MYSYS environement variable globally [#1329](https://github.com/actions/toolkit/pull/1329). ### 3.1.4 -- Fix zstd not being used due to `zstd --version` output change in zstd 1.5.4 release. See [#1353](https://github.com/actions/toolkit/pull/1353). \ No newline at end of file + +- Fix zstd not being used due to `zstd --version` output change in zstd 1.5.4 release. See [#1353](https://github.com/actions/toolkit/pull/1353). + +### 3.1.5 + +- Updated @azure/storage-blob to `v12.13.0` From 97f21173ccb59ee7b7d7c1ecd05f2313a009e953 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:18:32 +0000 Subject: [PATCH 26/41] upgraded typescript version Upgrade ts version to support latest azure sdk --- packages/cache/package.json | 2 +- packages/cache/tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cache/package.json b/packages/cache/package.json index a34a8635..ee29d98a 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -51,6 +51,6 @@ "devDependencies": { "@types/semver": "^6.0.0", "@types/uuid": "^3.4.5", - "typescript": "^3.8.3" + "typescript": "~4.8.0" } } diff --git a/packages/cache/tsconfig.json b/packages/cache/tsconfig.json index 2cddd408..1fbe66c8 100644 --- a/packages/cache/tsconfig.json +++ b/packages/cache/tsconfig.json @@ -4,7 +4,8 @@ "baseUrl": "./", "outDir": "./lib", "rootDir": "./src", - "lib": ["es6", "dom"] + "lib": ["es6", "dom"], + "useUnknownInCatchVariables": false }, "include": [ "./src" From 703d5ac24a70903c32326605b741918a44907621 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:22:47 +0000 Subject: [PATCH 27/41] fixed lockfile --- packages/cache/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index b3296fe0..3c64d03b 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -23,7 +23,7 @@ "devDependencies": { "@types/semver": "^6.0.0", "@types/uuid": "^3.4.5", - "typescript": "^3.8.3" + "typescript": "~4.8.0" } }, "node_modules/@actions/core": { @@ -555,9 +555,9 @@ } }, "node_modules/typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -1064,9 +1064,9 @@ "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true }, "uuid": { From f3de1e53d628310756183415a00887f3ac6e15cd Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 12:36:29 +0000 Subject: [PATCH 28/41] updated version --- packages/cache/package-lock.json | 4 ++-- packages/cache/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index 3c64d03b..d9937a30 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/cache", - "version": "3.1.4", + "version": "3.1.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@actions/cache", - "version": "3.1.4", + "version": "3.1.5", "license": "MIT", "dependencies": { "@actions/core": "^1.10.0", diff --git a/packages/cache/package.json b/packages/cache/package.json index ee29d98a..10645728 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@actions/cache", - "version": "3.1.4", + "version": "3.1.5", "preview": true, "description": "Actions cache lib", "keywords": [ From e6e7b6156f2a057c3c09e099f2f7dcdb7e65a70a Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:11:54 +0000 Subject: [PATCH 29/41] updated segment size to 128MB for failing fast --- packages/cache/src/internal/downloadUtils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cache/src/internal/downloadUtils.ts b/packages/cache/src/internal/downloadUtils.ts index 265c34f7..7d44caf1 100644 --- a/packages/cache/src/internal/downloadUtils.ts +++ b/packages/cache/src/internal/downloadUtils.ts @@ -242,7 +242,9 @@ export async function downloadCacheStorageSDK( // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB // on 64-bit systems), split the download into multiple segments // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly. - const maxSegmentSize = Math.min(2147483647, buffer.constants.MAX_LENGTH) + + // Updated segment size to 128MB to complete a segment faster and fail fast + const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH) const downloadProgress = new DownloadProgress(contentLength) const fd = fs.openSync(archivePath, 'w') From d9a2c5a9f9bdba3ec923782a52a682f550439a9c Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:20:45 +0000 Subject: [PATCH 30/41] updated comment with more info --- packages/cache/src/internal/downloadUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/internal/downloadUtils.ts b/packages/cache/src/internal/downloadUtils.ts index 7d44caf1..7e1b1e8a 100644 --- a/packages/cache/src/internal/downloadUtils.ts +++ b/packages/cache/src/internal/downloadUtils.ts @@ -243,7 +243,7 @@ export async function downloadCacheStorageSDK( // on 64-bit systems), split the download into multiple segments // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly. - // Updated segment size to 128MB to complete a segment faster and fail fast + // Updated segment size to 128MB = 134217728 bytes, to complete a segment faster and fail fast const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH) const downloadProgress = new DownloadProgress(contentLength) From 8e32b1fca32bad4c3f1abf98031ffd8b12b0371a Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:38:19 +0000 Subject: [PATCH 31/41] updated version prefix to caret for ts dep --- packages/cache/package-lock.json | 2 +- packages/cache/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cache/package-lock.json b/packages/cache/package-lock.json index d9937a30..225c463e 100644 --- a/packages/cache/package-lock.json +++ b/packages/cache/package-lock.json @@ -23,7 +23,7 @@ "devDependencies": { "@types/semver": "^6.0.0", "@types/uuid": "^3.4.5", - "typescript": "~4.8.0" + "typescript": "^4.8.0" } }, "node_modules/@actions/core": { diff --git a/packages/cache/package.json b/packages/cache/package.json index 10645728..01e1c4a6 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -51,6 +51,6 @@ "devDependencies": { "@types/semver": "^6.0.0", "@types/uuid": "^3.4.5", - "typescript": "~4.8.0" + "typescript": "^4.8.0" } } From 787b2cf270deaf96f0f7d166cc7fa6c9d3fb8ded Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:03:09 +0100 Subject: [PATCH 32/41] Bump http-client to version 2.1.0 (#1364) * Update package.json * Update package.json * Update RELEASES.md --- packages/http-client/RELEASES.md | 4 ++++ packages/http-client/package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/http-client/RELEASES.md b/packages/http-client/RELEASES.md index 344555f9..d3195080 100644 --- a/packages/http-client/RELEASES.md +++ b/packages/http-client/RELEASES.md @@ -1,5 +1,9 @@ ## Releases +## 2.1.0 +- Add support for `*` and subdomains in `no_proxy` [#1355](https://github.com/actions/toolkit/pull/1355) [#1223](https://github.com/actions/toolkit/pull/1223) +- Bypass proxy for loopback IP adresses [#1360](https://github.com/actions/toolkit/pull/1360)) + ## 2.0.1 - Fix an issue with missing `tunnel` dependency [#1085](https://github.com/actions/toolkit/pull/1085) diff --git a/packages/http-client/package.json b/packages/http-client/package.json index c1de2213..7f5c8ec3 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "2.0.1", + "version": "2.1.0", "description": "Actions Http Client", "keywords": [ "github", From 40ec298d4b9e13f663c34fd68e1f98f3cbc45c75 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Wed, 8 Mar 2023 07:28:50 +0000 Subject: [PATCH 33/41] updated segment timeout to 10 mins --- packages/cache/src/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/options.ts b/packages/cache/src/options.ts index 652899a2..4b20d0f1 100644 --- a/packages/cache/src/options.ts +++ b/packages/cache/src/options.ts @@ -92,7 +92,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { useAzureSdk: true, downloadConcurrency: 8, timeoutInMs: 30000, - segmentTimeoutInMs: 3600000 + segmentTimeoutInMs: 600000 } if (copy) { From 7d1daaf15e344cc5195f71af58b0fb97bc171c5e Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:26:29 +0000 Subject: [PATCH 34/41] Fixed test case --- packages/cache/__tests__/options.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/__tests__/options.test.ts b/packages/cache/__tests__/options.test.ts index 83d9b227..50c05ee2 100644 --- a/packages/cache/__tests__/options.test.ts +++ b/packages/cache/__tests__/options.test.ts @@ -8,7 +8,7 @@ import { const useAzureSdk = true const downloadConcurrency = 8 const timeoutInMs = 30000 -const segmentTimeoutInMs = 3600000 +const segmentTimeoutInMs = 600000 const uploadConcurrency = 4 const uploadChunkSize = 32 * 1024 * 1024 From 7a11743b350a16c359d95f12f3782b6a9a84deba Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Wed, 8 Mar 2023 19:14:15 +0000 Subject: [PATCH 35/41] Fixed typo --- packages/cache/src/options.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/options.ts b/packages/cache/src/options.ts index 36ff7634..a518d207 100644 --- a/packages/cache/src/options.ts +++ b/packages/cache/src/options.ts @@ -101,7 +101,7 @@ export function getDownloadOptions(copy?: DownloadOptions): DownloadOptions { useAzureSdk: true, downloadConcurrency: 8, timeoutInMs: 30000, - segmentTimeoutInMs: 600000 + segmentTimeoutInMs: 600000, lookupOnly: false } From b8261b0fb02a0b8a1df222deba8c8d503f02a796 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:21:20 +0530 Subject: [PATCH 36/41] Update README.md --- packages/cache/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cache/README.md b/packages/cache/README.md index 5fec54ae..100092e4 100644 --- a/packages/cache/README.md +++ b/packages/cache/README.md @@ -44,6 +44,8 @@ const cacheKey = await cache.restoreCache(paths, key, restoreKeys) ##### Cache segment restore timeout -A cache gets downloaded in multiple segments of fixed sizes (`1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.4` of cache package introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss. +A cache gets downloaded in multiple segments of fixed sizes (now 128MB to fail fast, previously `1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner were used). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.4` of cache package introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss. + +Default value of this timeout is 10 minutes (starting `v3.2.1` and higher, previously 60 minutes in versions `v.3.0.4` to `v3.2.0`) and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes. + -Default value of this timeout is 60 minutes and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes. From 599c6164e82f96b8d56fbb0933946f19f2fd03ee Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:23:41 +0530 Subject: [PATCH 37/41] Update README.md --- packages/cache/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/README.md b/packages/cache/README.md index 100092e4..1925de18 100644 --- a/packages/cache/README.md +++ b/packages/cache/README.md @@ -44,7 +44,7 @@ const cacheKey = await cache.restoreCache(paths, key, restoreKeys) ##### Cache segment restore timeout -A cache gets downloaded in multiple segments of fixed sizes (now 128MB to fail fast, previously `1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner were used). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.4` of cache package introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss. +A cache gets downloaded in multiple segments of fixed sizes (now `128MB` to fail-fast, previously `1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner were used). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.4` of cache package introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss. Default value of this timeout is 10 minutes (starting `v3.2.1` and higher, previously 60 minutes in versions `v.3.0.4` to `v3.2.0`) and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes. From 94e340bfb1378be4b03009bf3c53212e98b69dd5 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:24:15 +0530 Subject: [PATCH 38/41] Update README.md --- packages/cache/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/README.md b/packages/cache/README.md index 1925de18..55185032 100644 --- a/packages/cache/README.md +++ b/packages/cache/README.md @@ -46,6 +46,6 @@ const cacheKey = await cache.restoreCache(paths, key, restoreKeys) A cache gets downloaded in multiple segments of fixed sizes (now `128MB` to fail-fast, previously `1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner were used). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.4` of cache package introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss. -Default value of this timeout is 10 minutes (starting `v3.2.1` and higher, previously 60 minutes in versions `v.3.0.4` to `v3.2.0`) and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes. +Default value of this timeout is 10 minutes (starting `v3.2.1` and higher, previously 60 minutes in versions between `v.3.0.4` and `v3.2.0`, both included) and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes. From 8e804e9f8da650c2c7c675695601d53c8b12f45c Mon Sep 17 00:00:00 2001 From: Cory Miller <13227161+cory-miller@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:07:26 +0000 Subject: [PATCH 39/41] locks --- packages/io/__tests__/io.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/io/__tests__/io.test.ts b/packages/io/__tests__/io.test.ts index 8c10f86d..bf095c9b 100644 --- a/packages/io/__tests__/io.test.ts +++ b/packages/io/__tests__/io.test.ts @@ -331,7 +331,7 @@ describe('rmRF', () => { await fs.appendFile(filePath, 'some data') await assertExists(filePath) - const fd = await fs.open(filePath, 'r') + const fd = await fs.open(filePath, fs.constants.O_RDONLY | fs.constants.UV_FS_O_EXLOCK) await io.rmRF(testPath) await assertNotExists(testPath) From 59ec9d07a4a74f38ac023f06c4ec00b16d3769f9 Mon Sep 17 00:00:00 2001 From: Cory Miller <13227161+cory-miller@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:35:29 +0000 Subject: [PATCH 40/41] . --- packages/io/__tests__/io.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/io/__tests__/io.test.ts b/packages/io/__tests__/io.test.ts index bf095c9b..b8adf07e 100644 --- a/packages/io/__tests__/io.test.ts +++ b/packages/io/__tests__/io.test.ts @@ -1,5 +1,6 @@ import * as child from 'child_process' import {promises as fs} from 'fs' +import { constants } from 'fs/promises' import * as os from 'os' import * as path from 'path' import * as io from '../src/io' @@ -331,7 +332,7 @@ describe('rmRF', () => { await fs.appendFile(filePath, 'some data') await assertExists(filePath) - const fd = await fs.open(filePath, fs.constants.O_RDONLY | fs.constants.UV_FS_O_EXLOCK) + const fd = await fs.open(filePath, fs.constants.O_RDONLY | 0x10000000) await io.rmRF(testPath) await assertNotExists(testPath) From 7cbe5b94702ce27d2c6515a15878fa7ffba7c8f8 Mon Sep 17 00:00:00 2001 From: Cory Miller <13227161+cory-miller@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:39:43 +0000 Subject: [PATCH 41/41] . --- packages/io/__tests__/io.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/io/__tests__/io.test.ts b/packages/io/__tests__/io.test.ts index b8adf07e..0c44fce8 100644 --- a/packages/io/__tests__/io.test.ts +++ b/packages/io/__tests__/io.test.ts @@ -1,6 +1,5 @@ import * as child from 'child_process' import {promises as fs} from 'fs' -import { constants } from 'fs/promises' import * as os from 'os' import * as path from 'path' import * as io from '../src/io'