Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cache prefix key for multiple cache-dependency-path

Đang mở
#1,320 1 bình luận 6 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
nodejs, typescript
Lĩnh vực
ci-cd

Hướng nghiên cứu

Xem xét cách setup-node tạo các khóa bộ nhớ đệm từ cache-dependency-path, sau đó đọc issue liên quan #1120 để biết ngữ cảnh. Được xem là hoàn thành khi các workflow có thể cung cấp một tiền tố có thể kiểm soát nằm giữa trình quản lý gói và hash của lockfile, để các bộ nhớ đệm monorepo có phạm vi tập trung riêng biệt không khôi phục chéo cho nhau.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

feature request

Description:

Currently the cache key is always the following format node-cache-{platform}-{packageManager}-{fileHash(lockfile)}
I'd like a way to add a prefix between the packageManager and the file hash like node-cache-{platform}-{packageManager}-{cachePrefix}-{fileHash(lockfile)}

Justification:

We work in a monorepo with yarn workspaces. In order to scope our yarn installs and cache, we use yarn workspaces focus with cache-dependency-path pointing to yarn.workspace.lock from https://github.com/MaintainX/yarn-plugin-workspace-lockfile

This means we have multiple workflows all saving and restoring caches for different file hashes.
Because we use yarn3, setup-node uses fallback restore keys.
Which means it frequently happens that 1 workflow will fallback on the cache from a totally different set of lockfiles, run yarn effectively download what's missing and grow the cache and save that cache back.

Somewhat related https://github.com/actions/setup-node/issues/1120

What happens is that our caches are constantly growing, over time including the whole monorepo's dependencies and more.
We tried to mitigate this by manually creating caches on push to master using actions/cache/save instead of setup-node so we wouldn't restore the cache making it a "fresh" cache.

Having a cache prefix that we control, we could give a semantic name for scopes of the monorepo allowing to avoid workflows to cross restore caches for a different yarn workspaces focus command

Are you willing to submit a PR?

Yes I'm willing to open a PR if this suggestion is accepted

Ngôn ngữ chính
TypeScript
Star
5k
Fork
1.7k
Merge trung bình
4 ngày 22 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của actions/setup-node

Tất cả issue của actions/setup-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.