[Bug]: version latest with download-repository can install a stale CLI
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- github-actions, typescript
調査の方向性
latest が [RELEASE] にマッピングされている getCliUrl から始め、ダウンロードリポジトリのパスと既存のテストを追跡します。リポジトリ一覧、OS/アーキテクチャによるフィルタリング、semver のソート、認証、フォールバック動作がどのように処理されているかを確認します。完了条件は、新たな失敗や必須のネットワーク呼び出しを発生させず、キャッシュされた [RELEASE] コンテンツと記載されたリポジトリモードをカバーした、latest から不変バージョンへのオプトインかつ後方互換な解決です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 266
- フォーク
- 110
- 平均マージ
- 3日 15時間
- マージ済み PR(30日)
- 3
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jfrog/setup-jfrog-cli のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
jfrog/setup-jfrog-cli#349 ·
-
feature request
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
jfrog/setup-jfrog-cli#348 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
jfrog/setup-jfrog-cli#343 · リアクション 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
jfrog/setup-jfrog-cli#339 ·
-
feature request
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
jfrog/setup-jfrog-cli#325 ·
jfrog/setup-jfrog-cli の issue をすべて見る
似ている issue
-
resources
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
railmapgen/rmg-palette#2445 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
danielmiessler/LifeOS#2242 ·
メンテナーはふだん 5 日以内に返信
-
good first issue hacktoberfest help wanted translation
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
callstackincubator/appduct#129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100