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
Léo-Paul Géneau
gitlab-ce
Commits
4d5f7aa0
Commit
4d5f7aa0
authored
Jun 03, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more places where we should rename ci_commit to pipeline
parent
bcd009e6
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
18 deletions
+18
-18
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
app/models/ci/trigger_request.rb
app/models/ci/trigger_request.rb
+1
-1
spec/models/build_spec.rb
spec/models/build_spec.rb
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+1
-1
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+5
-5
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+6
-6
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb
.../merge_requests/merge_when_build_succeeds_service_spec.rb
+2
-2
No files found.
app/models/ci/pipeline.rb
View file @
4d5f7aa0
...
...
@@ -8,7 +8,7 @@ module Ci
belongs_to
:project
,
class_name:
'::Project'
,
foreign_key: :gl_project_id
has_many
:statuses
,
class_name:
'CommitStatus'
,
foreign_key: :commit_id
has_many
:builds
,
class_name:
'Ci::Build'
,
foreign_key: :commit_id
has_many
:trigger_requests
,
dependent: :destroy
,
class_name:
'Ci::TriggerRequest'
has_many
:trigger_requests
,
dependent: :destroy
,
class_name:
'Ci::TriggerRequest'
,
foreign_key: :commit_id
validates_presence_of
:sha
validates_presence_of
:status
...
...
app/models/ci/trigger_request.rb
View file @
4d5f7aa0
...
...
@@ -3,7 +3,7 @@ module Ci
extend
Ci
::
Model
belongs_to
:trigger
,
class_name:
'Ci::Trigger'
belongs_to
:commit
,
class_name:
'Ci::Pipeline'
belongs_to
:commit
,
class_name:
'Ci::Pipeline'
,
foreign_key: :commit_id
has_many
:builds
,
class_name:
'Ci::Build'
serialize
:variables
...
...
spec/models/build_spec.rb
View file @
4d5f7aa0
...
...
@@ -219,7 +219,7 @@ describe Ci::Build, models: true do
context
'and trigger variables'
do
let
(
:trigger
)
{
create
(
:ci_trigger
,
project:
project
)
}
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
pipeline
:
commit
,
trigger:
trigger
)
}
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
commit
:
commit
,
trigger:
trigger
)
}
let
(
:trigger_variables
)
do
[
{
key: :TRIGGER_KEY
,
value:
'TRIGGER_VALUE'
,
public:
false
}
...
...
spec/models/ci/
commit
_spec.rb
→
spec/models/ci/
pipeline
_spec.rb
View file @
4d5f7aa0
...
...
@@ -334,7 +334,7 @@ describe Ci::Pipeline, models: true do
describe
'#stages'
do
let
(
:commit2
)
{
FactoryGirl
.
create
:ci_commit
,
project:
project
}
subject
{
CommitStatus
.
where
(
commit
:
[
commit
,
commit2
]).
stages
}
subject
{
CommitStatus
.
where
(
pipeline
:
[
commit
,
commit2
]).
stages
}
before
do
FactoryGirl
.
create
:ci_build
,
pipeline:
commit2
,
stage:
'test'
,
stage_idx:
1
...
...
spec/models/commit_status_spec.rb
View file @
4d5f7aa0
...
...
@@ -4,15 +4,15 @@ describe CommitStatus, models: true do
let
(
:commit
)
{
FactoryGirl
.
create
:ci_commit
}
let
(
:commit_status
)
{
FactoryGirl
.
create
:commit_status
,
pipeline:
commit
}
it
{
is_expected
.
to
belong_to
(
:
commit
)
}
it
{
is_expected
.
to
belong_to
(
:
pipeline
)
}
it
{
is_expected
.
to
belong_to
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:project
)
}
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_inclusion_of
(
:status
).
in_array
(
%w(pending running failed success canceled)
)
}
it
{
is_expected
.
to
delegate_method
(
:sha
).
to
(
:
commit
)
}
it
{
is_expected
.
to
delegate_method
(
:short_sha
).
to
(
:
commit
)
}
it
{
is_expected
.
to
delegate_method
(
:sha
).
to
(
:
pipeline
)
}
it
{
is_expected
.
to
delegate_method
(
:short_sha
).
to
(
:
pipeline
)
}
it
{
is_expected
.
to
respond_to
:success?
}
it
{
is_expected
.
to
respond_to
:failed?
}
...
...
@@ -179,7 +179,7 @@ describe CommitStatus, models: true do
end
context
'stages list'
do
subject
{
CommitStatus
.
where
(
commit
:
commit
).
stages
}
subject
{
CommitStatus
.
where
(
pipeline
:
commit
).
stages
}
it
'return ordered list of stages'
do
is_expected
.
to
eq
(
%w(build test deploy)
)
...
...
@@ -187,7 +187,7 @@ describe CommitStatus, models: true do
end
context
'stages with statuses'
do
subject
{
CommitStatus
.
where
(
commit
:
commit
).
stages_status
}
subject
{
CommitStatus
.
where
(
pipeline
:
commit
).
stages_status
}
it
'return list of stages with statuses'
do
is_expected
.
to
eq
({
...
...
spec/models/merge_request_spec.rb
View file @
4d5f7aa0
...
...
@@ -390,19 +390,19 @@ describe MergeRequest, models: true do
subject
{
create
:merge_request
,
:simple
}
end
describe
'#
ci_commit
'
do
describe
'#
pipeline
'
do
describe
'when the source project exists'
do
it
'returns the latest commit'
do
commit
=
double
(
:commit
,
id:
'123abc'
)
ci_commit
=
double
(
:ci_commit
,
ref:
'master'
)
pipeline
=
double
(
:ci_commit
,
ref:
'master'
)
allow
(
subject
).
to
receive
(
:last_commit
).
and_return
(
commit
)
expect
(
subject
.
source_project
).
to
receive
(
:
ci_commit
).
expect
(
subject
.
source_project
).
to
receive
(
:
pipeline
).
with
(
'123abc'
,
'master'
).
and_return
(
ci_commit
)
and_return
(
pipeline
)
expect
(
subject
.
pipeline
).
to
eq
(
ci_commit
)
expect
(
subject
.
pipeline
).
to
eq
(
pipeline
)
end
end
...
...
spec/models/project_spec.rb
View file @
4d5f7aa0
...
...
@@ -22,7 +22,7 @@ describe Project, models: true do
it
{
is_expected
.
to
have_one
(
:pushover_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_one
(
:asana_service
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_many
(
:commit_statuses
)
}
it
{
is_expected
.
to
have_many
(
:
ci_commit
s
)
}
it
{
is_expected
.
to
have_many
(
:
pipeline
s
)
}
it
{
is_expected
.
to
have_many
(
:builds
)
}
it
{
is_expected
.
to
have_many
(
:runner_projects
)
}
it
{
is_expected
.
to
have_many
(
:runners
)
}
...
...
spec/services/merge_requests/merge_when_build_succeeds_service_spec.rb
View file @
4d5f7aa0
...
...
@@ -110,8 +110,8 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
context
'properly handles multiple stages'
do
let
(
:ref
)
{
mr_merge_if_green_enabled
.
source_branch
}
let
(
:build
)
{
create
(
:ci_build
,
commit
:
ci_commit
,
ref:
ref
,
name:
'build'
,
stage:
'build'
)
}
let
(
:test
)
{
create
(
:ci_build
,
commit
:
ci_commit
,
ref:
ref
,
name:
'test'
,
stage:
'test'
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline
:
ci_commit
,
ref:
ref
,
name:
'build'
,
stage:
'build'
)
}
let
(
:test
)
{
create
(
:ci_build
,
pipeline
:
ci_commit
,
ref:
ref
,
name:
'test'
,
stage:
'test'
)
}
before
do
# This behavior of MergeRequest: we instantiate a new object
...
...
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