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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
78b2f65c
Commit
78b2f65c
authored
Jun 01, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `Ci::Stage` class to `Ci::LegacyStage`
parent
c00d72b6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
+9
-7
app/models/ci/legacy_stage.rb
app/models/ci/legacy_stage.rb
+1
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+2
-2
spec/factories/ci/stages.rb
spec/factories/ci/stages.rb
+4
-2
spec/models/ci/legacy_stage_spec.rb
spec/models/ci/legacy_stage_spec.rb
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+1
-1
No files found.
app/models/ci/stage.rb
→
app/models/ci/
legacy_
stage.rb
View file @
78b2f65c
module
Ci
module
Ci
# Currently this is artificial object, constructed dynamically
# Currently this is artificial object, constructed dynamically
# We should migrate this object to actual database record in the future
# We should migrate this object to actual database record in the future
class
Stage
class
Legacy
Stage
include
StaticModel
include
StaticModel
attr_reader
:pipeline
,
:name
attr_reader
:pipeline
,
:name
...
...
app/models/ci/pipeline.rb
View file @
78b2f65c
...
@@ -161,7 +161,7 @@ module Ci
...
@@ -161,7 +161,7 @@ module Ci
end
end
def
legacy_stage
(
name
)
def
legacy_stage
(
name
)
stage
=
Ci
::
Stage
.
new
(
self
,
name:
name
)
stage
=
Ci
::
Legacy
Stage
.
new
(
self
,
name:
name
)
stage
unless
stage
.
statuses_count
.
zero?
stage
unless
stage
.
statuses_count
.
zero?
end
end
...
@@ -180,7 +180,7 @@ module Ci
...
@@ -180,7 +180,7 @@ module Ci
.
pluck
(
'sg.stage'
,
status_sql
,
"(
#{
warnings_sql
}
)"
)
.
pluck
(
'sg.stage'
,
status_sql
,
"(
#{
warnings_sql
}
)"
)
stages_with_statuses
.
map
do
|
stage
|
stages_with_statuses
.
map
do
|
stage
|
Ci
::
Stage
.
new
(
self
,
Hash
[
%i[name status warnings]
.
zip
(
stage
)])
Ci
::
Legacy
Stage
.
new
(
self
,
Hash
[
%i[name status warnings]
.
zip
(
stage
)])
end
end
end
end
...
...
spec/factories/ci/stages.rb
View file @
78b2f65c
FactoryGirl
.
define
do
FactoryGirl
.
define
do
factory
:ci_stage
,
class:
Ci
::
Stage
do
factory
:ci_stage
,
class:
Ci
::
Legacy
Stage
do
transient
do
transient
do
name
'test'
name
'test'
status
nil
status
nil
...
@@ -8,7 +8,9 @@ FactoryGirl.define do
...
@@ -8,7 +8,9 @@ FactoryGirl.define do
end
end
initialize_with
do
initialize_with
do
Ci
::
Stage
.
new
(
pipeline
,
name:
name
,
status:
status
,
warnings:
warnings
)
Ci
::
LegacyStage
.
new
(
pipeline
,
name:
name
,
status:
status
,
warnings:
warnings
)
end
end
end
end
end
end
spec/models/ci/stage_spec.rb
→
spec/models/ci/
legacy_
stage_spec.rb
View file @
78b2f65c
require
'spec_helper'
require
'spec_helper'
describe
Ci
::
Stage
,
models:
true
do
describe
Ci
::
LegacyStage
,
:models
do
let
(
:stage
)
{
build
(
:ci_stage
)
}
let
(
:stage
)
{
build
(
:ci_stage
)
}
let
(
:pipeline
)
{
stage
.
pipeline
}
let
(
:pipeline
)
{
stage
.
pipeline
}
let
(
:stage_name
)
{
stage
.
name
}
let
(
:stage_name
)
{
stage
.
name
}
...
...
spec/models/ci/pipeline_spec.rb
View file @
78b2f65c
...
@@ -292,7 +292,7 @@ describe Ci::Pipeline, models: true do
...
@@ -292,7 +292,7 @@ describe Ci::Pipeline, models: true do
create
(
:commit_status
,
pipeline:
pipeline
,
stage:
'test'
)
create
(
:commit_status
,
pipeline:
pipeline
,
stage:
'test'
)
end
end
it
{
expect
(
subject
).
to
be_a
Ci
::
Stage
}
it
{
expect
(
subject
).
to
be_a
Ci
::
Legacy
Stage
}
it
{
expect
(
subject
.
name
).
to
eq
'test'
}
it
{
expect
(
subject
.
name
).
to
eq
'test'
}
it
{
expect
(
subject
.
statuses
).
not_to
be_empty
}
it
{
expect
(
subject
.
statuses
).
not_to
be_empty
}
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