Commit 8657d5dd authored by Grzegorz Bizon's avatar Grzegorz Bizon

Do not implement CI/CD job to stage association yet

parent d3814ad6
......@@ -38,22 +38,15 @@ class CommitStatus < ActiveRecord::Base
scope :retried_ordered, -> { retried.ordered.includes(project: :namespace) }
scope :after_stage, -> (index) { where('stage_idx > ?', index) }
##
# TODO, we will change this to `belongs_to :stage` when we phase out
# `ci_builds.stage` attribute and migrate `ci_builds.stage_id` reference in
# one of upcoming releases.
#
belongs_to :stage_entity, foreign_key: :stage_id, class_name: 'Ci::Stage'
state_machine :status do
event :enqueue do
transition [:created, :skipped, :manual] => :pending
end
event :process do
transition [:skipped, :manual] => :created
end
event :enqueue do
transition [:created, :skipped, :manual] => :pending
end
event :run do
transition pending: :running
end
......
......@@ -408,18 +408,6 @@ describe CommitStatus, :models do
end
end
describe '#stage_entity' do
let(:stage) { create(:ci_stage_entity) }
let(:commit_status) do
create(:commit_status, stage_id: stage.id)
end
it 'has a correct association with persisted stage' do
expect(commit_status.stage_entity).to eq stage
end
end
describe '#locking_enabled?' do
before do
commit_status.lock_version = 100
......
......@@ -22,7 +22,7 @@ describe Ci::RetryBuildService, :services do
%i[type lock_version target_url base_tags
commit_id deployments erased_by_id last_deployment project_id
runner_id tag_taggings taggings tags trigger_request_id
user_id auto_canceled_by_id retried stage_entity].freeze
user_id auto_canceled_by_id retried].freeze
shared_examples 'build duplication' do
let(:stage) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment