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

Aperta Adatta ai principianti
#1,029 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Leggi src/needs_templates/module_verification_report.need intorno alla riga 169 e _WorkproductRows in src/extensions/score_sphinx_needs_templates/__init__.py intorno alla riga 343 per confermare come lo slug del componente viene confrontato con gli ID dei documenti. Controlla lo stesso schema di slug in platform_verification_report.need intorno alla riga 219. Aggiorna la corrispondenza di componenti e funzionalità secondo necessità, quindi verifica che le cinque righe di prodotti di lavoro di persistency::kvs trovino i relativi documenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
11
Fork
39
Merge medio
1g 12h
PR unite (30g)
47

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-score/docs-as-code

Tutte le issue di eclipse-score/docs-as-code

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.