πŸ™‡ Requirements BaseΒΆ

Demo feature hint: Constraints

For requirements two constraints are defined, which check if the status is set correctly and if a release is linked.

If these constraints are not fulfilled, the need object gets a colored right border and the footer contains the reason why a constraint is not fulfilled.

Constraints can be defined in the conf.py file:

needs_constraints = {
   "status_set": {
      "check_0": "status is not None and status in ['open', 'in progress', 'closed']",
      "severity": "LOW",
      "error_message": "Status is invalid or not set!"
   },
   "release_set": {
      "check_0": "len(release)>0",
      "severity": "CRITICAL",
      "error_message": "Requirement is not planned for any release!"
   },
}

Depending on the severity, the build is stopped or a warning gets printed:

/sphinx-needs-demo/docs/granny_car/requirements.rst:20: WARNING: Constraint len(release)>0 for need GRANNY_EXAMPLE FAILED! severity: CRITICAL Requirement is not planned for any release! [needs.constraint]

Docs: needs_constraints by Sphinx-Needs.

Object traceability details: Automatic Braking

@startuml

' Nodes definition 

node "<size:12>Requirement</size>\n**Automatic**\n**Braking**\n<size:10>BASE_BREAK</size>" as BASE_BREAK [[../base_car/requirements.html#BASE_BREAK]] #BFD8D2
actor "<size:12>Person</size>\n**Robert Right**\n<size:10>ROBERT</size>" as ROBERT [[../persons.html#ROBERT]] #DCB239

' Connection definition 

BASE_BREAK --> ROBERT

@enduml

ID

Title

Type

Author

BASE_BREAK

Automatic Braking

req

ROBERT

ROBERT

Robert Right

person

Object traceability details: Wifi Support

@startuml

' Nodes definition 

node "<size:12>Requirement</size>\n**Wifi Support**\n<size:10>BASE_WIFI</size>" as BASE_WIFI [[../base_car/requirements.html#BASE_WIFI]] #BFD8D2
actor "<size:12>Person</size>\n**Robert Right**\n<size:10>ROBERT</size>" as ROBERT [[../persons.html#ROBERT]] #DCB239

' Connection definition 

BASE_WIFI --> ROBERT

@enduml

ID

Title

Type

Author

BASE_WIFI

Wifi Support

req

ROBERT

ROBERT

Robert Right

person

Object traceability details: Bluetooth Support

@startuml

' Nodes definition 

node "<size:12>Requirement</size>\n**Bluetooth**\n**Support**\n<size:10>BASE_BT</size>" as BASE_BT [[../base_car/requirements.html#BASE_BT]] #BFD8D2
actor "<size:12>Person</size>\n**Robert Right**\n<size:10>ROBERT</size>" as ROBERT [[../persons.html#ROBERT]] #DCB239

' Connection definition 

BASE_BT --> ROBERT

@enduml

ID

Title

Type

Author

BASE_BT

Bluetooth Support

req

ROBERT

ROBERT

Robert Right

person