[go: up one dir, main page]

Remove trial-related lead creation logic from trials_controller.rb#create

Summary

Remove the trial-related lead creation logic from trials_controller.rb#create after successful migration to the new Leads::GitlabCom::TrialsController.

Problem

The trials_controller.rb#create method currently handles both lead creation and trial application. After migration, it should only handle trial application.

Prerequisites

  • New Leads::GitlabCom::UltimatesController deployed and stable
  • GitLab.com feature flag new_trial_lead_endpoint rolled out to 100%
  • Feature flag has been at 100% for at least 2 weeks with no issues
  • GitLab.com legacy routing code removed

Implementation Details

Code Removal

From trials_controller.rb#create:

  • Remove lead creation logic (keep trial application logic)
  • Remove lead-specific validations
  • Remove lead-specific helper methods
  • Update method to only handle trial application

Important: Do NOT remove trial application logic - only the lead creation portion

Verification

Before removing code, verify:

  • No traffic to legacy single-call flow in last 2 weeks (check logs/metrics)
  • All GitLab.com instances using new two-step flow (lead → trial)
  • No errors related to trial leads in production

Testing

  • Update tests for trials_controller.rb#create to reflect it only handles trial application
  • Ensure remaining trials_controller.rb tests still pass
  • Verify new lead controller tests are comprehensive

Acceptance Criteria

  • Lead creation logic removed from trials_controller.rb#create
  • Trial application logic remains intact
  • Lead-specific tests removed or updated
  • All remaining tests pass
  • Code review completed
  • Deployed to production
  • Verified no errors in production for 1 week post-deployment

Documentation Updates

  • Add new documentation of this flow in the CDOT docs. See trial flow as an example.
Edited by Doug Stull