Skip to content
Snippets Groups Projects
Commit a74184eb authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Fix static analysys

parent 46fa3089
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -15,7 +15,7 @@ module Ci
belongs_to :pipeline_schedule, class_name: 'Ci::PipelineSchedule'
 
has_internal_id :iid, scope: :project, presence: false, init: ->(s) do
s&.project&.pipelines&.maximum(:iid) || s&.project&.pipelines.count
s&.project&.pipelines&.maximum(:iid) || s&.project&.pipelines&.count
end
 
has_many :stages
Loading
Loading
module IIDRoutes
module IidRoutes
##
# This automagically enforces all related routes to use `iid` instead of `id`
# If you want to use `iid` for some routes and `id` for other routes, this module should not to be included,
Loading
Loading
class Deployment < ActiveRecord::Base
include AtomicInternalId
include IIDRoutes
include IidRoutes
 
belongs_to :project, required: true
belongs_to :environment, required: true
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@ require 'carrierwave/orm/activerecord'
 
class Issue < ActiveRecord::Base
include AtomicInternalId
include IIDRoutes
include IidRoutes
include Issuable
include Noteable
include Referable
Loading
Loading
class MergeRequest < ActiveRecord::Base
include AtomicInternalId
include IIDRoutes
include IidRoutes
include Issuable
include Noteable
include Referable
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ class Milestone < ActiveRecord::Base
 
include CacheMarkdownField
include AtomicInternalId
include IIDRoutes
include IidRoutes
include Sortable
include Referable
include StripAttribute
Loading
Loading
Loading
Loading
@@ -41,13 +41,13 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
it 'breaks the chain' do
expect(step.break?).to be true
end
it 'appends validation error' do
expect(pipeline.errors.to_a)
.to include /Failed to persist the pipeline/
end
end
context 'when ref is nil' do
let(:pipeline) do
build(:ci_pipeline, project: project, ref: nil)
Loading
Loading
@@ -64,7 +64,7 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
before do
allow_any_instance_of(Ci::Pipeline).to receive(:ensure_project_iid!) { |p| p.send(:write_attribute, :iid, 1) }
create(:ci_pipeline, project: project)
step.perform!
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment