summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/import_export/import_export.yml1
-rw-r--r--lib/gitlab/usage_data.rb1
-rw-r--r--lib/gitlab/webpack/dev_server_middleware.rb (renamed from lib/gitlab/middleware/webpack_proxy.rb)4
-rw-r--r--lib/gitlab/webpack/manifest.rb27
4 files changed, 31 insertions, 2 deletions
diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml
index 0d1c4f73c6e..21ac7f7e0b6 100644
--- a/lib/gitlab/import_export/import_export.yml
+++ b/lib/gitlab/import_export/import_export.yml
@@ -106,6 +106,7 @@ excluded_attributes:
- :last_repository_updated_at
- :last_repository_check_at
- :storage_version
+ - :remote_mirror_available_overridden
- :description_html
snippets:
- :expired_at
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 8c0a4d55ea2..e294f3c4ebc 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -71,6 +71,7 @@ module Gitlab
projects_imported_from_github: Project.where(import_type: 'github').count,
protected_branches: ProtectedBranch.count,
releases: Release.count,
+ remote_mirrors: RemoteMirror.count,
snippets: Snippet.count,
todos: Todo.count,
uploads: Upload.count,
diff --git a/lib/gitlab/middleware/webpack_proxy.rb b/lib/gitlab/webpack/dev_server_middleware.rb
index 6aecf63231f..b9a75eaac63 100644
--- a/lib/gitlab/middleware/webpack_proxy.rb
+++ b/lib/gitlab/webpack/dev_server_middleware.rb
@@ -3,8 +3,8 @@
# :nocov:
module Gitlab
- module Middleware
- class WebpackProxy < Rack::Proxy
+ module Webpack
+ class DevServerMiddleware < Rack::Proxy
def initialize(app = nil, opts = {})
@proxy_host = opts.fetch(:proxy_host, 'localhost')
@proxy_port = opts.fetch(:proxy_port, 3808)
diff --git a/lib/gitlab/webpack/manifest.rb b/lib/gitlab/webpack/manifest.rb
new file mode 100644
index 00000000000..0c343e5bc1d
--- /dev/null
+++ b/lib/gitlab/webpack/manifest.rb
@@ -0,0 +1,27 @@
+require 'webpack/rails/manifest'
+
+module Gitlab
+ module Webpack
+ class Manifest < ::Webpack::Rails::Manifest
+ # Raised if a supplied asset does not exist in the webpack manifest
+ AssetMissingError = Class.new(StandardError)
+
+ class << self
+ def entrypoint_paths(source)
+ raise ::Webpack::Rails::Manifest::WebpackError, manifest["errors"] unless manifest_bundled?
+
+ entrypoint = manifest["entrypoints"][source]
+ if entrypoint && entrypoint["assets"]
+ # Can be either a string or an array of strings.
+ # Do not include source maps as they are not javascript
+ [entrypoint["assets"]].flatten.reject { |p| p =~ /.*\.map$/ }.map do |p|
+ "/#{::Rails.configuration.webpack.public_path}/#{p}"
+ end
+ else
+ raise AssetMissingError, "Can't find entry point '#{source}' in webpack manifest"
+ end
+ end
+ end
+ end
+ end
+end