Skip to content

lobster-rst-report#588

Open
hoe-jo wants to merge 1 commit into
mainfrom
joho_rst_report
Open

lobster-rst-report#588
hoe-jo wants to merge 1 commit into
mainfrom
joho_rst_report

Conversation

@hoe-jo

@hoe-jo hoe-jo commented May 20, 2026

Copy link
Copy Markdown
Contributor

add a lobster rst report which can be included in any sphinx build

@hoe-jo hoe-jo requested a review from a team as a code owner May 20, 2026 15:49
add a lobster rst report which can be included in any sphinx build
@hoe-jo hoe-jo force-pushed the joho_rst_report branch from 01828c8 to ec97a7a Compare May 20, 2026 16:10

@mugdhadhole1 mugdhadhole1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@mugdhadhole1 mugdhadhole1 Jun 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--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.

Comment on lines +190 to +197
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +182 to +184
if isinstance(location, File_Reference):
href = source_root + location.filename if source_root else location.filename
return f"`{e(location.to_string())} <{href}>`__"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@mugdhadhole1 mugdhadhole1 Jun 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Copyright (C) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
# Copyright (C) 2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)

Comment on lines +6 to +7
author = "BMW Software Engineering"
copyright = f"{datetime.now().year}, {author}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright author name here is not the recommended name


project = "LOBSTER Traceability Report"
author = "BMW Software Engineering"
copyright = f"{datetime.now().year}, {author}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this config is used for generated LOBSTER report rendering, please disable copyright display for those reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants