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:

  1. 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'
  1. 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'
  1. 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
  1. 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)

  2. Scan through the components we've built so far and replace more instances of 'label' with 'attribute' (second commit)

References

Screenshots or screen recordings

Only UI text and documentation should change, behavior should stay the same.

Before After
Screenshot_2025-07-17_at_13.07.35 Screenshot_2025-07-17_at_13.05.14
Screenshot_2025-07-17_at_13.07.49 Screenshot_2025-07-17_at_13.05.48
Screenshot_2025-07-17_at_13.07.54 Screenshot_2025-07-17_at_13.05.53
Screenshot_2025-07-17_at_13.07.58 Screenshot_2025-07-17_at_13.05.59
Screenshot_2025-07-17_at_13.08.01 Screenshot_2025-07-17_at_13.06.03
Screenshot_2025-07-17_at_13.08.15 Screenshot_2025-07-17_at_13.06.16

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

  1. 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 the New role button
  2. verify that all instances of "security label" or "label" has been changed to "security attribute" or "attribute"
  3. 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.

Edited by Miranda Fluharty

Merge request reports

Loading