Skip to content

Improve display of SSVC decision tree in UI using YAML format #2058#2165

Open
Mahaboobunnisa123 wants to merge 1 commit intoaboutcode-org:mainfrom
Mahaboobunnisa123:improve-ssvc-yaml-display
Open

Improve display of SSVC decision tree in UI using YAML format #2058#2165
Mahaboobunnisa123 wants to merge 1 commit intoaboutcode-org:mainfrom
Mahaboobunnisa123:improve-ssvc-yaml-display

Conversation

@Mahaboobunnisa123
Copy link

Summary

Resolves #2058
This PR improves the readability of SSVC decision trees in the advisory detail UI by rendering them as clean, human-readable YAML instead of Python's default pprint repr output.

What changed

File Change
vulnerabilities/templatetags/ssvc_filters.py New custom Django template filter to_yaml using saneyaml
vulnerabilities/templates/advisory_detail.html Replaced {{ ssvc.options|pprint }} with {{ ssvc.options|to_yaml }}
vulnerabilities/tests/test_ssvc_filters.py Added tests covering normal SSVC options, empty inputs, and edge cases

Why saneyaml?

I chose saneyaml over PyYAML because it's already a project dependency (setup.cfg line 80) and the project historically prefers it (ref: #452).

Before

[{'Exploitation': 'active'}, {'Automatable': 'yes'}, {'Technical Impact': 'total'}, {'Mission Prevalence': 'essential'}, {'Public Well-being Impact': 'irreversible'}, {'Mission & Well-being': 'high'}]

After

- Exploitation: active
- Automatable: yes
- Technical Impact: total
- Mission Prevalence: essential
- Public Well-being Impact: irreversible
- Mission & Well-being: high

Tests

All 3 tests pass locally:

vulnerabilities/tests/test_ssvc_filters.py::test_to_yaml_with_ssvc_options PASSED
vulnerabilities/tests/test_ssvc_filters.py::test_to_yaml_with_empty_value PASSED
vulnerabilities/tests/test_ssvc_filters.py::test_to_yaml_with_non_serializable_value PASSED

No new dependencies were added. Happy to make any adjustments based on review feedback!

@Mahaboobunnisa123 Mahaboobunnisa123 force-pushed the improve-ssvc-yaml-display branch 2 times, most recently from 7f9427a to fdf9ef7 Compare February 15, 2026 12:07
…de-org#2058

Signed-off-by: Mahaboobunnisa123 <mdshabbi885@gmail.com>
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.

Improve display of SSVC in UI

1 participant