diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-08-24 17:08:32 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-04 21:55:26 +0900 |
commit | 75130a41ba19b80ac7b2300721915787ac4681bf (patch) | |
tree | e00593f96e419a149e8e3a8c0817174c25a16e45 /app | |
parent | 970af9964ea9404942818d8c3394d2903955ed69 (diff) | |
download | gitlab-ce-75130a41ba19b80ac7b2300721915787ac4681bf.tar.gz |
Remove CreateTriggerRequestService and forbit to save variables on Ci::TriggerRequest
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/trigger_request.rb | 4 | ||||
-rw-r--r-- | app/services/ci/create_trigger_request_service.rb | 19 |
2 files changed, 4 insertions, 19 deletions
diff --git a/app/models/ci/trigger_request.rb b/app/models/ci/trigger_request.rb index c58ce5c3717..4e274a57504 100644 --- a/app/models/ci/trigger_request.rb +++ b/app/models/ci/trigger_request.rb @@ -6,6 +6,10 @@ module Ci belongs_to :pipeline, foreign_key: :commit_id has_many :builds + # Ws swtiched to Ci::PipelineVariable from Ci::TriggerRequest.variables. + # Ci::TriggerRequest doesn't save variables anymore. + validates :variables, absence: true + serialize :variables # rubocop:disable Cop/ActiveRecordSerialize def user_variables diff --git a/app/services/ci/create_trigger_request_service.rb b/app/services/ci/create_trigger_request_service.rb deleted file mode 100644 index b2aa457bbd5..00000000000 --- a/app/services/ci/create_trigger_request_service.rb +++ /dev/null @@ -1,19 +0,0 @@ -# This class is deprecated because we're closing Ci::TriggerRequest. -# New class is PipelineTriggerService (app/services/ci/pipeline_trigger_service.rb) -# which is integrated with Ci::PipelineVariable instaed of Ci::TriggerRequest. -# We remove this class after we removed v1 and v3 API. This class is still being -# referred by such legacy code. -module Ci - module CreateTriggerRequestService - Result = Struct.new(:trigger_request, :pipeline) - - def self.execute(project, trigger, ref, variables = nil) - trigger_request = trigger.trigger_requests.create(variables: variables) - - pipeline = Ci::CreatePipelineService.new(project, trigger.owner, ref: ref) - .execute(:trigger, ignore_skip_ci: true, trigger_request: trigger_request) - - Result.new(trigger_request, pipeline) - end - end -end |