Add New indicator to Security nav items behind a flag
What does this MR do and why?
Shows a "New" badge on the Security configuration (project and group) and Security inventory (group) nav items, so users can discover the new Automated Triage and Remediation profiles.
The badge shows only when all of these are true:
- the
security_nav_indicatorfeature flag is enabled for the root group - the user can
apply_security_scan_profiles - the user has not visited that page (the callouts added in the parent MR)
- the indicator has not expired (
Security::NavIndicator::EXPIRES_ON)
Dismissing the callout on page visit is not part of this MR, so the badge does not clear yet. It follows in a separate MR, and the flag stays off until then.
The project Security configuration item is defined in the CE menu, so it gets a configuration_menu_item_badge hook that returns nil, overridden in EE.
Note: this is stacked on the parent MR and must be merged after it.
References
- gitlab-org#23768 (closed)
- Parent MR: !269054 (merged)
Screenshots or screen recordings
| Before | After | |
|---|---|---|
| as admin |
group page: subgroup page: project page: |
|
| as a developer |
group page: project page: |
|
| user with maintainer permissions project only: |
How to set up and validate locally
-
In a rails console, enable the flag for a group with an Ultimate license:
Feature.enable(:security_nav_indicator, Group.find_by_full_path('<group-path>')) -
Sign in as an Owner, Maintainer or Security Manager of that group and open the group or one of its projects.
-
Check that Security configuration (project and group) and Security inventory (group) show a New badge in the sidebar.
-
Sign in as a Developer or Reporter of the same group. The Security configuration and Security inventory items are visible, but without the New badge, because the user cannot apply security scan profiles.
-
Disable the flag and check the badge is gone.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.








