`script_order` is not respected in the Scripts list

Đang mở
#205 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/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
backend

Hướng nghiên cứu

Start with the two steps the report names: where script_order is read during discovery, and where a revision is activated and the published Script is saved. Check whether the position is stored on the Script record, then whether the Scripts list sorts by project, module path and class name instead of that stored position. Reproduce by uploading the Zulu/Alpha example and confirming the list order. Done when Zulu appears before Alpha in the default list and the order survives activation.

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

Mô tả

app: scripts Bucket: KTLO severity: low status: backlog type: bug
Plugin Version

v0.1.0

NetBox Version

v4.7.5

Python Version

3.12

Steps to Reproduce
  1. Upload a Script File containing the following code:
    from netbox_scripts import Script
    
    
    class Zulu(Script):
        def run(self, data, commit):
            pass
    
    
    class Alpha(Script):
        def run(self, data, commit):
            pass
    
    
    script_order = [Zulu, Alpha]
    
  2. Validate and activate the revision.
  3. Open the Scripts list and filter by the Project, using the default sorting.
Expected Behavior

Zulu appears before Alpha, respecting the order defined in script_order, as documented in the authoring guide and supported by NetBox's built-in Custom Scripts functionality.

Observed Behavior

Alpha appears before Zulu. The Scripts list defaults to ordering by Project, module path and class name, ignoring the author-defined presentation order.

Discovery records the intended position, but activation does not persist it on the published Script.

This also affects the ordering intended for the grouped Scripts view proposed in #81.

Ngôn ngữ chính
Python
Star
9
Fork
0
Merge trung bình
18 giờ 59 phút
Pull request đã merge (30 ngày)
93

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 netbox-community/netbox-scripts

Tất cả issue của netbox-community/netbox-scripts

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.