summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-26 15:08:56 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-26 15:08:56 +0000
commit17ab40ca089e1aef61a83f77ab6df62a72f6ce06 (patch)
tree8eb149293eee90ec2750b6ac5e46a111a806424e /lib
parent66d4203791a01fdedf668a78818a229ea2c07aad (diff)
downloadgitlab-ce-17ab40ca089e1aef61a83f77ab6df62a72f6ce06.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/runner.rb6
-rw-r--r--lib/gitlab/markdown_cache.rb2
-rw-r--r--lib/gitlab/reactive_cache_set_cache.rb8
-rw-r--r--lib/gitlab/tree_summary.rb2
4 files changed, 12 insertions, 6 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index e1c79aa8efe..0b6bad6708b 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -283,10 +283,12 @@ module API
bad_request!('Missing artifacts file!') unless artifacts
file_too_large! unless artifacts.size < max_artifacts_size(job)
- if Ci::CreateJobArtifactsService.new.execute(job, artifacts, params, metadata_file: metadata)
+ result = Ci::CreateJobArtifactsService.new(job.project).execute(job, artifacts, params, metadata_file: metadata)
+
+ if result[:status] == :success
status :created
else
- render_validation_error!(job)
+ render_api_error!(result[:message], result[:http_status])
end
end
diff --git a/lib/gitlab/markdown_cache.rb b/lib/gitlab/markdown_cache.rb
index 473c7203ead..d7a0a9b6518 100644
--- a/lib/gitlab/markdown_cache.rb
+++ b/lib/gitlab/markdown_cache.rb
@@ -3,7 +3,7 @@
module Gitlab
module MarkdownCache
# Increment this number every time the renderer changes its output
- CACHE_COMMONMARK_VERSION = 19
+ CACHE_COMMONMARK_VERSION = 20
CACHE_COMMONMARK_VERSION_START = 10
BaseError = Class.new(StandardError)
diff --git a/lib/gitlab/reactive_cache_set_cache.rb b/lib/gitlab/reactive_cache_set_cache.rb
index 14d008c3dfb..609087d8137 100644
--- a/lib/gitlab/reactive_cache_set_cache.rb
+++ b/lib/gitlab/reactive_cache_set_cache.rb
@@ -10,9 +10,13 @@ module Gitlab
@expires_in = expires_in
end
+ def cache_key(key)
+ "#{cache_type}:#{key}:set"
+ end
+
def clear_cache!(key)
with do |redis|
- keys = read(key).map { |value| "#{cache_type}#{value}" }
+ keys = read(key).map { |value| "#{cache_type}:#{value}" }
keys << cache_key(key)
redis.pipelined do
@@ -24,7 +28,7 @@ module Gitlab
private
def cache_type
- "#{Gitlab::Redis::Cache::CACHE_NAMESPACE}:"
+ Gitlab::Redis::Cache::CACHE_NAMESPACE
end
end
end
diff --git a/lib/gitlab/tree_summary.rb b/lib/gitlab/tree_summary.rb
index 76018cb23c4..5df53b5adde 100644
--- a/lib/gitlab/tree_summary.rb
+++ b/lib/gitlab/tree_summary.rb
@@ -69,7 +69,7 @@ module Gitlab
end
def entry_path(entry)
- File.join(*[path, entry[:file_name]].compact)
+ File.join(*[path, entry[:file_name]].compact).force_encoding(Encoding::ASCII_8BIT)
end
def build_entry(entry)