Skip to content

Push feature flag, accept `hidden` variable parameter, expose `hidden` variable attribute

What does this MR do and why?

#⃣ For Frontend (Variable drawer): Add "Masked and hid... (#29674 - closed)

Feature flag rollout issue: [Feature Flag] Rollout of `ci_hidden_variables` (#451326 - closed)

This MR lays the groundwork for Add masked and hidden option to variables UI (!159981 - merged), it will:

  • Push feature flag, use group actors

    • Push feature flag to frontend for group and project CI/CD settings
    • Make feature flag use group actors everywhere it's checked
  • Accept and return hidden attribute for variables

    • Accept hidden as a param in variable update requests
    • Expose the hidden attribute when listing variables, and for inherited variables that we get via GraphQL

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.

No UI changes are expected in this MR. UI changes will happen in Add masked and hidden option to variables UI (!159981 - merged)

How to set up and validate locally

test feature flag in the context of this MR

  1. pick a group and note its ID
  2. check out this branch and enable the feature flag for the group (replace 83 in the example below with your group's ID):
git checkout 29674-expose-hidden-attribute-and-push-feature-flag
echo "Feature.enable(:ci_hidden_variables, Group.find(83))" | gdk rails c
  1. navigate to CI/CD settings for the group, open devtools and check that window.gon.features.ciHiddenVariables is true (feature flag is pushed to the group CI/CD settings page)
  2. navigate to CI/CD settings for a project within the group, open devtools and check that window.gon.features.ciHiddenVariables is true (feature flag is pushed to the project CI/CD settings page)
  3. optional: navigate to instance/admin CI/CD settings, open devtools and check that window.gon.features.ciHiddenVariables is undefined (feature flag should not be pushed to the instance/admin CI/CD settings page)

test use of hidden via POC

  1. pick a group and note its ID
  2. check out the branch from the proof of concept MR (which contains this code) and enable the feature flag for the group (replace 83 in the example below with your group's ID):
git checkout 29674-add-masked-and-hidden-to-variable-visibility-options
echo "Feature.enable(:ci_hidden_variables, Group.find(83))" | gdk rails c
  1. navigate to CI/CD settings for the group
    • add a variable with Visibility set to Masked and hidden, close the variable drawer
    • click the edit button next to the variable, confirm that it saved correctly
    • delete the variable, confirm that it disappeared from the list and no errors occurred
  2. navigate to CI/CD settings for a project within the group
    • repeat the steps above
    • also verify that any hidden variables inherited from the group show the Hidden badge
  3. optional: navigate to instance/admin CI/CD settings
    • verify that nothing has changed (this feature is only for group and project variables)
Edited by Miranda Fluharty

Merge request reports

Loading