For scan execution policies, when linking a project for ci/cd code actions, the group name is not correct after changing it

Summary

From !147307 (comment 1824559449)

The group name is not matching for a selected policy

img

Steps to reproduce

  1. Upload a GitLab Ultimate license
  2. Enable the feature flag echo "Feature.enable(:compliance_pipeline_in_policies)" | rails c.
  3. Create a group => Settings => General => Permissions and group features section
  4. Enable Run customized CI YAML file as security policy actions and save
  5. Navigate to a project in the group => Secure => Policies => New policy => Scan Execution Policy
  6. Add a new action => Run CI/CD code => Run Linked existing CI file
  7. Select a project
  8. Verify the group is correct
  9. Navigate to the group => Settings => Change the name
  10. Navigate to a project in the group => Secure => Policies => New policy => Scan Execution Policy
  11. Add a new action => Run CI/CD code => Run Linked existing CI file
  12. Select a project

Example Project

vid

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Alexander Turinske