Skip to content

Add observability scopes for personal tokens

Peter Leitzen requested to merge pl-observability-token-scopes into master

What does this MR do and why?

This MR adds two 🆕 scopes (read_observability and write_obsevability) to be used by GitLab Observability exclusively only if feature flag observability_group_tab is enabled. See the rollout issue.

These scopes do not enable any abilities within GitLab itself. Those tokens are only meant to be used by GitLab Observability itself. (See example)

The new scopes are only visible on Group > Settings > Access tokens and hidden on other Access token pages (Project, Profile, Admin).

See gitlab-org/opstrace/opstrace#2086 (closed) for more information.

Screenshots or screen recordings

Group > Settings > Access tokens Project > Settings > Access tokens Profile > Preferences > Access tokens Admin > Users > Impersonation Tokens
feature flag ENABLED globally Screenshot_from_2023-04-04_14-11-31 Screenshot_from_2023-04-04_14-11-18 Screenshot_from_2023-04-04_14-10-08 Screenshot_from_2023-04-04_14-10-00
feature flag ENABLED on group On that group Screenshot_from_2023-04-04_14-11-31 On other group Screenshot_from_2023-04-04_14-10-36 Screenshot_from_2023-04-04_14-10-17 Screenshot_from_2023-04-04_14-10-08 Screenshot_from_2023-04-04_14-10-00
feature flag DISABLED Screenshot_from_2023-04-04_14-10-36 Screenshot_from_2023-04-04_14-10-17 Screenshot_from_2023-04-04_14-10-08 Screenshot_from_2023-04-04_14-10-00
  • Visible
  • Hidden
Token created
Screenshot_from_2023-04-04_14-21-01

How to set up and validate locally

  1. Start GDK
  2. Go to Group > Settings > Access tokens
  3. Go to Project > Settings > Access tokens
  4. Go to Profile > Preferences > Access tokens
  5. Go to Admin > Users > Impersonation Tokens
  6. Enable feature flag observability_group_tab on group via Feature.enable(:observability_group_tab, Group.first) in Rails console
  7. go to 2.
  8. Enable feature flag observability_group_tab globally via Feature.enable(:observability_group_tab) in Rails console
  9. go to 2.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports