Skip to content

Conversation

@ubmarco
Copy link
Member

@ubmarco ubmarco commented Oct 22, 2025

Various schema reporting improvements:

  • Remove setting needs_schema_severity
  • Output all violations to console unless suppressed by suppress_warnings
  • Introduce severity based log type, so they can specifically be suppressed
    • info: sn_schema_info
    • warning: sn_schema_warning
    • violation: sn_schema_violation
  • Severity info and warning is logged as logger.warning()
  • Severity violation is logged as logger.error() for a different color
  • Changes to schema_violations.json
    • Write all violations, irrespective of the severity and suppress_warnings
    • The log_lvl information reflect what Sphinx does.
      Possible values are warning or error.
    • Do not output log_lvl and type for children.
      This information is only required on the root, the nested fields are duplicates.
    • Do not print need IDs that have no warnings
  • Do not print Field: in schema console reports if not set
  • Update docs and tests accordingly

Fixes: #1553

@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 91.13924% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.96%. Comparing base (4e10030) to head (22a8d8c).
⚠️ Report is 187 commits behind head on master.

Files with missing lines Patch % Lines
sphinx_needs/schema/reporting.py 90.62% 6 Missing ⚠️
sphinx_needs/logging.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1561      +/-   ##
==========================================
+ Coverage   86.87%   87.96%   +1.08%     
==========================================
  Files          56       70      +14     
  Lines        6532     9638    +3106     
==========================================
+ Hits         5675     8478    +2803     
- Misses        857     1160     +303     
Flag Coverage Δ
pytests 87.96% <91.13%> (+1.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ubmarco ubmarco marked this pull request as ready for review October 22, 2025 19:51
Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

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

From the description, that all looks fine, but unfortunately I don't have time to go through the code in detail

Copy link

@MrChocolateMoose MrChocolateMoose left a comment

Choose a reason for hiding this comment

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

Approved, but there is some minor typos and a clarification I had that would be helpful to handle prior to merging.

@ubmarco ubmarco merged commit fbcfbab into master Oct 24, 2025
21 checks passed
@ubmarco ubmarco deleted the mh-severity-v2 branch October 24, 2025 08:26
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.

Setting per schema 'severity' not working

4 participants