diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-03 14:09:49 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-03 14:09:49 +0300 |
commit | 3577b57f6b03a0d3c3d32daab6dc6ccf5f6e45f7 (patch) | |
tree | bb8ead689d855cc783e9eddce848d74934de9c19 | |
parent | 717fdd6d42f119dd1e0f457c40563cc35985fbae (diff) |
Try to use `pipeline` where applicable
-rw-r--r-- | app/models/ci/build.rb | 12 | ||||
-rw-r--r-- | app/models/commit_status.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/build_data_builder.rb | 2 | ||||
-rw-r--r-- | spec/factories/ci/builds.rb | 2 | ||||
-rw-r--r-- | spec/factories/commit_statuses.rb | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 74441eb97dc..77837e9384a 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -118,12 +118,12 @@ module Ci .reorder(iid: :asc) merge_requests.find do |merge_request| - merge_request.commits.any? { |ci| ci.id == commit.sha } + merge_request.commits.any? { |ci| ci.id == pipeline.sha } end end def project_id - commit.project.id + pipeline.project_id end def project_name @@ -359,8 +359,8 @@ module Ci end def global_yaml_variables - if commit.config_processor - commit.config_processor.global_variables.map do |key, value| + if pipeline.config_processor + pipeline.config_processor.global_variables.map do |key, value| { key: key, value: value, public: true } end else @@ -369,8 +369,8 @@ module Ci end def job_yaml_variables - if commit.config_processor - commit.config_processor.job_variables(name).map do |key, value| + if pipeline.config_processor + pipeline.config_processor.job_variables(name).map do |key, value| { key: key, value: value, public: true } end else diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 3752bf09f16..98a8b541e96 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -55,7 +55,7 @@ class CommitStatus < ActiveRecord::Base delegate :sha, :short_sha, to: :commit def before_sha - commit.before_sha || Gitlab::Git::BLANK_SHA + pipeline.before_sha || Gitlab::Git::BLANK_SHA end def self.stages diff --git a/lib/gitlab/build_data_builder.rb b/lib/gitlab/build_data_builder.rb index 34e949130da..9f45aefda0f 100644 --- a/lib/gitlab/build_data_builder.rb +++ b/lib/gitlab/build_data_builder.rb @@ -3,7 +3,7 @@ module Gitlab class << self def build(build) project = build.project - commit = build.commit + commit = build.pipeline user = build.user data = { diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index e2cb08d2a8b..903e331296a 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -43,7 +43,7 @@ FactoryGirl.define do end after(:build) do |build, evaluator| - build.project = build.commit.project + build.project = build.pipeline.project end factory :ci_not_started_build do diff --git a/spec/factories/commit_statuses.rb b/spec/factories/commit_statuses.rb index 67301fbd9a9..65afcc5e50d 100644 --- a/spec/factories/commit_statuses.rb +++ b/spec/factories/commit_statuses.rb @@ -8,7 +8,7 @@ FactoryGirl.define do finished_at 'Tue, 26 Jan 2016 08:23:42 +0100' after(:build) do |build, evaluator| - build.project = build.commit.project + build.project = build.pipeline.project end factory :generic_commit_status, class: GenericCommitStatus do |