posit-dev / posit-dev/rsconnect-python

deploy manifest errs when give a directory containing a manifest

Đang mở
#587 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Ngôn ngữ chính
Python
Star
37
Fork
28
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
7

Mô tả

The help for deploy manifest reads:

Usage: rsconnect deploy manifest [OPTIONS] FILE

  Deploy content to Posit Connect, Posit Cloud, or shinyapps.io using an
  existing manifest.json file.  The specified file must either be named
  "manifest.json" or refer to a directory that contains a file named
  "manifest.json".

However, when providing a directory that contains a manifest.json, an error results.

Traceback (most recent call last):
  File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/main.py", line 108, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "BASE_DIR/env/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/main.py", line 1119, in deploy_manifest
    kwargs["title"] = title or default_title_from_manifest(file)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/bundle.py", line 744, in default_title_from_manifest
    source_manifest, _ = read_manifest_file(file)
                         ^^^^^^^^^^^^^^^^^^^^^^^^
  File "BASE_DIR/env/lib/python3.11/site-packages/rsconnect/bundle.py", line 757, in read_manifest_file
    with open(manifest_path, "rb") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^
IsADirectoryError: [Errno 21] Is a directory: 'model'
Internal error: [Errno 21] Is a directory: 'model'

Providing the path to the manifest.json works.

# error
rsconnect deploy manifest model
# no error
rsconnect deploy manifest model/manifest.json

Using rsconnect-python 1.23.0.

The manifest is correctly identified:

rsconnect.bundle.validate_manifest_file("model")
#> 'model/manifest.json'

However, in deploy_manifest(), we rewrite the incoming file to file_name but do not consistently use that variable.

https://github.com/rstudio/rsconnect-python/blob/74b7f6899206ff754e29ad282c3dc725ab4e186b/rsconnect/main.py#L1146-L1179

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu trong rsconnect/main.py tại deploy_manifest(), sau đó theo dõi default_title_from_manifest() và read_manifest_file() trong rsconnect/bundle.py. So sánh cách file và file_name được sử dụng sau khi xác thực manifest, đồng thời xác minh rằng cả rsconnect deploy manifest model và đường dẫn manifest trực tiếp đều hoàn tất mà không gặp lỗi thư mục.

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

Đánh giá

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

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.