Repository navigation
Conversation
Counterpart of lobster-trlc for requirements written as Sphinx-Needs directives. The requirement macros (assumed_system_requirements, feature_requirements, component_requirements, assumptions_of_use) accept `needs` (score_docs_as_code docs_bundle targets or needs.json files) in addition to or instead of TRLC `srcs`. lobster_sphinx_needs converts the needs into the same LOBSTER requirement items (kind CompReq/FeatReq/ AssumedSystemReq/AoU, tag `req <need id>@<version>`, link fields as tracing targets, `[version==N]` -> `@N`), so component, dependable_element and the reports are unchanged. Needs with status invalid are skipped; a plain RST page lists the converted needs.
lobster_sphinx_needs uses one central conversion configuration for all requirement kinds; each kind selects its need type via --need-type. needs_lobster_config and the id-pattern option are removed. feature_requirements(feat_id) and component_requirements(comp_id) are mandatory with needs: only needs whose satisfied_by link names that feature/component are converted (--satisfied-by), so a platform-wide needs.json can be passed as is. stkh_req and aou_req belong to the platform and are not filtered. Signed-off-by: Anton Krivoborodov <[email protected]>
lobster_report_to_needs converts the test cases (activity items) of a dependable element's LOBSTER report into Sphinx-Needs testcase Needs, using the ID scheme and fields of the score_docs_as_code test.xml parser. dependable_element provides them as <name>_needs.json, consumed by score_docs_as_code's docs(dependable_elements = [...]). docs = False skips the element's own Sphinx HTML documentation (<name>_doc, <name>.serve) when another Sphinx build documents it. Signed-off-by: Anton Krivoborodov <[email protected]>
Coverage ReportCoverage report was generated. Full report can be downloaded from the CI artifacts (expand Artifacts at the bottom of the run). Overall coverage rate: |
The index of a dependable element depended on //third_party/docs_runtime:dot unconditionally, so building it fetched the docs_runtime apt sysroot from snapshot.ubuntu.com even when no Sphinx documentation is built. Graphviz is now only wired in with docs = True; lobster_rst_report falls back to its text note without it. Signed-off-by: Anton Krivoborodov <[email protected]>
Coverage ReportCoverage report was generated. Full report can be downloaded from the CI artifacts (expand Artifacts at the bottom of the run). Overall coverage rate: |
failure_modes(needs = ...) turns the comp_saf_fmea needs of a score_docs_as_code FMEA into generated FailureMode records (named by the need ID, interface resolved via violated real_arc_int_op needs), so fault trees reference them unchanged. Without TRLC assessments, safety_analysis derives one assessment per sufficient FMEA need from its root causes and mitigated_by measures. The Sphinx-Needs tests move into fixture packages to keep test/BUILD below the 100 KB pre-commit limit.
Coverage ReportCoverage report was generated. Full report can be downloaded from the CI artifacts (expand Artifacts at the bottom of the run). Overall coverage rate: |
Coverage ReportCoverage report was generated. Full report can be downloaded from the CI artifacts (expand Artifacts at the bottom of the run). Overall coverage rate: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Requirements in S-CORE modules are written as Sphinx-Needs (docs-as-code). Today the requirement
macros of
rules_scoreonly accept TRLC, so adependable_elementcannot use them withoutduplicating them in TRLC. This PR lets the
dependable_elementkeep its validation and LOBSTERtraceability while taking requirements from
needs.json, and hands the test results back to theSphinx-Needs documentation.
Changes
Requirements from Sphinx-Needs (
lobster_sphinx_needs) – counterpart oflobster-trlcfeature_requirements,component_requirements,assumed_system_requirements,assumptions_of_useacceptneeds = [...]:needs.jsonfiles or score_docs_as_codedocs_bundlelabels (mapped to their.__internal__.needs_localexport).srcsis optional now;TRLC and needs can be combined.
lobster/config/lobster_sphinx_needs.yaml(
stkh_req→AssumedSystemReq,feat_req→FeatReq,comp_req→CompReqwithderived_from/coversas tracing targets,aou_req→AoU); each kind selects its type via--need-type. Tagreq <id>@<version>,[version==N]link filters become@N,invalidneedsare skipped, a plain RST list page is rendered.
feature_requirements(feat_id = ...)/component_requirements(comp_id = ...)are mandatory withneeds: only needs whosesatisfied_bylink names that feature/component are converted, so aplatform-wide
needs.jsoncan be passed as is.stkh_req/aou_reqbelong to the platform and arenot filtered.
Test cases back to Sphinx-Needs (
lobster_report_to_needs)dependable_elementprovides<name>_needs.json: onetestcaseNeed per test case of its LOBSTERreport, with the ID scheme and fields of the score_docs_as_code test.xml parser
(
partially_verifies/fully_verifies,result,test_type,derivation_technique).dependable_element(docs = False)skips the element's own Sphinx HTML documentation(
<name>_doc,<name>.serve) when docs-as-code documents it.Tests
test_lobster_sphinx_needs,test_lobster_report_to_needs(unit tests),test_requirements_needs_output+ analysis tests (requirements_needs_test.bzl) onfixtures/sphinx_needs/needs.json,test_dependable_element_needs_jsonon an example element withdocs = False.build --nobuild //...in the test module,//:format.check,//:copyright.check.feat_id/comp_idselect 15 feature / 6 component requirements; 43 test cases exported.Open points
testonly(components are test rules), so a docs build importing<name>_needs.jsonbecomestestonlyas well.lobster-tracing; full/partial verification is taken from the testdescription (
:Fullyverifies:/:Partiallyverifies:), otherwisepartially_verifies.