Add masked and hidden option to variables UI
What does this MR do and why?
Add masked and hidden option to variables UI
Check feature flag value, pass areHiddenVariablesAvailable down
Show new "Masked and hidden" radio button
Save masked and hidden variables with masked: true, hidden: true
Load masked and hidden variables by translating booleans to options
Show "Hidden" badge if variable is hidden
Add exception: don't validate blank value when editing a hidden variable
Show different settings section text if flag is enabled
Update documentation to refer to "Visibility" instead of just "Masked"
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
Before | After | |
---|---|---|
group variables | Screen_Recording_2024-07-22_at_17.03.02 | |
project variables | Screen_Recording_2024-07-22_at_17.18.29 | |
instance variables | no change |
How to set up and validate locally
-
if !159937 (merged) has not been merged:
!159937 (merged) includes the
hidden
attribute in the variable list response - without this, after you save a hidden variable, it will look like a masked variable. So to test out the full feature, check out this MR's branch and then rebase it on !159937 (merged)'s:git checkout 29674-expose-hidden-attribute-and-push-feature-flag git checkout 29674-add-masked-and-hidden-option-to-ui git rebase 29674-expose-hidden-attribute-and-push-feature-flag
-
pick a group and note its ID
-
enable the feature flag for the group (replace 83 in the example below with your group's ID):
echo "Feature.enable(:ci_hidden_variables, Group.find(83))" | gdk rails c
-
navigate to that group, and in the sidebar choose
Settings
=>CI/CD
-
verify the following behaviors:
- in the drawer, when creating a hidden variable, its value is validated exactly like a masked variable's value would be
- in the drawer, when editing a hidden variable, its visibility and value cannot be changed
- in the table, hidden variables show a
Hidden
badge and don't show their value
-
navigate to a project in that group, and in the sidebar choose
Settings
=>CI/CD
-
verify the behaviors from
5.
, and one more:- in the
Group variables (inherited)
table (shown below the main variables table if the group that the project belongs to has defined any variables), hidden variables from the group show aHidden
badge
- in the
-
navigate to the admin area (
Admin
button at the bottom of the sidebar), then in that sidebar chooseSettings
=>CI/CD
-
verify that nothing has changed in this view (why? we don't plan to implement this feature for instance variables)