diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-03 20:34:32 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-03 20:34:32 +0000 |
commit | a47bbf7ce093a46ce83cd66da5d9ce3150324860 (patch) | |
tree | 36ee17fd93f50c371dba3e8829283fa4bfb98f99 /lib | |
parent | 4bafeeda963a11ce4004bbe35a4ff2606bc4d10a (diff) | |
download | gitlab-ce-a47bbf7ce093a46ce83cd66da5d9ce3150324860.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-ee
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backup/database.rb | 9 | ||||
-rw-r--r-- | lib/gitlab/ci/artifact_file_reader.rb | 27 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml | 2 |
4 files changed, 37 insertions, 3 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb index 851445f703d..0429d9496d6 100644 --- a/lib/backup/database.rb +++ b/lib/backup/database.rb @@ -140,7 +140,14 @@ module Backup 'sslcrl' => 'PGSSLCRL', 'sslcompression' => 'PGSSLCOMPRESSION' } - args.each { |opt, arg| ENV[arg] = config[opt].to_s if config[opt] } + args.each do |opt, arg| + # This enables the use of different PostgreSQL settings in + # case PgBouncer is used. PgBouncer clears the search path, + # which wreaks havoc on Rails if connections are reused. + override = "GITLAB_BACKUP_#{arg}" + val = ENV[override].presence || config[opt].to_s.presence + ENV[arg] = val if val + end end def report_success(success) diff --git a/lib/gitlab/ci/artifact_file_reader.rb b/lib/gitlab/ci/artifact_file_reader.rb index b0fad026ec5..d576953c1a0 100644 --- a/lib/gitlab/ci/artifact_file_reader.rb +++ b/lib/gitlab/ci/artifact_file_reader.rb @@ -45,6 +45,14 @@ module Gitlab end def read_zip_file!(file_path) + if ::Feature.enabled?(:ci_new_artifact_file_reader, job.project, default_enabled: false) + read_with_new_artifact_file_reader(file_path) + else + read_with_legacy_artifact_file_reader(file_path) + end + end + + def read_with_new_artifact_file_reader(file_path) job.artifacts_file.use_open_file do |file| zip_file = Zip::File.new(file, false, true) entry = zip_file.find_entry(file_path) @@ -61,6 +69,25 @@ module Gitlab end end + def read_with_legacy_artifact_file_reader(file_path) + job.artifacts_file.use_file do |archive_path| + Zip::File.open(archive_path) do |zip_file| + entry = zip_file.find_entry(file_path) + unless entry + raise Error, "Path `#{file_path}` does not exist inside the `#{job.name}` artifacts archive!" + end + + if entry.name_is_directory? + raise Error, "Path `#{file_path}` was expected to be a file but it was a directory!" + end + + zip_file.get_input_stream(entry) do |is| + is.read + end + end + end + end + def max_archive_size_in_mb ActiveSupport::NumberHelper.number_to_human_size(MAX_ARCHIVE_SIZE) end diff --git a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml index 77216a6e404..7ad5a9e2bba 100644 --- a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml @@ -1,5 +1,5 @@ .dast-auto-deploy: - image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.5" + image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.7" dast_environment_deploy: extends: .dast-auto-deploy diff --git a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml index 32a207a85d1..33d77e39bc9 100644 --- a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml @@ -1,5 +1,5 @@ .auto-deploy: - image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.5" + image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.7" dependencies: [] review: |