Skip to content

Add environment scope dropdown to secrets form

Mireya Andres requested to merge ma/ci-secrets-form-env-dropdown into master

What does this MR do and why?

Partially implements #424458 (closed). This follows the Figma designs.

This MR:

  • Adds the environment dropdown to the secrets form. The environment dropdown loads the environment scopes of the group/project. It works the same way as the environments dropdown for CI Variables (and is, in fact, a shared component used in both pages), with the following exceptions:
    • The user cannot create wildcards.
    • The dropdown in the secrets form has an additional "Not Applicable" option in the dropdown list.
  • Fixes a bug where the "Not Applicable" option does not show up as the second item in the dropdown options

Please refer to the implementation plan below for the changes that will be implemented in the next iterations:

Implementation Plan

Iteration MR
Make environments dropdown reusable !138464 (merged)
Create base form with preview modal and key, value, description, expiration, and rotation fields !146228 (merged)
Add environment dropdown 👈 You are here!
Add access permission dropdowns, with user search !147176 (closed)
Integrate apollo and add form submission

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-03-14_at_15.13.36 Screen_Recording_2024-03-14_at_15.09.24

How to set up and validate locally

  1. Enable the ci_tanukey_ui feature flag to your root group or namespace. Refer to this diagram on how the feature flag works.
  2. Run the following rake tasks to populate the environments dropdown.
    # creates project environments
    bundle exec rake "gitlab:seed:project_environments[project_path]"
    
    # creates 10 group CI variables each with a unique environment scope
    bundle exec rake "gitlab:seed:ci_variables_group[group_name, 10, unique]"
  3. Visit <path-to-project-or-group>/-/secrets/new to view the form.
  4. Verify that:
    • the environment dropdown loads with * and Not Applicable options available (when no search term is provided)
    • you can set the environment
    • you can search for a specific environment
Edited by Mireya Andres

Merge request reports