lobster-rst-report#588
Conversation
add a lobster rst report which can be included in any sphinx build
mugdhadhole1
left a comment
There was a problem hiding this comment.
I generated a sample RST file with lobster-rst-report and then built HTML with Sphinx.
When Graphviz dot is not installed, the output renders raw DOT text in the HTML.
I observed without Graphviz dot, the HTML shows raw DOT text.
Could we handel it and add a dedicated system test that validates behavior when dot is unavailable?
There was a problem hiding this comment.
Can someone generate a visualized report using these rst files?
Should generating html files be part of the rst tool?
| | `LOBSTER_REPORT` | Path to the `.lobster` report file (default: `report.lobster`). | | ||
| | `--out FILE` | Write a single-page RST report to `FILE` (default: `lobster_report.rst`). | | ||
| | `--out-dir DIR` | Write a multi-page RST report to `DIR` (index.rst + one page per level). | | ||
| | `--source-root PREFIX` | Prefix prepended to file reference URLs. Use this when the RST output directory differs from the workspace root. | |
There was a problem hiding this comment.
--source-root is mentioned, but it’s unclear how to choose the value for the final file location.
Maybe adding a concrete example will help the user.
| def test_source_locations_in_output(self): | ||
| # lobster-trace: UseCases.RST_Source_location_in_output | ||
| # lobster-trace: UseCases.RST_Correct_Item_Data | ||
| content = self._get_single_page_content() | ||
| # Codebeamer URL for system requirement (item 666 on potato.kitten) | ||
| self.assertIn("potato.kitten/issue/666", content) | ||
| # GitHub URL for software requirements | ||
| self.assertIn("github.com/bmw-software-engineering/lobster", content) |
There was a problem hiding this comment.
Current source-link test only checks substring presence, not link validity/resolution. Test can pass and the users might still click broken links.
Consider adopting the existing golden-output comparison pattern for rst-report tests (declare_output_file + assertOutputFiles).
There was a problem hiding this comment.
Please add golden-file comparison tests.
The existing infra compares full output files; this RST suite mostly checks small text snippets.
Adding unit tests for small snippets should be sufficient.
| if isinstance(location, File_Reference): | ||
| href = source_root + location.filename if source_root else location.filename | ||
| return f"`{e(location.to_string())} <{href}>`__" |
There was a problem hiding this comment.
File links are built by direct string concatenation of source_root and filename. If source_root contain invalid values, generated URLs become invalid
| #!/usr/bin/env python3 | ||
| # | ||
| # lobster_rst_report - Visualise LOBSTER report as reStructuredText for Sphinx | ||
| # Copyright (C) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) |
There was a problem hiding this comment.
| # Copyright (C) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | |
| # Copyright (C) 2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) |
Please update in all the files where it is applicable
| #!/usr/bin/env python3 | ||
| # | ||
| # lobster_rst_report - Visualise LOBSTER report as reStructuredText for Sphinx | ||
| # Copyright (C) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) |
There was a problem hiding this comment.
| # Copyright (C) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | |
| # Copyright (C) 2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) |
| author = "BMW Software Engineering" | ||
| copyright = f"{datetime.now().year}, {author}" |
There was a problem hiding this comment.
The copyright author name here is not the recommended name
|
|
||
| project = "LOBSTER Traceability Report" | ||
| author = "BMW Software Engineering" | ||
| copyright = f"{datetime.now().year}, {author}" |
There was a problem hiding this comment.
If this config is used for generated LOBSTER report rendering, please disable copyright display for those reports.
add a lobster rst report which can be included in any sphinx build