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
0c9ad482
Commit
0c9ad482
authored
6 years ago
by
Shinya Maeda
Committed by
Kamil Trzciński
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support backward compatibility when introduce new failure reason
parent
2bbfca82
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
3 deletions
+16
-3
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
changelogs/unreleased/avoid-lock-when-introduce-new-failure-reason.yml
...released/avoid-lock-when-introduce-new-failure-reason.yml
+5
-0
lib/api/runner.rb
lib/api/runner.rb
+1
-2
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+9
-0
No files found.
app/models/commit_status.rb
View file @
0c9ad482
...
@@ -109,7 +109,7 @@ class CommitStatus < ActiveRecord::Base
...
@@ -109,7 +109,7 @@ class CommitStatus < ActiveRecord::Base
before_transition
any
=>
:failed
do
|
commit_status
,
transition
|
before_transition
any
=>
:failed
do
|
commit_status
,
transition
|
failure_reason
=
transition
.
args
.
first
failure_reason
=
transition
.
args
.
first
commit_status
.
failure_reason
=
failure_reason
commit_status
.
failure_reason
=
CommitStatus
.
failure_reasons
[
failure_reason
]
end
end
after_transition
do
|
commit_status
,
transition
|
after_transition
do
|
commit_status
,
transition
|
...
...
This diff is collapsed.
Click to expand it.
changelogs/unreleased/avoid-lock-when-introduce-new-failure-reason.yml
0 → 100644
View file @
0c9ad482
---
title
:
Support backward compatibility when introduce new failure reason
merge_request
:
22566
author
:
type
:
changed
This diff is collapsed.
Click to expand it.
lib/api/runner.rb
View file @
0c9ad482
...
@@ -142,8 +142,7 @@ module API
...
@@ -142,8 +142,7 @@ module API
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
requires
:id
,
type:
Integer
,
desc:
%q(Job's ID)
optional
:trace
,
type:
String
,
desc:
%q(Job's full trace)
optional
:trace
,
type:
String
,
desc:
%q(Job's full trace)
optional
:state
,
type:
String
,
desc:
%q(Job's status: success, failed)
optional
:state
,
type:
String
,
desc:
%q(Job's status: success, failed)
optional
:failure_reason
,
type:
String
,
values:
CommitStatus
.
failure_reasons
.
keys
,
optional
:failure_reason
,
type:
String
,
desc:
%q(Job's failure_reason)
desc:
%q(Job's failure_reason)
end
end
put
'/:id'
do
put
'/:id'
do
job
=
authenticate_job!
job
=
authenticate_job!
...
...
This diff is collapsed.
Click to expand it.
spec/requests/api/runner_spec.rb
View file @
0c9ad482
...
@@ -797,6 +797,15 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
...
@@ -797,6 +797,15 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
it
{
expect
(
job
).
to
be_runner_system_failure
}
it
{
expect
(
job
).
to
be_runner_system_failure
}
end
end
context
'when failure_reason is unrecognized value'
do
before
do
update_job
(
state:
'failed'
,
failure_reason:
'what_is_this'
)
job
.
reload
end
it
{
expect
(
job
).
to
be_unknown_failure
}
end
end
end
context
'when trace is given'
do
context
'when trace is given'
do
...
...
This diff is collapsed.
Click to expand it.
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