Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-03 18:08:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-03 18:08:33 +0300
commit511e761b41b81484c85e3d125f45873ce38e9201 (patch)
tree6bb98a6356de6e1d736951d2eef6ec83e6aa3dd2 /app
parent4247e67be1faa9d52691757dad954a7fa63e8bfe (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb9
-rw-r--r--app/services/ci/find_exposed_artifacts_service.rb2
2 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index f5306801c04..60b5d9b6da8 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -33,6 +33,7 @@ class ApplicationController < ActionController::Base
before_action :check_impersonation_availability
before_action :required_signup_info
+ around_action :set_current_context
around_action :set_locale
around_action :set_session_storage
@@ -448,6 +449,14 @@ class ApplicationController < ActionController::Base
request.base_url
end
+ def set_current_context(&block)
+ Gitlab::ApplicationContext.with_context(
+ user: -> { auth_user },
+ project: -> { @project },
+ namespace: -> { @group },
+ &block)
+ end
+
def set_locale(&block)
Gitlab::I18n.with_user_locale(current_user, &block)
end
diff --git a/app/services/ci/find_exposed_artifacts_service.rb b/app/services/ci/find_exposed_artifacts_service.rb
index 5c75af294bf..d268252577f 100644
--- a/app/services/ci/find_exposed_artifacts_service.rb
+++ b/app/services/ci/find_exposed_artifacts_service.rb
@@ -46,6 +46,8 @@ module Ci
# it could contain many. We only need to know whether it has 1 or more
# artifacts, so fetching the first 2 would be sufficient.
def first_2_metadata_entries_for_artifacts_paths(job)
+ return [] unless job.artifacts_metadata
+
job.artifacts_paths
.lazy
.map { |path| job.artifacts_metadata_entry(path, recursive: true) }