--disable-env-management-node is ignored by Connect: manifest uses "node" instead of "nodejs"

未关闭 适合新手
#998 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
cli

调研方向

从 rsconnect/bundle.py 中的 make_nodejs_manifest 开始,其中 environment_management 被写成 {"node": ...},并查看 ManifestDataEnvironment.environment_management 这个指定了 node 的 Literal 类型。将键名(以及顶层运行时段)改为 nodejs,然后在 tests/ 的 bundle 测试套件中现有 Node.js 清单测试旁添加一个针对生成清单键的断言,并运行该文件。完成标准是:清单写入 environment.environment_management.nodejs,且新测试在修改前失败、修改后通过。

由索引模型根据 Issue 内容生成。

描述

rsconnect deploy nodejs --disable-env-management-node (and env_management_node=False in the API) has no effect: Posit Connect still installs npm packages.

Cause

make_nodejs_manifest writes the setting under the key node:

"environment": {
  "environment_management": {"node": false}
}

Posit Connect reads environment.environment_management.nodejs, the same key the rsconnect R package writes (envManagementNodejs). Connect ignores the node key, so the bundle falls back to the server's NodeJs.EnvironmentManagement setting.

The relevant code is in rsconnect/bundle.py:

  • ManifestDataEnvironment.environment_management is typed dict[Literal["python", "r", "node"], bool].
  • make_nodejs_manifest sets manifest_environment["environment_management"] = {"node": env_management_node}.
Suggested fix

Write nodejs instead of node in environment.environment_management, and update the Literal type to match. Add a test that asserts the key.

For consistency, the top-level runtime section is also written as "node". rsconnect (R) writes it as "nodejs", which matches metadata.appmode. Connect doesn't currently read any fields from that section, so it has no visible effect today. It's still worth renaming at the same time.

Steps to reproduce
  1. On a Connect server with Node.js enabled and NodeJs.EnvironmentManagement left at its default (true), run rsconnect deploy nodejs --disable-env-management-node <dir>.
  2. Read the deployment log. Connect runs npm install, and the generated manifest.json contains "environment_management": {"node": false}.
主要语言
Python
星标
38
派生
28
平均合并
1 天 4 小时
30 天内合并 PR
59

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

posit-dev/rsconnect-python 的其他 Issue

查看 posit-dev/rsconnect-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。