Skip to content

Difference between constraints and warnings? (and complex checks) #1322

Open
@chrisjsewell

Description

needs_constraints and needs_warnings (and to a lesser extent need_statuses and need_tags) are very similar in their function:

prohibit/warn about problematic needs

It is unclear to me why there needs to be two concepts for this, I feel that it is possible they could be merged and essentially warnings are a sub-set of constraints that apply to all needs (as opposed to usually constraint "sets" are specified by the need).

At a minimum, this functionality should be expanded on in: https://sphinx-needs.readthedocs.io/en/latest/tutorial.html#enforcing-valid-need-items

It is also of note that for both of these concepts, more complex checks involving all needs have been requested: #1217, #1238, which neither currently support directly.


It is of note that, if warnings were merged with constraints (or called at the same time), AND we improve the detection of need modifications, these may not need to be re-computed for every re-build (as is the case now)


One note-to-self here is that possibly the needs should be "sealed" before checking for constraints here:

process_constraints(needs, needs_config)
,
then constraints/warnings would be processed, allowing for access to the immutable NeedsView, and then the constraints_ fields would be updated as a "special exception" to sealing the needs

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions