[go: up one dir, main page]

Create Trials::GitlabCom::AddonsController

Summary

Create a new Trials::GitlabCom::AddonsController on CustomersDot to handle addon trial application for GitLab.com.

Problem

Addon trial application is currently handled in the monolithic trials_controller.rb#create_addon method. This needs to be extracted into a dedicated, REST-compliant controller.

Implementation Details

New Controller

File: app/controllers/trials/gitlab_com/addons_controller.rb

Responsibilities:

  • Handle addon trial application for GitLab.com namespaces (Duo Pro, Duo Enterprise, etc.)
  • Validate trial parameters
  • Apply addon trial to namespace
  • Return appropriate success/error responses

Extract from trials_controller.rb

  • Addon trial application logic from create_addon method
  • Related validations and before_actions
  • Addon-specific error handling
  • Any addon-specific helper methods

Routes

Add to config/routes.rb:

namespace :trials do
  namespace :gitlab_com do
    resources :addons, only: [:create]
  end
end

New endpoint: POST /trials/gitlab_com/addons

Edited by Doug Stull