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
7c365fd0
Commit
7c365fd0
authored
Apr 07, 2021
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move descriptions closer to enum
parent
4a434609
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
app/graphql/types/ci/pipeline_status_enum.rb
app/graphql/types/ci/pipeline_status_enum.rb
+1
-15
app/models/concerns/ci/has_status.rb
app/models/concerns/ci/has_status.rb
+13
-0
No files found.
app/graphql/types/ci/pipeline_status_enum.rb
View file @
7c365fd0
...
...
@@ -3,23 +3,9 @@
module
Types
module
Ci
class
PipelineStatusEnum
<
BaseEnum
descriptions
=
{
created:
'Pipeline has been created'
,
waiting_for_resource:
'A resource (for example, a runner) that the pipeline requires to run is unavailable'
,
preparing:
'Pipeline is preparing to run'
,
pending:
'Pipeline has not started running yet'
,
running:
'Pipeline is running'
,
failed:
'At least one stage of the pipeline failed'
,
success:
'Pipeline completed successfully'
,
canceled:
'Pipeline was canceled before completion'
,
skipped:
'Pipeline was skipped'
,
manual:
'Pipeline needs to be manually started'
,
scheduled:
'Pipeline is scheduled to run'
}
::
Ci
::
Pipeline
.
all_state_names
.
each
do
|
state_symbol
|
value
state_symbol
.
to_s
.
upcase
,
description:
descriptions
[
state_symbol
],
description:
::
Ci
::
Pipeline
::
STATUSES_DESCRIPTION
[
state_symbol
],
value:
state_symbol
.
to_s
end
end
...
...
app/models/concerns/ci/has_status.rb
View file @
7c365fd0
...
...
@@ -16,6 +16,19 @@ module Ci
STATUSES_ENUM
=
{
created:
0
,
pending:
1
,
running:
2
,
success:
3
,
failed:
4
,
canceled:
5
,
skipped:
6
,
manual:
7
,
scheduled:
8
,
preparing:
9
,
waiting_for_resource:
10
}.
freeze
STATUSES_DESCRIPTION
=
{
created:
'Pipeline has been created'
,
waiting_for_resource:
'A resource (for example, a runner) that the pipeline requires to run is unavailable'
,
preparing:
'Pipeline is preparing to run'
,
pending:
'Pipeline has not started running yet'
,
running:
'Pipeline is running'
,
failed:
'At least one stage of the pipeline failed'
,
success:
'Pipeline completed successfully'
,
canceled:
'Pipeline was canceled before completion'
,
skipped:
'Pipeline was skipped'
,
manual:
'Pipeline needs to be manually started'
,
scheduled:
'Pipeline is scheduled to run'
}.
freeze
UnknownStatusError
=
Class
.
new
(
StandardError
)
...
...
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