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
40a314b8
Commit
40a314b8
authored
Jul 28, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move CommitStatusEnums to Enums::CommitStatus
Move enum related modules into a separate directory
parent
2766226a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
52 deletions
+56
-52
app/models/commit_status.rb
app/models/commit_status.rb
+2
-2
app/models/commit_status_enums.rb
app/models/commit_status_enums.rb
+0
-32
app/models/concerns/enums/commit_status.rb
app/models/concerns/enums/commit_status.rb
+34
-0
ee/app/models/concerns/ee/enums/commit_status.rb
ee/app/models/concerns/ee/enums/commit_status.rb
+20
-0
ee/app/models/ee/commit_status_enums.rb
ee/app/models/ee/commit_status_enums.rb
+0
-18
No files found.
app/models/commit_status.rb
View file @
40a314b8
...
@@ -77,9 +77,9 @@ class CommitStatus < ApplicationRecord
...
@@ -77,9 +77,9 @@ class CommitStatus < ApplicationRecord
merge
(
or_conditions
)
merge
(
or_conditions
)
end
end
# We use `
CommitStatusEnum
s.failure_reasons` here so that EE can more easily
# We use `
Enums::CommitStatu
s.failure_reasons` here so that EE can more easily
# extend this `Hash` with new values.
# extend this `Hash` with new values.
enum_with_nil
failure_reason:
::
CommitStatusEnum
s
.
failure_reasons
enum_with_nil
failure_reason:
Enums
::
CommitStatu
s
.
failure_reasons
##
##
# We still create some CommitStatuses outside of CreatePipelineService.
# We still create some CommitStatuses outside of CreatePipelineService.
...
...
app/models/commit_status_enums.rb
deleted
100644 → 0
View file @
2766226a
# frozen_string_literal: true
module
CommitStatusEnums
# Returns the Hash to use for creating the `failure_reason` enum for
# `CommitStatus`.
def
self
.
failure_reasons
{
unknown_failure:
nil
,
script_failure:
1
,
api_failure:
2
,
stuck_or_timeout_failure:
3
,
runner_system_failure:
4
,
missing_dependency_failure:
5
,
runner_unsupported:
6
,
stale_schedule:
7
,
job_execution_timeout:
8
,
archived_failure:
9
,
unmet_prerequisites:
10
,
scheduler_failure:
11
,
data_integrity_failure:
12
,
forward_deployment_failure:
13
,
insufficient_bridge_permissions:
1_001
,
downstream_bridge_project_not_found:
1_002
,
invalid_bridge_trigger:
1_003
,
bridge_pipeline_is_child_pipeline:
1_006
,
downstream_pipeline_creation_failed:
1_007
,
secrets_provider_not_found:
1_008
}
end
end
CommitStatusEnums
.
prepend_if_ee
(
'EE::CommitStatusEnums'
)
app/models/concerns/enums/commit_status.rb
0 → 100644
View file @
40a314b8
# frozen_string_literal: true
module
Enums
module
CommitStatus
# Returns the Hash to use for creating the `failure_reason` enum for
# `CommitStatus`.
def
self
.
failure_reasons
{
unknown_failure:
nil
,
script_failure:
1
,
api_failure:
2
,
stuck_or_timeout_failure:
3
,
runner_system_failure:
4
,
missing_dependency_failure:
5
,
runner_unsupported:
6
,
stale_schedule:
7
,
job_execution_timeout:
8
,
archived_failure:
9
,
unmet_prerequisites:
10
,
scheduler_failure:
11
,
data_integrity_failure:
12
,
forward_deployment_failure:
13
,
insufficient_bridge_permissions:
1_001
,
downstream_bridge_project_not_found:
1_002
,
invalid_bridge_trigger:
1_003
,
bridge_pipeline_is_child_pipeline:
1_006
,
downstream_pipeline_creation_failed:
1_007
,
secrets_provider_not_found:
1_008
}
end
end
end
Enums
::
CommitStatus
.
prepend_if_ee
(
'EE::Enums::CommitStatus'
)
ee/app/models/concerns/ee/enums/commit_status.rb
0 → 100644
View file @
40a314b8
# frozen_string_literal: true
module
EE
module
Enums
module
CommitStatus
extend
ActiveSupport
::
Concern
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
override
:failure_reasons
def
failure_reasons
super
.
merge
(
protected_environment_failure:
1_000
,
upstream_bridge_project_not_found:
1_004
,
insufficient_upstream_permissions:
1_005
)
end
end
end
end
end
ee/app/models/ee/commit_status_enums.rb
deleted
100644 → 0
View file @
2766226a
# frozen_string_literal: true
module
EE
module
CommitStatusEnums
extend
ActiveSupport
::
Concern
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
override
:failure_reasons
def
failure_reasons
super
.
merge
(
protected_environment_failure:
1_000
,
upstream_bridge_project_not_found:
1_004
,
insufficient_upstream_permissions:
1_005
)
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