Rename security labels to security attributes
What does this MR do and why?
Rename security labels to security attributes
Rename all instances of [Ss]ecurity.?[Ll]abels in all files
Rename/move all files/directories with paths containing security_labels
How?
Using ripgrep, fd, and sd/sed:
- In files that contain ecurity.?label (case insensitive), replace ecuritylabel with ecurityattribute and ecurityLabel with ecurityAttribute
rg 'ecurity.?label' -i -l | xargs sd 'ecurity(.?)label' 'ecurity${1}attribute'
rg 'ecurity.?label' -i -l | xargs sd 'ecurity(.?)Label' 'ecurity${1}Attribute'
- In security_configuration files that contain imports of label components, replace 'Label' with 'Attribute' and 'label' with 'attribute'
rg 'import.*label' -g '**/security_configuration/**' -i -l | xargs sd 'Label' 'Attribute'
rg 'import.*label' -g '**/security_configuration/**' -i -l | xargs sd 'label' 'attribute'
- Find files in security_labels with label in the name and files whose paths contain security_labels and run the script below on each one
fd -p '.*/security_labels/.*label' --type file --exec ./rename_to_attributes.sh
fd -p '.*security_labels.*' --type file --exec ./rename_to_attributes.sh
#!/bin/bash
# rename_to_attributes.sh
# given a file path, move it to the equivalent path with every instance of 'label' replaced with 'attribute'
new_path=$(echo $1 | sed 's/label/attribute/g')
mkdir -p $(dirname $new_path)
mv $1 $new_path
-
Discard any false positives (
doc/development/duo_workflow/create_triage_policy_with_gitlab_duo_workflow_guide.md, and any:label=""s in unrelated security_configuration files) -
Scan through the components we've built so far and replace more instances of 'label' with 'attribute' (second commit)
References
- discussion: #547963 (comment 2600487262)
- issue: Rename "Security labels" => "Security attributes" (#554627 - closed)
- epic: Security Attributes/Context Filtering (&18010)
Screenshots or screen recordings
Only UI text and documentation should change, behavior should stay the same.
| Before | After |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to set up and validate locally
git checkout 554627-rename-labels-to-attributes-in-user-interface
echo "Feature.enable(:security_context_labels)" | gdk rails c
note: This page is working off of mock data in ee/app/assets/javascripts/security_configuration/graphql/resolvers.js for now, which is fetched with ee/app/assets/javascripts/security_configuration/graphql/client/security_attributes.query.graphql
- on each of these three pages:
- go to a group where you are a maintainer or owner, and in the sidebar choose
Secure=>Security configuration - go to a project within that group, and in the sidebar choose
Secure=>Security configuration - go to the admin area, and in the sidebar choose
Settings=>Roles and permissions, then click theNew rolebutton
- go to a group where you are a maintainer or owner, and in the sidebar choose
- verify that all instances of "security label" or "label" has been changed to "security attribute" or "attribute"
- verify that all UI behavior is still working exactly as before
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.











