-
Notifications
You must be signed in to change notification settings - Fork 72
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
🐛👌 Centralise need missing link reporting #1104
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1104 +/- ##
==========================================
- Coverage 83.84% 83.83% -0.01%
==========================================
Files 56 56
Lines 6424 6421 -3
==========================================
- Hits 5386 5383 -3
Misses 1038 1038
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. Looks good 👍 And I also agree needs_report_dead_links
is deprecated with this change-
f534ba8
to
a46d824
Compare
Currently, warnings for need outgoing links that reference a non-existent ID, are only generated "indirectly" in the render phase; where `NeedOutgoing` nodes are converted to nodes that are understood by sphinx builders (HTML, PDF, ...). Since this render phase is no longer needed/run for simply creating the `needs.json`, using the `needs` builder, these warnings are not generated. Additionally, any needs that are not explicitly rendered in the documentation, like externally imported needs, are also skipped. The reporting of unknown links is now moved to the `check_links` function, meaning it is now run for all needs and all builders. The warnings have also been given a subtype `link_outgoing` or `external_link_outgoing`, meaning they can be suppressed using the standard Sphinx config: `suppress_warnings = ["needs.link_outgoing", "needs.external_link_outgoing"]` This deprecates the need for the `needs_report_dead_links` configuration, which now emits a deprecation warning if set by the user.
a46d824
to
f5da69d
Compare
Hi @danwos and @chrisjsewell , I've noticed in a local test that this does not raise warnings in case I've changed a need ID but forgot to update the links to it in other needs, when I'm building with the needs builder (or inventories builder). /edit: Nevermind, it pulled in sphinx-needs 2.0.0 instead of master. Works now. Any chance of a new minor release soon? |
Ah good 😄 yes I hope soon, I'd just like to push to try and finalise some of my outstanding PRs first 😅 |
@chrisjsewell and @danwos: Looking forward to it. Even if it's a new major, please don't drop support for Python 3.8 yet, if any way possible. |
Currently, warnings for need outgoing links that reference a non-existent ID, are only generated "indirectly" in the render phase; where
NeedOutgoing
nodes are converted to nodes that are understood by sphinx builders (HTML, PDF, ...).Since this render phase is no longer needed/run for simply creating the
needs.json
, using theneeds
builder, these warnings are not generated.Additionally, any needs that are not explicitly rendered in the documentation, like externally imported needs, are also skipped.
The reporting of unknown links is now moved to the
check_links
function, meaning it is now run for all needs and all builders. The warnings have also been given a subtypelink_outgoing
orexternal_link_outgoing
, e.g.This means they can be suppressed using the standard Sphinx config:
This deprecates the need for the
needs_report_dead_links
configuration, which now emits a deprecation warning if set by the user.@danwos, do you agree that
needs_report_dead_links
can be deprecated, and that warnings should be emitted for unknown ids in external need links?closes #1038
closes #1095