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
8657d5dd
Commit
8657d5dd
authored
Jul 24, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not implement CI/CD job to stage association yet
parent
d3814ad6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
24 deletions
+5
-24
app/models/commit_status.rb
app/models/commit_status.rb
+4
-11
spec/models/commit_status_spec.rb
spec/models/commit_status_spec.rb
+0
-12
spec/services/ci/retry_build_service_spec.rb
spec/services/ci/retry_build_service_spec.rb
+1
-1
No files found.
app/models/commit_status.rb
View file @
8657d5dd
...
...
@@ -38,22 +38,15 @@ class CommitStatus < ActiveRecord::Base
scope
:retried_ordered
,
->
{
retried
.
ordered
.
includes
(
project: :namespace
)
}
scope
:after_stage
,
->
(
index
)
{
where
(
'stage_idx > ?'
,
index
)
}
##
# TODO, we will change this to `belongs_to :stage` when we phase out
# `ci_builds.stage` attribute and migrate `ci_builds.stage_id` reference in
# one of upcoming releases.
#
belongs_to
:stage_entity
,
foreign_key: :stage_id
,
class_name:
'Ci::Stage'
state_machine
:status
do
event
:enqueue
do
transition
[
:created
,
:skipped
,
:manual
]
=>
:pending
end
event
:process
do
transition
[
:skipped
,
:manual
]
=>
:created
end
event
:enqueue
do
transition
[
:created
,
:skipped
,
:manual
]
=>
:pending
end
event
:run
do
transition
pending: :running
end
...
...
spec/models/commit_status_spec.rb
View file @
8657d5dd
...
...
@@ -408,18 +408,6 @@ describe CommitStatus, :models do
end
end
describe
'#stage_entity'
do
let
(
:stage
)
{
create
(
:ci_stage_entity
)
}
let
(
:commit_status
)
do
create
(
:commit_status
,
stage_id:
stage
.
id
)
end
it
'has a correct association with persisted stage'
do
expect
(
commit_status
.
stage_entity
).
to
eq
stage
end
end
describe
'#locking_enabled?'
do
before
do
commit_status
.
lock_version
=
100
...
...
spec/services/ci/retry_build_service_spec.rb
View file @
8657d5dd
...
...
@@ -22,7 +22,7 @@ describe Ci::RetryBuildService, :services do
%i[type lock_version target_url base_tags
commit_id deployments erased_by_id last_deployment project_id
runner_id tag_taggings taggings tags trigger_request_id
user_id auto_canceled_by_id retried
stage_entity
]
.
freeze
user_id auto_canceled_by_id retried]
.
freeze
shared_examples
'build duplication'
do
let
(
:stage
)
do
...
...
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