Frontend: Create and update rotation for secrets

Why are we doing this work

The Secrets manager form already has a rotation field in its UI, but we currently do not save this data yet. Once #499945 (closed) and #555420 (closed) are complete, we can update the frontend to save and render the rotation data for secrets.

Implementation plan

  • Remove cron syntax UI and allow users to add custom numbers for rotationIntervalDays
  • Add rotation field in the create and update mutation (ee/app/assets/javascripts/ci/secrets/graphql/mutations)
  • Save rotation field through the UI (the rotation field is already available in the UI, so we just need to include the data to GraphQL)
  • Render the rotation data on the secret detail page and the secrets table (update fetch query to include the data)

Implementation Table

Group Issue Link
backend Backend: Secret Rotation API Implementation (Da... (#499945 - closed)
backend Secret Rotation in GraphQL Resolvers
frontend 👈 You are here
backend Background Jobs for Secret Rotation Reminders
backend Implement resolver for listing secrets that need to be rotated
frontend Secret Rotation UI for Indicators and Alerts

Verification steps

Setup

  1. Make sure your gdk is on an Ultimate license.
  2. Set up openbao on your gdk.
  3. Enable the Secrets Manager on gdk.

Verification

  1. Visit /path/to/project/-/secrets (or go to your project and from the sidebar visit Secure > Secrets)
  2. From the secrets table, you can create a new secret by clicking the Add secret button on the top right. You can also edit an existing secret through the actions column.
  3. Successfully creating and updating a secret will automatically redirect you to the secret details page. Verify that the rotation data is displayed on this page, as well as in the corresponding secrets row on the secrets table.
Edited by 🤖 GitLab Bot 🤖