Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a74184eb
Commit
a74184eb
authored
May 11, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix static analysys
parent
46fa3089
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
9 deletions
+9
-9
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
app/models/concerns/iid_routes.rb
app/models/concerns/iid_routes.rb
+1
-1
app/models/deployment.rb
app/models/deployment.rb
+1
-1
app/models/issue.rb
app/models/issue.rb
+1
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
app/models/milestone.rb
app/models/milestone.rb
+1
-1
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
+3
-3
No files found.
app/models/ci/pipeline.rb
View file @
a74184eb
...
@@ -15,7 +15,7 @@ module Ci
...
@@ -15,7 +15,7 @@ module Ci
belongs_to
:pipeline_schedule
,
class_name:
'Ci::PipelineSchedule'
belongs_to
:pipeline_schedule
,
class_name:
'Ci::PipelineSchedule'
has_internal_id
:iid
,
scope: :project
,
presence:
false
,
init:
->
(
s
)
do
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
end
has_many
:stages
has_many
:stages
...
...
app/models/concerns/iid_routes.rb
View file @
a74184eb
module
I
ID
Routes
module
I
id
Routes
##
##
# This automagically enforces all related routes to use `iid` instead of `id`
# 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,
# If you want to use `iid` for some routes and `id` for other routes, this module should not to be included,
...
...
app/models/deployment.rb
View file @
a74184eb
class
Deployment
<
ActiveRecord
::
Base
class
Deployment
<
ActiveRecord
::
Base
include
AtomicInternalId
include
AtomicInternalId
include
I
ID
Routes
include
I
id
Routes
belongs_to
:project
,
required:
true
belongs_to
:project
,
required:
true
belongs_to
:environment
,
required:
true
belongs_to
:environment
,
required:
true
...
...
app/models/issue.rb
View file @
a74184eb
...
@@ -2,7 +2,7 @@ require 'carrierwave/orm/activerecord'
...
@@ -2,7 +2,7 @@ require 'carrierwave/orm/activerecord'
class
Issue
<
ActiveRecord
::
Base
class
Issue
<
ActiveRecord
::
Base
include
AtomicInternalId
include
AtomicInternalId
include
I
ID
Routes
include
I
id
Routes
include
Issuable
include
Issuable
include
Noteable
include
Noteable
include
Referable
include
Referable
...
...
app/models/merge_request.rb
View file @
a74184eb
class
MergeRequest
<
ActiveRecord
::
Base
class
MergeRequest
<
ActiveRecord
::
Base
include
AtomicInternalId
include
AtomicInternalId
include
I
ID
Routes
include
I
id
Routes
include
Issuable
include
Issuable
include
Noteable
include
Noteable
include
Referable
include
Referable
...
...
app/models/milestone.rb
View file @
a74184eb
...
@@ -9,7 +9,7 @@ class Milestone < ActiveRecord::Base
...
@@ -9,7 +9,7 @@ class Milestone < ActiveRecord::Base
include
CacheMarkdownField
include
CacheMarkdownField
include
AtomicInternalId
include
AtomicInternalId
include
I
ID
Routes
include
I
id
Routes
include
Sortable
include
Sortable
include
Referable
include
Referable
include
StripAttribute
include
StripAttribute
...
...
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
View file @
a74184eb
...
@@ -41,13 +41,13 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
...
@@ -41,13 +41,13 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
it
'breaks the chain'
do
it
'breaks the chain'
do
expect
(
step
.
break?
).
to
be
true
expect
(
step
.
break?
).
to
be
true
end
end
it
'appends validation error'
do
it
'appends validation error'
do
expect
(
pipeline
.
errors
.
to_a
)
expect
(
pipeline
.
errors
.
to_a
)
.
to
include
/Failed to persist the pipeline/
.
to
include
/Failed to persist the pipeline/
end
end
end
end
context
'when ref is nil'
do
context
'when ref is nil'
do
let
(
:pipeline
)
do
let
(
:pipeline
)
do
build
(
:ci_pipeline
,
project:
project
,
ref:
nil
)
build
(
:ci_pipeline
,
project:
project
,
ref:
nil
)
...
@@ -64,7 +64,7 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
...
@@ -64,7 +64,7 @@ describe Gitlab::Ci::Pipeline::Chain::Create do
before
do
before
do
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ensure_project_iid!
)
{
|
p
|
p
.
send
(
:write_attribute
,
:iid
,
1
)
}
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ensure_project_iid!
)
{
|
p
|
p
.
send
(
:write_attribute
,
:iid
,
1
)
}
create
(
:ci_pipeline
,
project:
project
)
create
(
:ci_pipeline
,
project:
project
)
step
.
perform!
step
.
perform!
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment