Push feature flag, accept `hidden` variable parameter, expose `hidden` variable attribute
What does this MR do and why?
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
- pick a group and note its ID
- 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
- navigate to CI/CD settings for the group, open devtools and check that
window.gon.features.ciHiddenVariables
istrue
(feature flag is pushed to the group CI/CD settings page) - navigate to CI/CD settings for a project within the group, open devtools and check that
window.gon.features.ciHiddenVariables
istrue
(feature flag is pushed to the project CI/CD settings page) - optional: navigate to instance/admin CI/CD settings, open devtools and check that
window.gon.features.ciHiddenVariables
isundefined
(feature flag should not be pushed to the instance/admin CI/CD settings page)
hidden
via POC
test use of - pick a group and note its ID
- 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
- navigate to CI/CD settings for the group
- add a variable with
Visibility
set toMasked 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
- add a variable with
- 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
- optional: navigate to instance/admin CI/CD settings
- verify that nothing has changed (this feature is only for group and project variables)