Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to nonexisting item produces two warnings #373

Open
gcrabbe opened this issue Apr 11, 2024 · 2 comments
Open

Link to nonexisting item produces two warnings #373

gcrabbe opened this issue Apr 11, 2024 · 2 comments
Assignees

Comments

@gcrabbe
Copy link

gcrabbe commented Apr 11, 2024

This issue is related to #320.

In our traceability flow, Test Records (TRs) are generated automatically and ID'ed by their location on disk:

.. item:: TR-lorem/ipsum/sim_1 Test record for lorem/ipsum/sim_1
    :result: PASSED

While the links (many-to-many) between Testcases (TCs) and TRs are created manually inside the TC:

.. item:: TC-lorem/ipsum-1 Testcase for lorem/ipsum
    :tested_by:
        TR-lorem/ipsum/sim_1
        TR-lorem/ipsum/sim_2

This means that while the corresponding simulation has not been run, the TR does not exist, and we get not one, but two different warnings from Sphinx:

WARNING: Item 'TR-lorem/ipsum/sim_1' has no reference to source document.
/<path>/lorem.rst:42: WARNING: Traceability: cannot link to 'TR-lorem/ipsum/sim_1', item is not defined

Which brings me to my questions:

  1. Would it be possible to omit the first warning? The second one is much more useful.
  2. Would it be possible to also suppress the second one, either through a configuration or (ideally) a command-line argument? We'd like to disable it during development and enable it for reviews.
@Letme
Copy link
Member

Letme commented Apr 11, 2024

For 2nd point we use warnings-plugin https://github.com/melexis/warnings-plugin

For first point the warning is generated where encounted. Do you want to cache it and then eliminate (group) it only in case there is reverse duplicate?

@JasperCraeghs JasperCraeghs self-assigned this Apr 12, 2024
@gcrabbe
Copy link
Author

gcrabbe commented Apr 15, 2024

For 2nd point we use warnings-plugin https://github.com/melexis/warnings-plugin

I can respect the choice of delegating this to another tool, so fine by me.


For first point the warning is generated where encounted. Do you want to cache it and then eliminate (group) it only in case there is reverse duplicate?

I'm afraid I do not understand the question.

I think the first warning is generated by Sphinx itself, as I get the same one for broken links in the text. It is, unfortunately, entirely unhelpful in pinpointing the root cause of the problem. The second warning is much better in that regard. I would have preferred to get only that one.

As for the implementation, I'm entirely agnostic. If the target does not exist, it might be possible to not create the link at all. Gobbling that particular warning would also work.

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

No branches or pull requests

4 participants