Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate cache service v2 #1857

Merged
merged 47 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
32dbccb
Add debug message
Link- May 23, 2024
264230c
add debug
Link- May 23, 2024
c8466d1
Add twirp client
Link- May 29, 2024
66d5434
Add v2 cache upload
Link- Jun 10, 2024
dccc3f7
Fix upload mechanics
Link- Jun 10, 2024
6635d12
Implement cache v2
Link- Jun 10, 2024
146143a
Implement cache v2
Link- Jun 10, 2024
9e63a77
Implement cache v2
Link- Jun 10, 2024
5e5faf7
Use zlib for compression
Link- Jun 13, 2024
5afc042
Add download cache v2
Link- Jun 17, 2024
8d7ed4f
Fix cache service url bug
Link- Jun 17, 2024
7640cf1
Fix cache misses
Link- Jun 17, 2024
e1b7e78
Fix cache misses
Link- Jun 17, 2024
04d1a7e
Add fix cache paths
Link- Jun 17, 2024
4902d3a
Add backend ids
Link- Jun 24, 2024
70e5684
Merge branch 'main' into neo-cache-service
Link- Sep 24, 2024
07e51a4
Add cache service v2 client
Link- Sep 24, 2024
e62c642
Fix service urls
Link- Sep 24, 2024
13abc95
Port restoreCache to new service
Link- Oct 9, 2024
4d1dedf
Merge branch 'main' into neo-cache-service
Link- Oct 9, 2024
d399e33
Merge branch 'main' into neo-cache-service
Link- Oct 21, 2024
89354f6
Cleanup implementation and use tarballs instead of streaming zip
Link- Oct 21, 2024
28dbd8f
Cleanups and package refactoring
Link- Oct 24, 2024
01bf918
Refactoring & cleanup
Link- Oct 24, 2024
75cdb2c
Merge branch 'main' into neo-cache-service
Link- Nov 14, 2024
9da70ff
Post merge cleanup
Link- Nov 14, 2024
4e1912a
Restore __tests__
Link- Nov 14, 2024
d109d9c
Handle ACTIONS_CACHE_SERVICE_V2 feature flag
Link- Nov 14, 2024
9dff82c
Port dependencies & remove dependency on toolkit/artifacts
Link- Nov 14, 2024
69409b3
Fix broken test
Link- Nov 14, 2024
b2557ac
Formatting and stylistic cleanup
Link- Nov 14, 2024
19cdd5f
Linter cleanups
Link- Nov 14, 2024
83baffc
Package upgrades with security fixes
Link- Nov 14, 2024
2ee77e6
Add missing function return types
Link- Nov 14, 2024
c3e354d
Remove unnecessary debug information
Link- Nov 14, 2024
ea4bf48
Remove unnecessary debug information
Link- Nov 14, 2024
5e9ef85
Lint fixes
Link- Nov 14, 2024
ab8110f
Remove unecessary packages from top level package.json
Link- Nov 14, 2024
555b03f
Revert package.json
Link- Nov 14, 2024
68ab87c
Add check to make sure archive has been created already
Link- Nov 14, 2024
6c11d44
Remove unnecessary type hints
Link- Nov 14, 2024
3ca8547
Merge branch 'neo-cache-service' of github.com:actions/toolkit into n…
Link- Nov 14, 2024
8616c31
Remove unused definitions
Link- Nov 14, 2024
a1e6ef3
Update cache service APIs & cleanup
Link- Nov 20, 2024
ab58a59
Bump cross-spawn to 7.0.6
Link- Nov 20, 2024
267841d
Add isGhes gate and refactor to clean up circular dependencies
Link- Nov 21, 2024
e2028d4
Linter fixes and remove unnecessary dependency
Link- Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions package-lock.json

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

7 changes: 4 additions & 3 deletions packages/artifact/package-lock.json

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

3 changes: 2 additions & 1 deletion packages/cache/__tests__/cacheHttpClient.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {downloadCache, getCacheVersion} from '../src/internal/cacheHttpClient'
import {downloadCache} from '../src/internal/cacheHttpClient'
import {getCacheVersion} from '../src/internal/cacheUtils'
import {CompressionMethod} from '../src/internal/constants'
import * as downloadUtils from '../src/internal/downloadUtils'
import {DownloadOptions, getDownloadOptions} from '../src/options'
Expand Down
20 changes: 0 additions & 20 deletions packages/cache/__tests__/cacheUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,3 @@ test('resolvePaths works on github workspace directory', async () => {
const paths = await cacheUtils.resolvePaths([workspace])
expect(paths.length).toBeGreaterThan(0)
})

test('isGhes returns false for github.com', async () => {
process.env.GITHUB_SERVER_URL = 'https://github.com'
expect(cacheUtils.isGhes()).toBe(false)
})

test('isGhes returns false for ghe.com', async () => {
process.env.GITHUB_SERVER_URL = 'https://somedomain.ghe.com'
expect(cacheUtils.isGhes()).toBe(false)
})

test('isGhes returns true for enterprise URL', async () => {
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
expect(cacheUtils.isGhes()).toBe(true)
})

test('isGhes returns false for ghe.localhost', () => {
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost'
expect(cacheUtils.isGhes()).toBe(false)
})
25 changes: 25 additions & 0 deletions packages/cache/__tests__/config.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as config from '../src/internal/config'

beforeEach(() => {
jest.resetModules()
})

test('isGhes returns false for github.com', async () => {
process.env.GITHUB_SERVER_URL = 'https://github.com'
expect(config.isGhes()).toBe(false)
})

test('isGhes returns false for ghe.com', async () => {
process.env.GITHUB_SERVER_URL = 'https://somedomain.ghe.com'
expect(config.isGhes()).toBe(false)
})

test('isGhes returns true for enterprise URL', async () => {
process.env.GITHUB_SERVER_URL = 'https://my-enterprise.github.com'
expect(config.isGhes()).toBe(true)
})

test('isGhes returns false for ghe.localhost', () => {
process.env.GITHUB_SERVER_URL = 'https://my.domain.ghe.localhost'
expect(config.isGhes()).toBe(false)
})
6 changes: 4 additions & 2 deletions packages/cache/__tests__/saveCache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as path from 'path'
import {saveCache} from '../src/cache'
import * as cacheHttpClient from '../src/internal/cacheHttpClient'
import * as cacheUtils from '../src/internal/cacheUtils'
import * as config from '../src/internal/config'
import {CacheFilename, CompressionMethod} from '../src/internal/constants'
import * as tar from '../src/internal/tar'
import {TypedResponse} from '@actions/http-client/lib/interfaces'
Expand All @@ -14,6 +15,7 @@ import {HttpClientError} from '@actions/http-client'

jest.mock('../src/internal/cacheHttpClient')
jest.mock('../src/internal/cacheUtils')
jest.mock('../src/internal/config')
jest.mock('../src/internal/tar')

beforeAll(() => {
Expand Down Expand Up @@ -94,7 +96,7 @@ test('save with large cache outputs should fail in GHES with error message', asy
.spyOn(cacheUtils, 'getCompressionMethod')
.mockReturnValueOnce(Promise.resolve(compression))

jest.spyOn(cacheUtils, 'isGhes').mockReturnValueOnce(true)
jest.spyOn(config, 'isGhes').mockReturnValueOnce(true)

const reserveCacheMock = jest
.spyOn(cacheHttpClient, 'reserveCache')
Expand Down Expand Up @@ -146,7 +148,7 @@ test('save with large cache outputs should fail in GHES without error message',
.spyOn(cacheUtils, 'getCompressionMethod')
.mockReturnValueOnce(Promise.resolve(compression))

jest.spyOn(cacheUtils, 'isGhes').mockReturnValueOnce(true)
jest.spyOn(config, 'isGhes').mockReturnValueOnce(true)

const reserveCacheMock = jest
.spyOn(cacheHttpClient, 'reserveCache')
Expand Down
Loading
Loading