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
614ef82b
Commit
614ef82b
authored
Feb 14, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eager-load CE files first
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
3383cf0a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
27 deletions
+6
-27
app/services/issuable/clone/base_service.rb
app/services/issuable/clone/base_service.rb
+1
-7
config/application.rb
config/application.rb
+5
-2
ee/app/services/ee/issuable/clone/base_service.rb
ee/app/services/ee/issuable/clone/base_service.rb
+0
-16
ee/app/workers/ee/expire_pipeline_cache_worker.rb
ee/app/workers/ee/expire_pipeline_cache_worker.rb
+0
-2
No files found.
app/services/issuable/clone/base_service.rb
View file @
614ef82b
...
...
@@ -59,10 +59,4 @@ module Issuable
end
end
# In the case we are eager-loading, `ee/app/services/ee/issuable/clone/base_service.rb`
# is loaded first, and explicitely requires this file to avoid a
# "TypeError: superclass must be a Class (Module given)" error.
# That also means that we cannot perform the prepending in this file otherwise
# we'd get a circular dependency error, thus we perform the prepending in
# `ee/app/services/ee/issuable/clone/base_service.rb` in that case.
Issuable
::
Clone
::
BaseService
.
prepend
(
EE
::
Issuable
::
Clone
::
BaseService
)
unless
Rails
.
configuration
.
eager_load
Issuable
::
Clone
::
BaseService
.
prepend
(
EE
::
Issuable
::
Clone
::
BaseService
)
config/application.rb
View file @
614ef82b
...
...
@@ -54,11 +54,14 @@ module Gitlab
ee_path
=
config
.
root
.
join
(
'ee'
,
Pathname
.
new
(
path
).
relative_path_from
(
config
.
root
))
memo
<<
ee_path
.
to_s
if
ee_path
.
exist?
end
config
.
eager_load_paths
.
unshift
(
*
ee_paths
)
# Eager load should load CE first
config
.
eager_load_paths
.
push
(
*
ee_paths
)
config
.
helpers_paths
.
push
"
#{
config
.
root
}
/ee/app/helpers"
# Other than Ruby modules we load EE first
config
.
paths
[
'lib/tasks'
].
unshift
"
#{
config
.
root
}
/ee/lib/tasks"
config
.
paths
[
'app/views'
].
unshift
"
#{
config
.
root
}
/ee/app/views"
config
.
helpers_paths
.
unshift
"
#{
config
.
root
}
/ee/app/helpers"
## EE-specific paths config END
# Rake tasks ignore the eager loading settings, so we need to set the
...
...
ee/app/services/ee/issuable/clone/base_service.rb
View file @
614ef82b
# frozen_string_literal: true
# When this file is eager-loaded **before `issuable/clone/base_service.rb`**, the
# `Issuable::Clone::BaseService` constant is defined (in this file) as a module,
# making subsequent inheritance from `::Issuable::Clone::BaseService` (e.g. in
# `EE::IssuePromoteService`) failing with a "TypeError: superclass must be a
# Class (Module given)" error.
# Explicitely requiring `issuable/clone/base_service.rb` makes sure that the
# correct `::Issuable::Clone::BaseService` constant is defined first.
require_dependency
'issuable/clone/base_service'
if
Rails
.
configuration
.
eager_load
module
EE
module
Issuable
module
Clone
...
...
@@ -29,10 +20,3 @@ module EE
end
end
end
# When this file is eager-loaded, since we explicitely require
# `issuable/clone/base_service.rb` above, we cannot perform the prepend in
# `issuable/clone/base_service.rb` otherwise we'd get a circular dependency
# error. Thus we perform the prepend in this file, after
# `Issuable::Clone::BaseService` and `EE::Issuable::Clone::BaseService` are defined.
Issuable
::
Clone
::
BaseService
.
prepend
(
EE
::
Issuable
::
Clone
::
BaseService
)
if
Rails
.
configuration
.
eager_load
ee/app/workers/ee/expire_pipeline_cache_worker.rb
View file @
614ef82b
...
...
@@ -18,5 +18,3 @@ module EE
end
end
end
ExpirePipelineCacheWorker
.
prepend
(
EE
::
ExpirePipelineCacheWorker
)
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