Skip to content

⚠️ Migrate needs_extra_links to needs_links#1649

Merged
chrisjsewell merged 4 commits intomasterfrom
needs_links
Feb 16, 2026
Merged

⚠️ Migrate needs_extra_links to needs_links#1649
chrisjsewell merged 4 commits intomasterfrom
needs_links

Conversation

@chrisjsewell
Copy link
Member

This PR introduces a new dict-based needs_links configuration and deprecates the list-based needs_extra_links.
The change follows the plan in #1646 and uses the same migration pattern as needs_extra_optionsneeds_fields (commit fc41bf2).

Motivation

  • Consistent API design with needs_fields (dict-based config)
  • Enables a description field for link types (output in schema/needs.json)
  • Cleaner configuration syntax

Changes

New Configuration Format

# New (needs_links)
needs_links = {
    "blocks": {
        "description": "Blocking relationship between needs",
        "incoming": "is blocked by",
        "outgoing": "blocks",
    },
}

# Deprecated (needs_extra_links)
needs_extra_links = [
    {
        "option": "blocks",
        "incoming": "is blocked by",
        "outgoing": "blocks",
    },
]

Backward Compatibility

  • needs_extra_links continues to work but emits a deprecation warning
  • Internal processing converts both formats to the same representation
  • Error messages reference the correct config option based on source

New Features

  • description field: Link types can now include a description that appears in the JSON schema output
  • Dict-based syntax: Link name is the key, making configuration cleaner

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.83%. Comparing base (4e10030) to head (32ff463).
⚠️ Report is 248 commits behind head on master.

Files with missing lines Patch % Lines
sphinx_needs/needs.py 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1649      +/-   ##
==========================================
+ Coverage   86.87%   88.83%   +1.95%     
==========================================
  Files          56       70      +14     
  Lines        6532     9952    +3420     
==========================================
+ Hits         5675     8841    +3166     
- Misses        857     1111     +254     
Flag Coverage Δ
pytests 88.83% <95.83%> (+1.95%) ⬆️

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.

Copy link
Member

@ubmarco ubmarco left a comment

Choose a reason for hiding this comment

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

Just minor things

@chrisjsewell chrisjsewell requested a review from ubmarco February 16, 2026 15:17
@chrisjsewell chrisjsewell changed the title ♻️ Migrate needs_extra_links to needs_links ⚠️ Migrate needs_extra_links to needs_links Feb 16, 2026
@chrisjsewell chrisjsewell merged commit e01b3ad into master Feb 16, 2026
24 of 25 checks passed
@chrisjsewell chrisjsewell deleted the needs_links branch February 16, 2026 16:01
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