Skip to content

Add identity verification check when enabling shared runners

What does this MR do and why?

Related to: https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/688

This MR checks a user's identity verification status before they are permitted to enable shared runners.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Start GDK with SaaS simulation
    $ export GITLAB_SIMULATE_SAAS=1
    $ gdk start
  2. Enable the relevant feature flags
    > Feature.enable(:opt_in_identity_verification)
    > Feature.enable(:identity_verification_phone_number)
    > Feature.enable(:ci_requires_identity_verification_on_free_plan)
  3. Update the created_at date for a test user to be after the feature release date.
    > user.update!(created_at: IdentityVerifiable::IDENTITY_VERIFICATION_RELEASE_DATE + 1.day)
  4. With the test user, attempt to enable shared runners in a project (they may have to be disabled first). You should see an identity verification error.
Edited by Ian Anderson

Merge request reports