Skip to content

Experiment - Add group invite to registration [RUN ALL RSPEC] [RUN AS-IF-FOSS]

What does this MR do?

  • Adds the Invite your teammates screen to the signup process after group is created and before project creation.
  • Navigates the different possibilities where this should occur.
  • Refactors the groups_controller.rb for enhanced readability (trying to keep branching to once per method).
  • Refactors and adds to the testing of groups_controller_spec.rb.

What this MR doesn't do?

  • Adhere to DRY principles in groups_controller.rb and some other areas of testing.
    • Intentional since this area is VERY complex as seen from the Flow Diagram below. Readability trumps DRYness in this case.
  • Adhere to Avoidance of Test Duplication.
    • As mentioned this area is very complex, so while there is overlap in some areas of testing feature/unit/etc. This is intentional.
  • Solve the overall complexity reduction of this area by using more controllers or other methods.
    • Surfaced the complexity of this area as a concern here.
      • Any further modifications to this area will again take many cycles and enhance risk profile. Adds to some of the reasoning behind duplication of testing layers.
  • Use shared_examples inside testing - especially inside groups_controller_spec.rb
    • Readability of this fragile area takes priority over DRYness.

How to test in GDK

  • Go to rails console via bundle exec rails console

  • Enable the FEature flag for 100%.

    [4] pry(main)> Feature.enable_percentage_of_time(:registrations_group_invite, 100)
  • Register as a new user on your GDK/GitLab instance in the browser

    • Either click Register now on sign-in page, or sign out and visit this page http://localhost:3000/users/sign_up
  • Create User, Group, and then the next page(before creating project) should be the group invites one we are adding.

  • To validate feature flag/experiment here - set the percentage back to 0

    [4] pry(main)> Feature.enable_percentage_of_time(:registrations_group_invite, 0)

Flow Diagram

flowchart TD
    A[Welcome after Sign Up] -->B{show group creation?}
    B -->|Yes| C[Group Form]
    B -->|No| D[End]
    subgraph group form
    C -->E{ In trial onboarding flow? }
    E -->|Yes| F(show progress bar)
    E -->|No| G(no progress bar)
    F & G -->H{Trial during signup?}
    H -->|Yes| I[Trial form fields]
    H -->|No| J{In Group Invite Experiment?}
    J -->|Yes| K[No extra form fields]
    J -->|No| L[Show member invite form fields]
    end
    K & L --> M(Submit Group Creation)
    subgraph Group Creation
    M --> N{Group creation successful?}
    N -->|Yes| O{In trial onboarding flow?}
    N -->|No| C
    O -->|Yes| P(Apply Trial)
    O -->|No| U{In Trial During Signup Experiment?}
    P -->Q{Successfully applied trial?}
    Q -->|Yes| R{In Group Invite Experiment?}
    Q -->|No| C
    U -->|Yes| W{In Trial During Signup?}  
    W -->|Yes| V{Successfully created Lead and applied trial?}
    V -->|No| C
    U -->|No| X{In Group Invite Experiment?}
    X -->|No| Z(Process group member invitations)
    end
    R -->|Yes| S(Redirect to Group Invite Form)
    R -->|No| T(Redirect to Project Creation Form)
    Q -->|No| T(Redirect to Project Creation Form)
    V -->|Yes| T(Redirect to Project Creation Form)
    U -->|No| T(Redirect to Project Creation Form)
    W -->|No| T(Redirect to Project Creation Form)
    X -->|Yes| S(Redirect to Group Invite Form)
    Z -->T(Redirect to Project Creation Form)
    subgraph Group Invite Form
    S -->A1{Show trial activated banner?}
    A1 -->|Yes| B1(Show trial banner)
    A1 -->|No| C1(No Trial banner)
    B1 & C1 --> D1[Group Invite Form]
    end
    D1 -->E1(Submit Group Invite Form)
    E1 -->F1(Process group member invitations)
    F1 -->G1(Redirect to Project Creation Form)
    subgraph Project Creation Form
    T -->H1{Show trial activated banner?}
    H1 -->|Yes| I1(Show trial banner)
    H1 -->|No| J1(No Trial banner)
    J1 & G1 --> K1[Project Creation Form] 
    end 

Screenshots (strongly suggested)

New group invite page

Screen_Shot_2021-02-10_at_3.47.19_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #219544

Edited by Doug Stull

Merge request reports