Use orbit flow version for developer/v1 when user has orbit enabled

What does this MR do and why?

When a user has the duo_developer_orbit feature flag enabled and has the Orbit master toggle turned on in their preferences, the developer/v1 flow is routed to the 2.0.0-orbit flow version instead of the default 2.0.0.

This allows internal testing of the Orbit-aware developer flow variant (introduced in gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#2246 (closed)) without affecting users who have not opted in.

Key changes

FoundationalFlowStartParamsResolver:

  • Updated call to accept an optional user: keyword argument
  • In resolve_with_overrides, checks duo_developer_orbit feature flag + Ai::Orbit::Settings.killswitch_on?(user) before the duo_developer_next_unstable check — when both conditions are true, returns developer/v1 with version 2.0.0-orbit

Callers (CreateAndStartWorkflowService, ExecuteWorkflowService, DuoWorkflowHelpers):

  • Each caller now passes user: current_user to FoundationalFlowStartParamsResolver.call

Behavior matrix

Flow Condition DEFINITION CONFIG_ID SCHEMA_VERSION FLOW_VERSION
developer/v1 default (no flags) developer/v1 developer v1 2.0.0
developer/v1 duo_developer_orbit on + orbit master toggle on developer/v1 developer v1 2.0.0-orbit
developer/v1 duo_developer_next_unstable on developer_unstable/experimental developer_unstable experimental 1.0.0
developer/v1 both duo_developer_orbit (+ toggle) and duo_developer_next_unstable developer/v1 developer v1 2.0.0-orbit

Gating logic

  • duo_developer_orbit feature flag is the top-level gate — when disabled (default), behavior is unchanged
  • Ai::Orbit::Settings.killswitch_on?(user) checks the Orbit master toggle in user preferences as a safety net
  • duo_developer_orbit takes priority over duo_developer_next_unstable, so users can explicitly opt into the orbit flow even when the unstable flag is globally enabled

References

Screenshots or screen recordings

Before After
N/A (backend only) N/A (backend only)

How to set up and validate locally

  1. Spin up your GDK on latest master

  2. Enable the feature flag for a user:

    user = User.find_by_username('your-username')
    Feature.enable(:duo_developer_orbit, user)
  3. Enable the Orbit master toggle in user preferences:

    user.user_preference.update!(orbit_settings: { 'enabled' => true })
  4. Trigger the Duo Developer flow

  5. Check the CI job variables — DUO_WORKFLOW_FLOW_VERSION should be 2.0.0-orbit

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.

Edited by Thomas Schmidt

Merge request reports

Loading