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

Đang mở Phù hợp với người mới
#998 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu từ rsconnect/bundle.py tại make_nodejs_manifest, nơi environment_management được ghi là {"node": ...}, và kiểu Literal ManifestDataEnvironment.environment_management có tên node. Đổi tên khóa (và phần runtime cấp cao nhất) thành nodejs, sau đó thêm một assertion trên khóa manifest được sinh ra cạnh các test manifest Node.js hiện có trong bộ test bundle ở tests/ và chạy file đó. Hoàn thành khi manifest ghi environment.environment_management.nodejs và test mới thất bại trước thay đổi, đạt sau thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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}.
Ngôn ngữ chính
Python
Star
38
Fork
28
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
59

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của posit-dev/rsconnect-python

Tất cả issue của posit-dev/rsconnect-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.