Hide unactionable secrets manager settings in the paid experience
What does this MR do and why?
We have a rendering bug where sometimes the secrets manager is in a state where it's unavailable or not actionable, but we still show the settings. This may cause confusion to users since we're not providing the proper guidance.
In these cases, since the secrets manager isn't actionable, it's better to hide the settings until they are actionable. This happens usually when the secrets manager is not yet provisioned (the provisioning happens from the secrets manager page itself).
References
This fixes the bug in https://gitlab.com/gitlab-org/gitlab/-/work_items/628837#note_3841849067 (scoped in #601817 (closed))
Screenshots or screen recordings
| State | Before | After |
|---|---|---|
| Unprovisioned project | ![]() |
![]() |
Unprovisioned TLG (with entitlement trial or paid entitlement state) |
![]() |
Settings > Secure is not available |
(SaaS) When entitlement is trial_eligible |
![]() |
![]() |
For the case where the entitlement is trial_eligible on SaaS, we are not fetching the entitlement state for the sidebar links in case a CDot outage resolves the entitlement to ineligible when it that isn't necessarily the case. This would affect more than just the secrets manager, so we have to be careful about gating the sidebar link here. The compromise instead is to add some guidance in the settings so that instead of an empty inactionable settings, we nudge the user to go to the secrets manager page instead. See !257554 (comment 3915503632), for the related discussion.
How to set up and validate locally
Setting up the secrets manager
-
If testing SaaS, run
GITLAB_SIMULATE_SAAS=1 gdk start; otherwise,gdk updatetests self-managed. -
Set up the GDK with OpenBao: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/openbao.md
-
Enable the following feature flags:
secrets_manager,group_secrets_manager,secrets_manager_paid_experience. Enablesecrets_manager_namespace_enrollmentif testing SaaS;secrets_manager_instance_enrollmentif self-managed. -
Create a new top-level group. This will be our test group. Add another Reporter+ user here (not Owner).
-
The entitlement resolver communicates with the CDot API. We will monkey-patch this and mock the results of the API so we can control the entitlement state locally. To mock the API, add these files
config/secrets_manager_stub.ymlandconfig/initializers/zz_secrets_manager_stub.rband restart your gdk. This will mock the entitlement state returned by GraphQL (which we normally get from CDot).
These will allow you to test with different entitlement states. By default, it is trial_eligible. If you need to clear/reset the cached entitlement, run SecretsManagement::Entitlement.stub_reset! from the rails console.
Verifying the feature
- Set the entitlement state in
secrets_manager_stub.ymltopaid. This adds an entitlement to the secrets manager without provisioning. - If testing on self-managed, enable the secrets manager for your instance by going to Settings > General > GitLab Secrets Manager
- You can verify the state of the settings in Settings > Secure
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.



