BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
+9
-7
legacy_stage.rb
app/models/ci/legacy_stage.rb
+1
-1
pipeline.rb
app/models/ci/pipeline.rb
+2
-2
stages.rb
spec/factories/ci/stages.rb
+4
-2
legacy_stage_spec.rb
spec/models/ci/legacy_stage_spec.rb
+1
-1
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
# Currently this is artificial object, constructed dynamically
# We should migrate this object to actual database record in the future
class
Stage
class
Legacy
Stage
include
StaticModel
attr_reader
:pipeline
,
:name
...
...
app/models/ci/pipeline.rb
View file @
78b2f65c
...
...
@@ -161,7 +161,7 @@ module Ci
end
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?
end
...
...
@@ -180,7 +180,7 @@ module Ci
.
pluck
(
'sg.stage'
,
status_sql
,
"(
#{
warnings_sql
}
)"
)
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
...
...
spec/factories/ci/stages.rb
View file @
78b2f65c
FactoryGirl
.
define
do
factory
:ci_stage
,
class:
Ci
::
Stage
do
factory
:ci_stage
,
class:
Ci
::
Legacy
Stage
do
transient
do
name
'test'
status
nil
...
...
@@ -8,7 +8,9 @@ FactoryGirl.define do
end
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
spec/models/ci/stage_spec.rb
→
spec/models/ci/
legacy_
stage_spec.rb
View file @
78b2f65c
require
'spec_helper'
describe
Ci
::
Stage
,
models:
true
do
describe
Ci
::
LegacyStage
,
:models
do
let
(
:stage
)
{
build
(
:ci_stage
)
}
let
(
:pipeline
)
{
stage
.
pipeline
}
let
(
:stage_name
)
{
stage
.
name
}
...
...
spec/models/ci/pipeline_spec.rb
View file @
78b2f65c
...
...
@@ -292,7 +292,7 @@ describe Ci::Pipeline, models: true do
create
(
:commit_status
,
pipeline:
pipeline
,
stage:
'test'
)
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
.
statuses
).
not_to
be_empty
}
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