Add ability to force user segmentation on a per user basis for GLEX

Created from ideas in gitlab-org/growth/team-tasks#905 (comment 2751551819)

We want a way to enable us to force ourselves into various experiment assignment(candidate, control, etc). We aren't able to do that today when we are performing UAT/advanced validations locally or in staging/production.

Requirements

  1. Must be able to work in non-local dev. i.e. staging/production
  2. Must be able to handle anonymous entrypoint. i.e. the user not signed in yet.
  3. Must be able to handle a case where the variant is decided fully in the backend. No clear entrypoint from the UI available. i.e. passing a parameter down from a request will be complicated and sometimes impossible.

Ideas

  1. Push into segmentation in GLEX with the solution.
  2. non-signed in - observe a url param
  3. no request/param entrypoint - prefix/suffix the subject name to help identify like user.name matches bob_glex_candidate. Perhaps using chatops here to modify the assignment in GitLab would be a fuller solution.

Rollout plan (Requirements 1 & 2)

  • Merge gitlab-org/ruby/gems/gitlab-experiment!246 (merged) (force assignment feature)
  • Cut a new version of the gitlab-experiment gem gitlab-org/ruby/gems/gitlab-experiment!247 (merged)
  • Update !224499 (merged) to use the released gem version, remove draft status, and merge
Edited Feb 26, 2026 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading