Module verification report: work product table never matches documents for components titled "<module>::<component>"

Đang mở Phù hợp với người mới
#1,029 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
78/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
documentation

Hướng nghiên cứu

Đọc src/needs_templates/module_verification_report.need quanh dòng 169 và _WorkproductRows trong src/extensions/score_sphinx_needs_templates/__init__.py quanh dòng 343 để xác nhận slug của component được đối chiếu với ID tài liệu như thế nào. Kiểm tra cùng mẫu slug trong platform_verification_report.need quanh dòng 219. Cập nhật việc đối chiếu component và feature khi cần, sau đó xác minh rằng năm dòng work product của persistency::kvs tìm thấy tài liệu tương ứng.

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

Mô tả

Description

In the module verification report, the table "Verification & Safety Analysis Documents" shows "No needs passed the filters" for every work product of a component, even though matching documents exist.

Example: https://eclipse-score.github.io/persistency/main/verification_report/module_verification_report.html (component persistency::kvs). All five rows are empty: requirements, architecture and implementation inspection, DFA and FMEA.

Root cause

src/needs_templates/module_verification_report.need (line 169) builds the slug from the component title:

{% set component_slug_norm = component_title|replace("_", "")|replace(" ", "")|lower %}

_WorkproductRows in src/extensions/score_sphinx_needs_templates/__init__.py (line 343) then filters:

type == "document" and "{slug_norm}" in id.replace("_", "").lower() and "{wp_id}" in realizes

The naming convention gives component titles the form <module>::<component>, so the slug becomes persistency::kvs. That string can never be part of a document id: doc__kvs_dfa is normalised to dockvsdfa. The type and realizes parts of the filter would match:

Document realizes
doc__kvs_req_inspection wp__requirements_inspect[version==1]
doc__kvs_arc_inspection wp__sw_arch_verification[version==1]
doc__kvs_impl_inspection wp__sw_implementation_inspection[version==1]
doc__kvs_dfa wp__sw_component_dfa[version==1]
doc__kvs_fmea wp__sw_component_fmea[version==1]

Seen with score_docs_as_code 8.6.0. The code on main is the same.

Problem notifications

No response

Analysis results

No response

Solution

Proposed fix

  • Short term: build the slug from the part after the last ::, e.g. component_title|split("::")|last|replace("_", "")|replace(" ", "")|lower.
  • Long term: stop matching documents through substrings of their ids, which is fragile and can produce false positives. Use an explicit link instead, e.g. belongs_to from the document to the component, or the docname or directory of the component.

The same pattern is used for features in platform_verification_report.need (line 219) and should be checked too.

Error Occurrence Rate

None

How to reproduce

see above

Supporting Information

No response

Classification

Minor

First Affected Release

0.8

Last Affected Release

0.9

Expected Fixed Release

1.0

Category
  • Safety Relevant
  • Security Relevant
Ngôn ngữ chính
Python
Star
11
Fork
39
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
47

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có 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.

Issue khác của eclipse-score/docs-as-code

Tất cả issue của eclipse-score/docs-as-code

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.