useblocks / sphinx-needs

Adds needs/requirements to sphinx
https://sphinx-needs.readthedocs.io/en/latest/index.html
MIT License
209 stars 66 forks source link

Duplicated Ids no longer fail the build #1291

Closed aanagnosastronauticscom closed 3 weeks ago

aanagnosastronauticscom commented 3 weeks ago

The update from the 2.X series to the 3.X looks to have had some unintended impact to an undocumented feature that was rather convenient for my use case.

Some work was done to needs.py to resolve detecting duplicated ids in parallel builds and as part of that the raising of an exception when a duplicated id is found was removed.

The current 3.X series still detects the duplicated ids, but will continue the build and even exit with a status of 0 (success). In the 2.X series, because of raising that exception, you would get an error status of != 0 (2 actually) which i was able to use to fail CI pipelines.

There is still the base sphinx option of treating all warnings as errors to return the functionality, but that has the side effect of failing things when expected warnings are being triggered, which is not exactly ideal.

I personally think a duplicate id should be a fatal error not a warning, it leads to undefined and missing output data. However at least having a flag to elevate this warning to fatal error would be appreciated.

chrisjsewell commented 3 weeks ago

but that has the side effect of failing things when expected warnings are being triggered

heya, you should be using https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-suppress_warnings for expected warnings

this will not be changing I'm afraid; all sphinx parsing should be fault-tolerant by default, and sphinx_needs provide clear warning type/subtypes to fine-grain control of these warnings.

If you wish for any other functionality, I would suggest opening an issue/discussion on sphinx core