[Bug]: version latest with download-repository can install a stale CLI
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github-actions, typescript
Hướng nghiên cứu
Bắt đầu từ getCliUrl, nơi latest được ánh xạ tới [RELEASE], rồi lần theo đường dẫn repository tải xuống và các bài kiểm thử hiện có của nó. Xem xét cách xử lý danh sách repository, việc lọc theo OS/kiến trúc, sắp xếp semver, xác thực và hành vi fallback. Hoàn thành có nghĩa là có cơ chế phân giải latest thành một phiên bản bất biến theo opt-in và tương thích ngược, không phát sinh lỗi mới hoặc các lệnh gọi mạng bắt buộc, cùng với độ bao phủ cho nội dung [RELEASE] được lưu trong bộ nhớ đệm và các chế độ repository được mô tả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
version: latest combined with download-repository can keep installing an old JFrog CLI indefinitely.
latest is translated to [RELEASE], and [RELEASE] is part of the artifact path, so the action requests:
{artifactory}/{download-repository}/v2/[RELEASE]/jfrog-cli-<os-arch>/jfrog
A remote repository caches artifacts by the path it resolved. For a concrete version such as v2/2.123.0/... that is exactly what you want: the artifact is immutable, so caching it is a pure win. For a moving tag it breaks, and the Artifactory cache settings do not rescue it:
- Store Artifacts Locally is enabled by default, so the resolved binary is cached under the literal
v2/[RELEASE]/...path. - Metadata Retrieval Cache Period does not apply. Per the remote repository docs, that period is "relevant for artifacts that expire after a period of time", while "most downloaded artifacts do not change and this setting does not affect them". A CLI binary is one of those artifacts that do not change.
- Zapping the cache does not help either: per the same docs, "immutable binaries are not invalidated".
- Unused Artifacts Cleanup Period is empty by default, which means artifacts are "stored indefinitely" — and a binary a CI pipeline downloads on every run is never "unused" anyway.
So the first version resolved through that path can be served as latest forever, with no error and no obvious way for the user to notice.
Current behavior
- uses: jfrog/setup-jfrog-cli@v4
with:
version: latest
download-repository: jfrog-cli-remote
Requests keep succeeding and the download URL looks correct, so nothing signals a problem.
Observed: a runner installed jf 2.91.0 while 2.123.0 was already published, and CI failed a minimum-version check with an error that gives no hint about the cached tag. Requesting the same latest directly from https://releases.jfrog.io/artifactory/jfrog-cli returned 2.123.0.
Reproduction steps
- Create a generic remote repository proxying
https://releases.jfrog.io/artifactory/jfrog-cli, leaving Store Artifacts Locally enabled and Unused Artifacts Cleanup Period empty (both defaults). - Run setup-jfrog-cli with
version: latestanddownload-repositoryset to that repository, sov2/[RELEASE]/...is cached. - Wait for a newer CLI release and run the same workflow again.
- The cached version is installed again, not the newer release.
Expected behavior and compatibility requirements
latest should not depend on a cached moving tag. Because this action runs in a very large number of workflows, the fix must not introduce new failures.
- Preserve existing successful workflows by default. Do not newly reject or fail
latest+download-repository. - Never request a moving tag through a repository that caches artifacts. Resolve a concrete
X.Y.Zand downloadv2/X.Y.Z/..., so every version is cached under its own immutable path. - Keep all downloads inside
download-repositorywhen it is set. Never fall back to the public internet, because the runner may have no Internet access. - Do not assume every
download-repositoryis a connected proxy. It may haveStore Artifacts Locallydisabled (direct streaming, no cache), be markedOffline, or be a repository whose content administrators manage themselves. - Prefer a backward-compatible, opt-in rollout until the new resolution is proven against connected proxies, cache-only repositories, and self-managed repositories.
- When selecting a version, filter for the current OS/architecture, sort with semver rather than lexically (
2.91.0sorts above2.123.0as a string), and keep the current download path if resolution yields nothing. Note that folder listing through a remote reflects repository content, and on generic remotes it depends onList Remote Folder Items, which is API-only — so it is not automatically "newest on origin". - Tests must prove no new throw,
core.setFailed, non-zero exit, authentication call, or additional required network call on the existing path, and must cover a repository that already has an old version cached underv2/[RELEASE].
Until then the safe guidance is a concrete version: X.Y.Z whenever download-repository is used.
Setup JFrog CLI version
v4.10.1 / current master (getCliUrl maps latest to [RELEASE])
JFrog CLI version
latest
Workflow operating system type and version
Not OS specific — any runner using latest through a caching repository can be served the cached version.
JFrog Artifactory version (if relevant)
Any remote repository proxying releases.jfrog.io/artifactory/jfrog-cli with default cache settings.
JFrog Xray version (if relevant)
N/A
Follow-up (non-failing mitigation)
#346 documents this behavior and adds a plain core.info line. It does not change URL construction, authentication, downloading, caching, exit status, or failure behavior.
- Ngôn ngữ chính
- TypeScript
- Star
- 267
- Fork
- 111
- Merge trung bình
- 10 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jfrog/setup-jfrog-cli
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
jfrog/setup-jfrog-cli#361 ·
-
Ghost mode continues to intercept commands after POST configuration step within GitHub ActionsĐang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
jfrog/setup-jfrog-cli#349 ·
-
feature request
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
jfrog/setup-jfrog-cli#348 ·
-
`enable-package-alias: true` installs the alias but never activates it (`JFROG_CLI_GHOST_FROG` is never set)Có thể đã có người làm @amarkdotdev đã nhận 61 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
jfrog/setup-jfrog-cli#343 · 1 reaction ·
-
Cleanup is not running on self-hosted runners when using server configCó thể đã có người làm @omribz156 đã nhận 144 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
jfrog/setup-jfrog-cli#339 ·
Tất cả issue của jfrog/setup-jfrog-cli
Issue tương tự
-
freshness freshness:observed-only
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
thoroc/context-radar#280 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
documentation story
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Billing: computeBundleEconomicsFrom treats a NULL component cost as 0, inflating bundle marginĐang mởbug category:billing priority:p3 track:fast
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
LanternOps/breeze#9223 ·
Maintainer thường phản hồi trong vòng 1 ngày