Align security report type enums
Problem
Vulnerabilities::Occurrence#report_type and Vulnerabilities::Feedback#category are both enums with the same structure:
{
sast: 0,
dependency_scanning: 1,
container_scanning: 2,
dast: 3
}
I see two issues here:
- The difference in names referring to identical enums is confusing
- We use these attributes to associate occurrences with feedback in
Occurrence.undismissedandOccurrence#feedback. If one enum diverges from the other, it could break these methods
Where this came from
The following discussion from !20599 (merged) should be addressed:
-
@jameslopez started a discussion: nitpick: should this be
report_typeorcategory? Looks like an opportunity to refactor this, but could be in a follow-up issue.
Proposed solution
- Rename
Feedback#categorytoFeedback#report_typeOR rename both to#security_report_typefor additional clarity - Set
Occurrence::REPORT_TYPESas the source of truth, and haveFeedbackuse that constant for#category
Edited by Avielle Wolfe