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

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open

Integrate cache service v2 #1857

wants to merge 43 commits into from

Conversation

Link-
Copy link
Member

@Link- Link- commented Oct 24, 2024

Upgrading the cache package to integrate with the new cache service backend (cache service v2). Major changes to the API layer are involved with this change but the interfaces are backward compatible. The transition to the new service will undergo gradual rollout and will be seamless to end users.

More context

Deprecation notice for v1 and v2 of actions/cache

@Link- Link- self-assigned this Oct 24, 2024
package.json Outdated Show resolved Hide resolved
packages/cache/package.json Outdated Show resolved Hide resolved
packages/cache/src/internal/config.ts Outdated Show resolved Hide resolved
Liabaemt

This comment was marked as spam.

@Liabaemt

This comment was marked as spam.

@Link- Link- marked this pull request as ready for review November 14, 2024 12:02
@Link- Link- requested review from a team as code owners November 14, 2024 12:02
@Link- Link- requested a review from robherley November 14, 2024 12:52
package.json Outdated Show resolved Hide resolved
packages/cache/src/cache.ts Outdated Show resolved Hide resolved
* @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
* @returns string returns the key for the cache hit, otherwise returns undefined
*/
async function restoreCachev2(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an opportunity to share code between restoreCachev1 and restoreCachev2 instead of duplicating it all?

That would make it easier to see what's actually changing and improve long-term maintenance of supporting both paths (such as for GHES).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's easier to reason about what each function is doing this way. We don't have to couple the behaviour of each with more shared functions. The utility functions are already extracted, and what remains is the procedural implementation.

packages/cache/src/cache.ts Outdated Show resolved Hide resolved
packages/cache/src/cache.ts Outdated Show resolved Hide resolved
packages/cache/src/cache.ts Outdated Show resolved Hide resolved
Comment on lines +245 to +246
workflowRunBackendId: backendIds.workflowRunBackendId,
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need these in the request if they're encoded into the JWT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -45,10 +45,13 @@
"@azure/abort-controller": "^1.1.0",
"@azure/ms-rest-js": "^2.6.0",
"@azure/storage-blob": "^12.13.0",
"semver": "^6.3.1"
"@protobuf-ts/plugin": "^2.9.4",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have been moved from the top level package.json. And @protobuf-ts/plugin was bumped up to 2.9.4. Not sure why were using (and still using) @protobuf-ts/plugin": "^2.2.3-alpha.1 in artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants