Draft: Use the total count in the untrack confirmation modal
What does this MR do and why?
Follow-up to !255408 (closed), which is the backend half. This MR targets that branch, so review it after !255408 (closed) merges.
!255408 (closed) scopes vulnerabilitiesCount to open states, because the field is described and labelled as a count of open vulnerabilities. It also adds totalVulnerabilitiesCount, which counts every state.
The untrack confirmation modal warns the user how many vulnerabilities removing a ref affects. It read vulnerabilitiesCount. Removing a ref affects findings in every state, so an open-only count understates the data loss. This MR points the modal at totalVulnerabilitiesCount.
The two changes are separate MRs because Danger flags combined GraphQL backend and frontend changes as a rolling-deploy risk. The frontend can request a field before every backend serves it.
Rollout safety
The new field carries @gl_introduced(version: "19.5.0"), so an older backend omits it instead of rejecting the query.
The modal also falls back to the open count when the total is absent:
const total = this.refToUntrack?.totalVulnerabilitiesCount;
const open = this.refToUntrack?.vulnerabilitiesCount;
return total ?? open ?? 0;Without that fallback the count would read zero during a rolling deployment, and the warning would disappear entirely. The fallback keeps the warning visible, and only understates it for the duration of the rollout.
Testing
yarn jest spec/frontend/security_configuration/components/ passes locally. 24 examples across 2 suites.
New cases in ref_untracking_confirmation_spec.js:
- The warning counts vulnerabilities in every state, not only open ones.
- The warning falls back to the open count when the total is absent.
Related
- Depends on !255408 (closed)
- Part of #628936
- Parent epic: &20474