feat(heureka): add change severity mitigation action - #1894
Conversation
Add a new 'Change Severity' mitigation option in the popup menu of each vulnerability row on the image details page, alongside the existing FalsePositive, RiskAcceptance, and MitigateManually actions. - Add ChangeSeverityModal with a severity dropdown (SeverityValues enum), user ID, expiration date, and description fields - Uses RemediationTypeValues.Rescore for the API call with the selected severity as the override value - Wire onChangeSeveritySuccess callback through IssuesDataRow → IssuesDataRows → VulnerabilitiesTabContent → ImageIssuesList Signed-off-by: Hoda Noori <hoda.noori@sap.com>
Signed-off-by: Hoda Noori <hoda.noori@sap.com>
Signed-off-by: Hoda Noori <hoda.noori@sap.com>
🦋 Changeset detectedLatest commit: fb2ad3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new “Change Severity” (rescore) remediation flow to image vulnerability rows, including a dedicated modal and wiring through existing list/row components.
Changes:
- Thread
onChangeSeveritySuccesscallback throughImageIssuesList → IssuesDataRows → IssuesDataRow. - Add “Change Severity” action to the row popup menu and open a new modal on selection.
- Introduce
ChangeSeverityModalUI that builds aRemediationInputof typeRescoreand submits it via existing remediation handler.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/heureka/src/components/Service/ImageDetails/ImageIssuesList/index.tsx | Adds success callback and success message for severity changes. |
| apps/heureka/src/components/Service/ImageDetails/ImageIssuesList/IssuesDataRows/index.tsx | Wires new success callback through list rows. |
| apps/heureka/src/components/Service/ImageDetails/ImageIssuesList/IssuesDataRows/IssuesDataRows.test.tsx | Updates test render helpers with the new required prop. |
| apps/heureka/src/components/Service/ImageDetails/ImageIssuesList/IssuesDataRows/IssuesDataRow/index.tsx | Adds menu item and renders the new ChangeSeverityModal. |
| apps/heureka/src/components/Service/ImageDetails/ChangeSeverityModal/index.tsx | New modal implementation for rescore remediation input + validation. |
| .changeset/heureka-change-severity-action.md | Changeset entry documenting the new action. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Hoda Noori <hoda.noori@sap.com>
- Guard all post-await state updates with isMountedRef.current to prevent React warnings on unmounted component - Add ChangeSeverityModal.test.tsx covering: required-field validation, onConfirm payload shape, API error display, and cancel/close behavior Signed-off-by: Hoda Noori <hoda.noori@sap.com>
Signed-off-by: Hoda Noori <hoda.noori@sap.com>
After a successful Rescore remediation, immediately update the images cache to reflect the new severity on the affected vulnerability. This makes the Remediated tab show the rescored severity without waiting for the backend cache to expire. Also fix test assertion that was too broad (getByText(/High/) matched multiple elements including the severity dropdown option). Signed-off-by: Hoda Noori <hoda.noori@sap.com>
Signed-off-by: Hoda Noori <hoda.noori@sap.com>
|
BE logic is not working completely, therefore I have not sent this PR to review yet. But the UI coding is completed |
Summary
Adds a new "Change Severity" action to the vulnerability popup menu on the image details page, alongside the existing False Positive, Accept Risk, and Mitigate Manually actions. This allows users to rescore a vulnerability's severity level by creating a remediation record of type
Rescorewith the new severity value.Changes Made
ChangeSeverityModalcomponent with a severity dropdown (Select), user ID, expiration date, and description fields — usesRemediationTypeValues.Rescoreand sends the selectedSeverityValuesas the severity overrideIssuesDataRowonChangeSeveritySuccesscallback throughIssuesDataRows→VulnerabilitiesTabContent→ImageIssuesListIssuesDataRowstests to include the new requiredonChangeSeveritySuccesspropRelated Issues
Screenshots (if applicable)
Testing Instructions
pnpm ipnpm TASKChecklist
PR Manifesto
Review the PR Manifesto for best practises.