Feature Request: Trust lockfile for vendored pnpm deployments
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go, node.js
- 領域
- build-system
調査の方向性
Read pnpm.go and the handling of IsVendored around the pnpm rebuild --recursive command. Compare the two proposed trust approaches and check how existing buildpack tests cover vendored pnpm deployments. Done means the maintainers' preferred behavior is implemented and covered for both vendored and non-vendored deployments.
索引モデルが issue の本文から書いたものです。
説明
Context
When deploying a Node.js application to Cloud Foundry using pnpm deploy (non-legacy mode),
the generated pnpm-lock.yaml in the deploy directory records tarball URLs from the private
registry used during the CI build (e.g. GitHub Packages, Nexus, Artifactory, etc.).
When the buildpack runs pnpm rebuild --recursive (which is OK),
pnpm re-verifies every lockfile entry against the public registry (registry.npmjs.org).
This fails with:
ERR_PNPM_TARBALL_URL_MISMATCH
because the tarball URLs in the lockfile point to the private registry, not to npmjs.org.
This affects any project that uses a private registry (GitHub Packages, Nexus, Artifactory,
etc.), vendors dependencies via pnpm deploy, and deploys to Cloud Foundry.
Discussion
Option A — --trust-lockfile by default for vendored deployments
In pnpm.go, pass --trust-lockfile to pnpm rebuild whenever IsVendored == true:
cmd := exec.Command("pnpm", "rebuild", "--recursive", "--trust-lockfile")
Rationale: The logic is consistent with the intent of #964 itself. If the buildpack
already trusts node_modules/ enough to skip the install phase, it should equally trust
the lockfile that produced those node_modules/. A vendored deployment is by definition
a pre-audited artifact — the trust boundary is the zip, not the staging container.
Drawback: It removes supply-chain re-verification unconditionally for all vendored
deployments, which may not be desirable for all users.
Option B — Opt-in via environment variable
Introduce a NODE_PNPM_TRUST_LOCKFILE=true environment variable that the user can set
on their CF application when using a private registry:
if os.Getenv("NODE_PNPM_TRUST_LOCKFILE") == "true" {
cmd := exec.Command("pnpm", "rebuild", "--recursive", "--trust-lockfile")
} else {
cmd := exec.Command("pnpm", "rebuild", "--recursive")
}
Set it in manifest.yml or MTA descriptor:
env:
NODE_PNPM_TRUST_LOCKFILE: "true"
Rationale: The buildpack is a generic tool used across many different projects and
organisations. Making trust opt-in keeps the default conservative and lets each team
make an explicit, reviewable decision. The environment variable is visible in the
application manifest, making it auditable.
Summary
| Option A | Option B | |
|---|---|---|
| Implementation effort | Minimal | Minimal |
| Breaking change | No | No |
| Auditable / explicit | No | Yes |
| Works for private registries | ✅ | ✅ |
| Safe as a generic default | ⚠️ | ✅ |
We would be happy to contribute a PR for whichever approach the maintainers prefer.
Related
- #942 — Add pnpm package manager support
- #964 — Fix vendored pnpm deployments calling
pnpm installinstead ofpnpm rebuild
- 主要言語
- Go
- スター
- 173
- フォーク
- 390
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 23
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudfoundry/nodejs-buildpack のほかの issue
-
unscheduled
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
cloudfoundry/nodejs-buildpack#683 ·
メンテナーはふだん 5 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
cloudfoundry/nodejs-buildpack#923 ·
メンテナーはふだん 5 日以内に返信
-
Misleading "PRO TIP" about missing "package-lock.json" (with `npm-shrinkwrap.json`)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
cloudfoundry/nodejs-buildpack#852 ·
メンテナーはふだん 5 日以内に返信
-
unscheduled
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
cloudfoundry/nodejs-buildpack#655 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
Supply step do not retry when error is connection reset by peer対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンunscheduled
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cloudfoundry/nodejs-buildpack#626 · コメント 4 件 ·
メンテナーはふだん 5 日以内に返信
cloudfoundry/nodejs-buildpack の issue をすべて見る
似ている issue
-
[Bug]: APIGW request ID headers are inconsistent between server and client対応中かも @zouxingyuks が今日担当しました。 オープンproduct/backlog
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
TencentBlueKing/bk-nodemgr#3782 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
praetorianer777/Dynamo#53 ·
メンテナーはふだん 1 日以内に返信
-
internal test setup
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
SAP/terraform-provider-scc#430 ·
-
internal test setup
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
SAP/terraform-provider-btp#1743 ·
メンテナーはふだん 1 日以内に返信