summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-04 13:36:03 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-04 13:36:03 +0000
commit39b0e286bcf1239424eed8e0dac118a9f4f4b6ac (patch)
tree3cee07417e86b487913af6dd0d2084da31fa3f1c /lib
parent9fc4650da6efa808960b28f9e77fede55424d77e (diff)
downloadgitlab-ce-39b0e286bcf1239424eed8e0dac118a9f4f4b6ac.tar.gz
Add latest changes from gitlab-org/gitlab@12-4-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/ansi2html.rb4
-rw-r--r--lib/gitlab/gitaly_client.rb10
-rw-r--r--lib/gitlab/gitaly_client/remote_service.rb2
-rw-r--r--lib/gitlab/import_export/relation_factory.rb8
-rw-r--r--lib/gitlab/metrics/requests_rack_middleware.rb2
5 files changed, 16 insertions, 10 deletions
diff --git a/lib/gitlab/ci/ansi2html.rb b/lib/gitlab/ci/ansi2html.rb
index eb5d78ebcd4..a737d5543ad 100644
--- a/lib/gitlab/ci/ansi2html.rb
+++ b/lib/gitlab/ci/ansi2html.rb
@@ -220,7 +220,7 @@ module Gitlab
return if @sections.include?(section)
@sections << section
- write_raw %{<div class="js-section-start section-start fa fa-caret-down pr-2 cursor-pointer" data-timestamp="#{timestamp}" data-section="#{data_section_names}" role="button"></div>}
+ write_raw %{<div class="section-start" data-timestamp="#{timestamp}" data-section="#{data_section_names}" role="button"></div>}
@lineno_in_section = 0
end
@@ -308,7 +308,7 @@ module Gitlab
css_classes << "section"
css_classes << if @lineno_in_section == 0
- "js-section-header section-header cursor-pointer"
+ "section-header"
else
"line"
end
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index b0f29d22ad4..be695e7e91a 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -362,13 +362,17 @@ module Gitlab
end
def self.long_timeout
- if Sidekiq.server?
- 6.hours
- else
+ if web_app_server?
default_timeout
+ else
+ 6.hours
end
end
+ def self.web_app_server?
+ defined?(::Unicorn) || defined?(::Puma)
+ end
+
def self.storage_metadata_file_path(storage)
Gitlab::GitalyClient::StorageSettings.allow_disk_access do
File.join(
diff --git a/lib/gitlab/gitaly_client/remote_service.rb b/lib/gitlab/gitaly_client/remote_service.rb
index d01a29e1a05..0e95b0ef469 100644
--- a/lib/gitlab/gitaly_client/remote_service.rb
+++ b/lib/gitlab/gitaly_client/remote_service.rb
@@ -49,7 +49,7 @@ module Gitlab
response = GitalyClient.call(@storage, :remote_service,
:fetch_internal_remote, request,
- timeout: GitalyClient.medium_timeout,
+ timeout: GitalyClient.long_timeout,
remote_storage: repository.storage)
response.result
diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb
index cb85af91f75..ae8025c52ef 100644
--- a/lib/gitlab/import_export/relation_factory.rb
+++ b/lib/gitlab/import_export/relation_factory.rb
@@ -292,9 +292,11 @@ module Gitlab
existing_object
else
- object = relation_class.new
-
- # Use #assign_attributes here to call object custom setters
+ # Because of single-type inheritance, we need to be careful to use the `type` field
+ # See https://gitlab.com/gitlab-org/gitlab/issues/34860#note_235321497
+ inheritance_column = relation_class.try(:inheritance_column)
+ inheritance_attributes = parsed_relation_hash.slice(inheritance_column)
+ object = relation_class.new(inheritance_attributes)
object.assign_attributes(parsed_relation_hash)
object
end
diff --git a/lib/gitlab/metrics/requests_rack_middleware.rb b/lib/gitlab/metrics/requests_rack_middleware.rb
index 46477587934..085e28123a7 100644
--- a/lib/gitlab/metrics/requests_rack_middleware.rb
+++ b/lib/gitlab/metrics/requests_rack_middleware.rb
@@ -35,7 +35,7 @@ module Gitlab
def self.initialize_http_request_duration_seconds
HTTP_METHODS.each do |method, statuses|
statuses.each do |status|
- http_request_duration_seconds.get({ method: method, status: status })
+ http_request_duration_seconds.get({ method: method, status: status.to_i })
end
end
end