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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
bc5d649a
Commit
bc5d649a
authored
Oct 01, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unschedule action to status build
parent
7fc74818
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
app/serializers/build_action_entity.rb
app/serializers/build_action_entity.rb
+5
-1
lib/gitlab/ci/status/build/factory.rb
lib/gitlab/ci/status/build/factory.rb
+1
-0
lib/gitlab/ci/status/build/unschedule.rb
lib/gitlab/ci/status/build/unschedule.rb
+41
-0
No files found.
app/serializers/build_action_entity.rb
View file @
bc5d649a
...
...
@@ -12,7 +12,11 @@ class BuildActionEntity < Grape::Entity
end
expose
:playable?
,
as: :playable
expose
:scheduled_at
expose
:scheduled_at
,
if:
->
(
build
)
{
build
.
scheduled?
}
expose
:unschedule_path
,
if:
->
(
build
)
{
build
.
scheduled?
}
do
|
build
|
unschedule_project_job_path
(
build
.
project
,
build
)
end
private
...
...
lib/gitlab/ci/status/build/factory.rb
View file @
bc5d649a
...
...
@@ -15,6 +15,7 @@ module Gitlab
Status
::
Build
::
Retryable
],
[
Status
::
Build
::
Failed
],
[
Status
::
Build
::
FailedAllowed
,
Status
::
Build
::
Unschedule
,
Status
::
Build
::
Play
,
Status
::
Build
::
Stop
],
[
Status
::
Build
::
Action
],
...
...
lib/gitlab/ci/status/build/unschedule.rb
0 → 100644
View file @
bc5d649a
module
Gitlab
module
Ci
module
Status
module
Build
class
Unschedule
<
Status
::
Extended
def
label
'unschedule action'
end
def
has_action?
can?
(
user
,
:update_build
,
subject
)
end
def
action_icon
'time-out'
end
def
action_title
'Unschedule'
end
def
action_button_title
_
(
'Unschedule job'
)
end
def
action_path
unschedule_project_job_path
(
subject
.
project
,
subject
)
end
def
action_method
:post
end
def
self
.
matches?
(
build
,
user
)
build
.
scheduled?
end
end
end
end
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