Feature Request: Trust lockfile for vendored pnpm deployments
维护者通常 5 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 小时
- 30 天内合并 PR
- 23
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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`)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 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可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭unscheduled
难度 3/5 1-2 天 新手友好度 45/100
cloudfoundry/nodejs-buildpack#626 · 4 条评论 ·
维护者通常 5 天内回复
查看 cloudfoundry/nodejs-buildpack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
blinklabs-io/dingo#5636 ·
维护者通常 1 天内回复
-
automated-analysis bug cookie safe-outputs tool-improvement workflow-issue
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
JetBrains/youtrack-cli#130 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Infisical/infisical#8892 · 1 条评论 ·
维护者通常 1 天内回复
-
windvane requests one more page than it needs可能已有人在做 @TassioSales 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
projectdiscovery/subfinder#1979 ·
维护者通常 3 天内回复