Draft: [ci skip] Display number of secrets that would be lost when deleting a project

What does this MR do and why?

When a user deletes a project, they are prompted with a modal that shows the resources that will be lost when the project is deleted. We should included the number of secrets in the list as well.

The stats in the modal are provided by Rails by default, but for our case, we will be fetching the secrets count via GraphQL for performance reasons. The secrets manager requires the OpenBao service and we have to check first that the feature is enabled for the project, so fetching the secrets count requires additional requests, which we would like to avoid on every page load.

See !229342 (comment 3210563579) for further discussion.

This is only available for EE.

References

Implements #583210 for projects. A separate MR will be created for groups.

Screenshots or screen recordings

State Screenshot
CE or no secrets manager provisioned (no secrets count provided) no_secrets_manager
While querying loading
With secrets count secrets_count
With error (this will NOT prevent the user from deleting) with_error

How to set up and validate locally

Enable the Secrets Manager

  1. Upload a Premium license (or above).
  2. Set up openbao and enable the secrets manager on your gdk.
  3. Enable the secrets_manager feature flag.
  4. Go to your project settings (Settings > General) and expand Visibility, project features, permissions. Enable the secrets manager for your project/group with the settings toggle.
  5. Go to /path-to-project/secrets/new and create a new secret.

Feature Verification

  1. To delete your secret, you can either:
    • Go to Settings > General > Advanced and delete your group or project
    • Select Delete from the header list actions of the project header_list_actions
  2. Verify that the secrets count is shown in the delete modal.

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.

Edited by Mireya Andres

Merge request reports

Loading