Add "Create your first project" registration step to SM

What does this MR do and why?

Adds create first project onboarding for self-managed installations

Implements a "Create your first project" registration step that appears for the root admin user on their second login to a new self-managed GitLab instance.

This feature:

  • Redirects admins to project creation flow on second sign-in
  • Only triggers when sign_in_count reaches 2 (after second login)
  • Requires exactly one human user on the instance
  • Ensures admin has no existing groups
  • Guides users through creating their first group and project

The onboarding helps new self-managed administrators get started by walking them through creating their first project to store code.

The implementation adds:

  • after_sign_in_path_for override in SessionsController
  • New admin/registrations/groups controller and routes
  • Project creation view reusing existing components
  • Comprehensive test coverage for all conditions

References

Screenshots or screen recordings

Before After
Screenshot 2025-11-25 at 5.15.27 PM.png

How to set up and validate locally

  1. Make sure that GitLab is not setup to simulate saas (that this env var is not set GITLAB_SIMULATE_SAAS=1)

  2. Set your root user sign_in_count = 1 in the rails console and save your user

  3. Quickstart: comment out the following lines or return true

    def should_show_self_managed_project_onboarding?(user)
      return false unless user.can_admin_all_resources?
      return false unless user.sign_in_count == 2
      # return false unless User.human.one?
      # return false if user.owned_groups.any?
    
      true
    end
  4. Create group from admin/sign_up/groups/new

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.

Related to #579942

Edited by Buck O'Leary

Merge request reports

Loading