From 02072e17ab484d7c99dc485fc3ef8348f8da8bf1 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Mon, 3 Apr 2017 09:09:11 +0200 Subject: [PATCH] Rename `ProjectBuildStatus` -> `ProjectPipelineStatus` --- app/models/ci/pipeline.rb | 2 +- app/models/project.rb | 2 +- .../ci/{project_build_status.rb => project_pipeline_status.rb} | 2 +- spec/helpers/ci_status_helper_spec.rb | 2 +- ...ect_build_status_spec.rb => project_pipeline_status_spec.rb} | 2 +- spec/models/ci/pipeline_spec.rb | 2 +- spec/models/project_spec.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename lib/gitlab/cache/ci/{project_build_status.rb => project_pipeline_status.rb} (98%) rename spec/lib/gitlab/cache/ci/{project_build_status_spec.rb => project_pipeline_status_spec.rb} (99%) diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 1506a6bf6ab..b8d77e62494 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -393,7 +393,7 @@ module Ci end def refresh_project_build_status_cache - Gitlab::Cache::Ci::ProjectBuildStatus.update_for_pipeline(self) + Gitlab::Cache::Ci::ProjectPipelineStatus.update_for_pipeline(self) end private diff --git a/app/models/project.rb b/app/models/project.rb index f6b66232346..5ff997faa63 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1197,7 +1197,7 @@ class Project < ActiveRecord::Base end def pipeline_status - @pipeline_status ||= Gitlab::Cache::Ci::ProjectBuildStatus.load_for_project(self) + @pipeline_status ||= Gitlab::Cache::Ci::ProjectPipelineStatus.load_for_project(self) end def mark_import_as_failed(error_message) diff --git a/lib/gitlab/cache/ci/project_build_status.rb b/lib/gitlab/cache/ci/project_pipeline_status.rb similarity index 98% rename from lib/gitlab/cache/ci/project_build_status.rb rename to lib/gitlab/cache/ci/project_pipeline_status.rb index 3982caa4a47..882b4da1725 100644 --- a/lib/gitlab/cache/ci/project_build_status.rb +++ b/lib/gitlab/cache/ci/project_pipeline_status.rb @@ -4,7 +4,7 @@ module Gitlab module Cache module Ci - class ProjectBuildStatus + class ProjectPipelineStatus attr_accessor :sha, :status, :project, :loaded delegate :commit, to: :project diff --git a/spec/helpers/ci_status_helper_spec.rb b/spec/helpers/ci_status_helper_spec.rb index 9174db59ee3..c795fe5a2a3 100644 --- a/spec/helpers/ci_status_helper_spec.rb +++ b/spec/helpers/ci_status_helper_spec.rb @@ -19,7 +19,7 @@ describe CiStatusHelper do describe "#pipeline_status_cache_key" do it "builds a cache key for pipeline status" do - pipeline_status = Gitlab::Cache::Ci::ProjectBuildStatus.new( + pipeline_status = Gitlab::Cache::Ci::ProjectPipelineStatus.new( build(:project), sha: "123abc", status: "success" diff --git a/spec/lib/gitlab/cache/ci/project_build_status_spec.rb b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb similarity index 99% rename from spec/lib/gitlab/cache/ci/project_build_status_spec.rb rename to spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb index 7b9e959b087..ada9bf136f4 100644 --- a/spec/lib/gitlab/cache/ci/project_build_status_spec.rb +++ b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Gitlab::Cache::Ci::ProjectBuildStatus do +describe Gitlab::Cache::Ci::ProjectPipelineStatus do let(:project) { create(:project) } let(:pipeline_status) { described_class.new(project) } diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 504442392ea..b71fd794d4c 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -1083,7 +1083,7 @@ describe Ci::Pipeline, models: true do let(:pipeline) { create(:ci_pipeline, sha: '123456') } it 'updates the cached status' do - expect(Gitlab::Cache::Ci::ProjectBuildStatus).to receive(:update_for_pipeline). + expect(Gitlab::Cache::Ci::ProjectPipelineStatus).to receive(:update_for_pipeline). with(pipeline) pipeline.block diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index c721b79f5d8..e9bd0180ad9 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1949,7 +1949,7 @@ describe Project, models: true do describe '#pipeline_status' do let(:project) { create(:project) } it 'builds a pipeline status' do - expect(project.pipeline_status).to be_a(Gitlab::Cache::Ci::ProjectBuildStatus) + expect(project.pipeline_status).to be_a(Gitlab::Cache::Ci::ProjectPipelineStatus) end it 'hase a loaded pipeline status' do