summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-09-16 13:23:32 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-30 12:22:55 +0200
commite26953bc4bc7c9522258f201b175c60fd6c0b2a2 (patch)
treec6074c83413289d0234ccadd26c2d7908101813b
parent52ebeb5a89927058e1eba5bda777852011f001eb (diff)
downloadgitlab-ce-e26953bc4bc7c9522258f201b175c60fd6c0b2a2.tar.gz
Build attributes with slice method
-rw-r--r--CHANGELOG3
-rw-r--r--app/services/ci/create_pipeline_builds_service.rb19
2 files changed, 7 insertions, 15 deletions
diff --git a/CHANGELOG b/CHANGELOG
index da2ee1fec7e..2e12dd31d32 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -254,9 +254,6 @@ v 8.11.6
- Exclude some pending or inactivated rows in Member scopes.
- Add missing values to linter !6276 (Katarzyna Kobierska Ula Budziszewska)
-v 8.11.6 (unreleased)
- - Fix an error where we were unable to create a CommitStatus for running state
-
v 8.11.5
- Optimize branch lookups and force a repository reload for Repository#find_branch. !6087
- Fix member expiration date picker after update. !6184
diff --git a/app/services/ci/create_pipeline_builds_service.rb b/app/services/ci/create_pipeline_builds_service.rb
index 3c12b806438..3fc707b1e14 100644
--- a/app/services/ci/create_pipeline_builds_service.rb
+++ b/app/services/ci/create_pipeline_builds_service.rb
@@ -13,24 +13,19 @@ module Ci
private
def create_build(build_attributes)
- build_attributes = {
- stage_idx: build_attributes[:stage_idx],
- stage: build_attributes[:stage],
- commands: build_attributes[:commands],
- tag_list: build_attributes[:tag_list],
- name: build_attributes[:name],
- when: build_attributes[:when],
- allow_failure: build_attributes[:allow_failure],
- environment: build_attributes[:environment],
- yaml_variables: build_attributes[:yaml_variables],
- options: build_attributes[:options],
+ build_attributes = build_attributes.slice(
+ :stage_idx, :stage, :commands, :tag_list, :name, :when, :allow_failure,
+ :environment, :yaml_variables, :options
+ )
+
+ build_attributes = build_attributes.merge(
pipeline: pipeline,
project: pipeline.project,
ref: pipeline.ref,
tag: pipeline.tag,
user: current_user,
trigger_request: trigger_request
- }
+ )
pipeline.builds.create(build_attributes)
end