Rename `ProjectBuildStatus` -> `ProjectPipelineStatus`
This commit is contained in:
parent
a6d313001a
commit
02072e17ab
|
@ -393,7 +393,7 @@ module Ci
|
||||||
end
|
end
|
||||||
|
|
||||||
def refresh_project_build_status_cache
|
def refresh_project_build_status_cache
|
||||||
Gitlab::Cache::Ci::ProjectBuildStatus.update_for_pipeline(self)
|
Gitlab::Cache::Ci::ProjectPipelineStatus.update_for_pipeline(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -1197,7 +1197,7 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def pipeline_status
|
def pipeline_status
|
||||||
@pipeline_status ||= Gitlab::Cache::Ci::ProjectBuildStatus.load_for_project(self)
|
@pipeline_status ||= Gitlab::Cache::Ci::ProjectPipelineStatus.load_for_project(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
def mark_import_as_failed(error_message)
|
def mark_import_as_failed(error_message)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
module Gitlab
|
module Gitlab
|
||||||
module Cache
|
module Cache
|
||||||
module Ci
|
module Ci
|
||||||
class ProjectBuildStatus
|
class ProjectPipelineStatus
|
||||||
attr_accessor :sha, :status, :project, :loaded
|
attr_accessor :sha, :status, :project, :loaded
|
||||||
|
|
||||||
delegate :commit, to: :project
|
delegate :commit, to: :project
|
|
@ -19,7 +19,7 @@ describe CiStatusHelper do
|
||||||
|
|
||||||
describe "#pipeline_status_cache_key" do
|
describe "#pipeline_status_cache_key" do
|
||||||
it "builds a cache key for pipeline status" 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),
|
build(:project),
|
||||||
sha: "123abc",
|
sha: "123abc",
|
||||||
status: "success"
|
status: "success"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Gitlab::Cache::Ci::ProjectBuildStatus do
|
describe Gitlab::Cache::Ci::ProjectPipelineStatus do
|
||||||
let(:project) { create(:project) }
|
let(:project) { create(:project) }
|
||||||
let(:pipeline_status) { described_class.new(project) }
|
let(:pipeline_status) { described_class.new(project) }
|
||||||
|
|
|
@ -1083,7 +1083,7 @@ describe Ci::Pipeline, models: true do
|
||||||
let(:pipeline) { create(:ci_pipeline, sha: '123456') }
|
let(:pipeline) { create(:ci_pipeline, sha: '123456') }
|
||||||
|
|
||||||
it 'updates the cached status' do
|
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)
|
with(pipeline)
|
||||||
|
|
||||||
pipeline.block
|
pipeline.block
|
||||||
|
|
|
@ -1949,7 +1949,7 @@ describe Project, models: true do
|
||||||
describe '#pipeline_status' do
|
describe '#pipeline_status' do
|
||||||
let(:project) { create(:project) }
|
let(:project) { create(:project) }
|
||||||
it 'builds a pipeline status' do
|
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
|
end
|
||||||
|
|
||||||
it 'hase a loaded pipeline status' do
|
it 'hase a loaded pipeline status' do
|
||||||
|
|
Loading…
Reference in New Issue