Filter unknown scopes in the secrets permissions table

What does this MR do and why?

Follow-up to !260976 (merged). It applies the two non-blocking frontend review suggestions from that MR.

  • formatActions in the permissions table now filters out actions that have no entry in SCOPE_LABELS before it sorts and joins them. Before, an unknown action sorted first and rendered as an empty string, so the Scope cell started with a stray comma. This happens when an old frontend reads a newer action from the API, and it also covers the removal of WRITE in 20.0.
  • The table spec no longer mounts the component a second time to check the Update label. The shared USER_PERMISSION_NODE mock now has UPDATE out of order and an unknown DESTROY action, and the existing assertion checks the full ordered string Read metadata, Read value, Create, Update, Delete. This covers both the sort order and the filter.

Review threads this addresses:

References

Screenshots or screen recordings

No visible change for current data. The only rendering change is that an action the frontend does not know is omitted from the Scope cell instead of rendering as a leading comma.

How to set up and validate locally

Run the table spec:

yarn jest ee/spec/frontend/pages/projects/shared/permissions/secrets_manager/components/secrets_manager_permissions_table_spec.js

Remove the .filter line in formatActions and run it again. The renders user info test fails with a leading comma.

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.

Merge request reports

Loading
Loading