Commit a9a1e26f authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'ce-to-ee-2018-03-30' into 'master'

CE upstream - 2018-03-30 15:25 UTC

See merge request gitlab-org/gitlab-ee!5185
parents 5b2b4d48 f8a96a0a
...@@ -322,8 +322,17 @@ package-and-qa: ...@@ -322,8 +322,17 @@ package-and-qa:
stage: build stage: build
cache: {} cache: {}
when: manual when: manual
variables:
GIT_STRATEGY: none
before_script:
# We need to download the script rather than clone the repo since the
# package-and-qa job will not be able to run when the branch gets
# deleted (when merging the MR).
- apk add --update openssl
- wget https://gitlab.com/gitlab-org/gitlab-ce/raw/$CI_COMMIT_SHA/scripts/trigger-build-omnibus
- chmod 755 trigger-build-omnibus
script: script:
- scripts/trigger-build-omnibus - ./trigger-build-omnibus
only: only:
- //@gitlab-org/gitlab-ce - //@gitlab-org/gitlab-ce
- //@gitlab-org/gitlab-ee - //@gitlab-org/gitlab-ee
......
...@@ -178,6 +178,9 @@ module Projects ...@@ -178,6 +178,9 @@ module Projects
def latest_sha def latest_sha
project.commit(build.ref).try(:sha).to_s project.commit(build.ref).try(:sha).to_s
ensure
# Close any file descriptors that were opened and free libgit2 buffers
project.cleanup
end end
def sha def sha
......
---
title: Fixed gitlab:uploads:migrate task ignoring some uploads.
merge_request: 18082
author:
type: fixed
---
title: Free open file descriptors and libgit2 buffers in UpdatePagesService
merge_request:
author:
type: performance
...@@ -35,7 +35,7 @@ are: ...@@ -35,7 +35,7 @@ are:
A Runner that is specific only runs for the specified project(s). A shared Runner A Runner that is specific only runs for the specified project(s). A shared Runner
can run jobs for every project that has enabled the option **Allow shared Runners** can run jobs for every project that has enabled the option **Allow shared Runners**
under **Settings CI/CD**. under **Settings > CI/CD**.
Projects with high demand of CI activity can also benefit from using specific Projects with high demand of CI activity can also benefit from using specific
Runners. By having dedicated Runners you are guaranteed that the Runner is not Runners. By having dedicated Runners you are guaranteed that the Runner is not
...@@ -76,7 +76,7 @@ Registering a specific can be done in two ways: ...@@ -76,7 +76,7 @@ Registering a specific can be done in two ways:
To create a specific Runner without having admin rights to the GitLab instance, To create a specific Runner without having admin rights to the GitLab instance,
visit the project you want to make the Runner work for in GitLab: visit the project you want to make the Runner work for in GitLab:
1. Go to **Settings CI/CD** to obtain the token 1. Go to **Settings > CI/CD** to obtain the token
1. [Register the Runner][register] 1. [Register the Runner][register]
### Making an existing shared Runner specific ### Making an existing shared Runner specific
...@@ -85,7 +85,7 @@ If you are an admin on your GitLab instance, you can turn any shared Runner into ...@@ -85,7 +85,7 @@ If you are an admin on your GitLab instance, you can turn any shared Runner into
a specific one, but not the other way around. Keep in mind that this is a one a specific one, but not the other way around. Keep in mind that this is a one
way transition. way transition.
1. Go to the Runners in the admin area **Overview Runners** (`/admin/runners`) 1. Go to the Runners in the admin area **Overview > Runners** (`/admin/runners`)
and find your Runner and find your Runner
1. Enable any projects under **Restrict projects for this Runner** to be used 1. Enable any projects under **Restrict projects for this Runner** to be used
with the Runner with the Runner
...@@ -101,7 +101,7 @@ can be changed afterwards under each Runner's settings. ...@@ -101,7 +101,7 @@ can be changed afterwards under each Runner's settings.
To lock/unlock a Runner: To lock/unlock a Runner:
1. Visit your project's **Settings CI/CD** 1. Visit your project's **Settings > CI/CD**
1. Find the Runner you wish to lock/unlock and make sure it's enabled 1. Find the Runner you wish to lock/unlock and make sure it's enabled
1. Click the pencil button 1. Click the pencil button
1. Check the **Lock to current projects** option 1. Check the **Lock to current projects** option
...@@ -115,7 +115,7 @@ you can enable the Runner also on any other project where you have Master permis ...@@ -115,7 +115,7 @@ you can enable the Runner also on any other project where you have Master permis
To enable/disable a Runner in your project: To enable/disable a Runner in your project:
1. Visit your project's **Settings CI/CD** 1. Visit your project's **Settings > CI/CD**
1. Find the Runner you wish to enable/disable 1. Find the Runner you wish to enable/disable
1. Click **Enable for this project** or **Disable for this project** 1. Click **Enable for this project** or **Disable for this project**
...@@ -124,6 +124,13 @@ Consider that if you don't lock your specific Runner to a specific project, any ...@@ -124,6 +124,13 @@ Consider that if you don't lock your specific Runner to a specific project, any
user with Master role in you project can assign your runner to another arbitrary user with Master role in you project can assign your runner to another arbitrary
project without requiring your authorization, so use it with caution. project without requiring your authorization, so use it with caution.
An admin can enable/disable a specific Runner for projects:
1. Navigate to **Admin > Runners**
2. Find the Runner you wish to enable/disable
3. Click edit on the Runner
4. Click **Enable** or **Disable** on the project
## Protected Runners ## Protected Runners
> >
...@@ -136,7 +143,7 @@ Whenever a Runner is protected, the Runner picks only jobs created on ...@@ -136,7 +143,7 @@ Whenever a Runner is protected, the Runner picks only jobs created on
To protect/unprotect Runners: To protect/unprotect Runners:
1. Visit your project's **Settings CI/CD** 1. Visit your project's **Settings > CI/CD**
1. Find a Runner you want to protect/unprotect and make sure it's enabled 1. Find a Runner you want to protect/unprotect and make sure it's enabled
1. Click the pencil button besides the Runner name 1. Click the pencil button besides the Runner name
1. Check the **Protected** option 1. Check the **Protected** option
......
...@@ -5,9 +5,5 @@ module Backup ...@@ -5,9 +5,5 @@ module Backup
def initialize def initialize
super('artifacts', JobArtifactUploader.root) super('artifacts', JobArtifactUploader.root)
end end
def create_files_dir
Dir.mkdir(app_files_dir, 0700)
end
end end
end end
...@@ -5,9 +5,5 @@ module Backup ...@@ -5,9 +5,5 @@ module Backup
def initialize def initialize
super('builds', Settings.gitlab_ci.builds_path) super('builds', Settings.gitlab_ci.builds_path)
end end
def create_files_dir
Dir.mkdir(app_files_dir, 0700)
end
end end
end end
require 'open3' require 'open3'
require_relative 'helper'
module Backup module Backup
class Files class Files
include Backup::Helper
attr_reader :name, :app_files_dir, :backup_tarball, :files_parent_dir attr_reader :name, :app_files_dir, :backup_tarball, :files_parent_dir
def initialize(name, app_files_dir) def initialize(name, app_files_dir)
...@@ -35,15 +38,22 @@ module Backup ...@@ -35,15 +38,22 @@ module Backup
def restore def restore
backup_existing_files_dir backup_existing_files_dir
create_files_dir
run_pipeline!([%w(gzip -cd), %W(tar -C #{app_files_dir} -xf -)], in: backup_tarball) run_pipeline!([%w(gzip -cd), %W(tar --unlink-first --recursive-unlink -C #{app_files_dir} -xf -)], in: backup_tarball)
end end
def backup_existing_files_dir def backup_existing_files_dir
timestamped_files_path = File.join(files_parent_dir, "#{name}.#{Time.now.to_i}") timestamped_files_path = File.join(Gitlab.config.backup.path, "tmp", "#{name}.#{Time.now.to_i}")
if File.exist?(app_files_dir) if File.exist?(app_files_dir)
FileUtils.mv(app_files_dir, File.expand_path(timestamped_files_path)) # Move all files in the existing repos directory except . and .. to
# repositories.old.<timestamp> directory
FileUtils.mkdir_p(timestamped_files_path, mode: 0700)
files = Dir.glob(File.join(app_files_dir, "*"), File::FNM_DOTMATCH) - [File.join(app_files_dir, "."), File.join(app_files_dir, "..")]
begin
FileUtils.mv(files, timestamped_files_path)
rescue Errno::EACCES
access_denied_error(app_files_dir)
end
end end
end end
......
module Backup
module Helper
def access_denied_error(path)
message = <<~EOS
### NOTICE ###
As part of restore, the task tried to move existing content from #{path}.
However, it seems that directory contains files/folders that are not owned
by the user #{Gitlab.config.gitlab.user}. To proceed, please move the files
or folders inside #{path} to a secure location so that #{path} is empty and
run restore task again.
EOS
raise message
end
end
end
...@@ -5,9 +5,5 @@ module Backup ...@@ -5,9 +5,5 @@ module Backup
def initialize def initialize
super('lfs', Settings.lfs.storage_path) super('lfs', Settings.lfs.storage_path)
end end
def create_files_dir
Dir.mkdir(app_files_dir, 0700)
end
end end
end end
...@@ -5,9 +5,5 @@ module Backup ...@@ -5,9 +5,5 @@ module Backup
def initialize def initialize
super('pages', Gitlab.config.pages.path) super('pages', Gitlab.config.pages.path)
end end
def create_files_dir
Dir.mkdir(app_files_dir, 0700)
end
end end
end end
...@@ -5,9 +5,5 @@ module Backup ...@@ -5,9 +5,5 @@ module Backup
def initialize def initialize
super('registry', Settings.registry.path) super('registry', Settings.registry.path)
end end
def create_files_dir
Dir.mkdir(app_files_dir, 0700)
end
end end
end end
require 'yaml' require 'yaml'
require_relative 'helper'
module Backup module Backup
class Repository class Repository
include Backup::Helper
# rubocop:disable Metrics/AbcSize # rubocop:disable Metrics/AbcSize
def dump def dump
prepare prepare
...@@ -63,18 +66,27 @@ module Backup ...@@ -63,18 +66,27 @@ module Backup
end end
end end
def restore def prepare_directories
Gitlab.config.repositories.storages.each do |name, repository_storage| Gitlab.config.repositories.storages.each do |name, repository_storage|
path = repository_storage.legacy_disk_path path = repository_storage.legacy_disk_path
next unless File.exist?(path) next unless File.exist?(path)
# Move repos dir to 'repositories.old' dir # Move all files in the existing repos directory except . and .. to
bk_repos_path = File.join(path, '..', 'repositories.old.' + Time.now.to_i.to_s) # repositories.old.<timestamp> directory
FileUtils.mv(path, bk_repos_path) bk_repos_path = File.join(Gitlab.config.backup.path, "tmp", "#{name}-repositories.old." + Time.now.to_i.to_s)
# This is expected from gitlab:check FileUtils.mkdir_p(bk_repos_path, mode: 0700)
FileUtils.mkdir_p(path, mode: 02770) files = Dir.glob(File.join(path, "*"), File::FNM_DOTMATCH) - [File.join(path, "."), File.join(path, "..")]
begin
FileUtils.mv(files, bk_repos_path)
rescue Errno::EACCES
access_denied_error(path)
end
end end
end
def restore
prepare_directories
Project.find_each(batch_size: 1000) do |project| Project.find_each(batch_size: 1000) do |project|
progress.print " * #{display_repo_path(project)} ... " progress.print " * #{display_repo_path(project)} ... "
path_to_project_repo = path_to_repo(project) path_to_project_repo = path_to_repo(project)
......
...@@ -5,9 +5,5 @@ module Backup ...@@ -5,9 +5,5 @@ module Backup
def initialize def initialize
super('uploads', Rails.root.join('public/uploads')) super('uploads', Rails.root.join('public/uploads'))
end end
def create_files_dir
Dir.mkdir(app_files_dir)
end
end end
end end
...@@ -25,8 +25,8 @@ namespace :gitlab do ...@@ -25,8 +25,8 @@ namespace :gitlab do
Upload.class_eval { include EachBatch } unless Upload < EachBatch Upload.class_eval { include EachBatch } unless Upload < EachBatch
Upload Upload
.where.not(store: @to_store) .where(store: [nil, ObjectStorage::Store::LOCAL],
.where(uploader: @uploader_class.to_s, uploader: @uploader_class.to_s,
model_type: @model_class.base_class.sti_name) model_type: @model_class.base_class.sti_name)
end end
end end
......
...@@ -8,8 +8,8 @@ msgid "" ...@@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-27 14:40+0300\n" "POT-Creation-Date: 2018-03-30 17:57+0200\n"
"PO-Revision-Date: 2018-03-27 14:40+0300\n" "PO-Revision-Date: 2018-03-30 17:57+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
...@@ -148,6 +148,9 @@ msgstr "" ...@@ -148,6 +148,9 @@ msgstr ""
msgid "Account" msgid "Account"
msgstr "" msgstr ""
msgid "Account and limit settings"
msgstr ""
msgid "Active" msgid "Active"
msgstr "" msgstr ""
...@@ -385,6 +388,12 @@ msgstr "" ...@@ -385,6 +388,12 @@ msgstr ""
msgid "Assign to" msgid "Assign to"
msgstr "" msgstr ""
msgid "Assigned Issues"
msgstr ""
msgid "Assigned Merge Requests"
msgstr ""
msgid "Assigned to :name" msgid "Assigned to :name"
msgstr "" msgstr ""
...@@ -412,6 +421,9 @@ msgstr "" ...@@ -412,6 +421,9 @@ msgstr ""
msgid "Auto DevOps enabled" msgid "Auto DevOps enabled"
msgstr "" msgstr ""
msgid "Auto DevOps, runners amd job artifacts"
msgstr ""
msgid "Auto Review Apps and Auto Deploy need a %{kubernetes} to work correctly." msgid "Auto Review Apps and Auto Deploy need a %{kubernetes} to work correctly."
msgstr "" msgstr ""
...@@ -1285,6 +1297,9 @@ msgstr "" ...@@ -1285,6 +1297,9 @@ msgstr ""
msgid "Confidentiality" msgid "Confidentiality"
msgstr "" msgstr ""
msgid "Configure the way a user creates a new account."
msgstr ""
msgid "Connect" msgid "Connect"
msgstr "" msgstr ""
...@@ -1345,6 +1360,9 @@ msgstr "" ...@@ -1345,6 +1360,9 @@ msgstr ""
msgid "ContainerRegistry|With the Docker Container Registry integrated into GitLab, every project can have its own space to store its Docker images." msgid "ContainerRegistry|With the Docker Container Registry integrated into GitLab, every project can have its own space to store its Docker images."
msgstr "" msgstr ""
msgid "Continuous Integration and Deployment"
msgstr ""
msgid "Contribution" msgid "Contribution"
msgstr "" msgstr ""
...@@ -1414,9 +1432,6 @@ msgstr "" ...@@ -1414,9 +1432,6 @@ msgstr ""
msgid "Create empty repository" msgid "Create empty repository"
msgstr "" msgstr ""
msgid "Create file"
msgstr ""
msgid "Create epic" msgid "Create epic"
msgstr "" msgstr ""
...@@ -1629,6 +1644,12 @@ msgstr "" ...@@ -1629,6 +1644,12 @@ msgstr ""
msgid "Enable Auto DevOps" msgid "Enable Auto DevOps"
msgstr "" msgstr ""
msgid "Enable and configure InfluxDB metrics."
msgstr ""
msgid "Enable and configure Prometheus metrics."
msgstr ""
msgid "Enable classification control using an external service" msgid "Enable classification control using an external service"
msgstr "" msgstr ""
...@@ -1949,9 +1970,6 @@ msgstr "" ...@@ -1949,9 +1970,6 @@ msgstr ""
msgid "GeoNodes|Replication slots:" msgid "GeoNodes|Replication slots:"
msgstr "" msgstr ""
msgid "GroupsTree|Create a project in this group."
msgstr ""
msgid "GeoNodes|Repositories checksummed:" msgid "GeoNodes|Repositories checksummed:"
msgstr "" msgstr ""
...@@ -1997,14 +2015,6 @@ msgstr "" ...@@ -1997,14 +2015,6 @@ msgstr ""
msgid "GeoNodes|Wiki checksums verified:" msgid "GeoNodes|Wiki checksums verified:"
msgstr "" msgstr ""
msgid "Help"
msgstr ""
msgid "Hide value"
msgid_plural "Hide values"
msgstr[0] ""
msgstr[1] ""
msgid "GeoNodes|Wikis checksummed:" msgid "GeoNodes|Wikis checksummed:"
msgstr "" msgstr ""
...@@ -2053,6 +2063,9 @@ msgstr "" ...@@ -2053,6 +2063,9 @@ msgstr ""
msgid "GitHub import" msgid "GitHub import"
msgstr "" msgstr ""
msgid "GitLab CI Linter has been moved"
msgstr ""
msgid "GitLab Runner section" msgid "GitLab Runner section"
msgstr "" msgstr ""
...@@ -2179,6 +2192,12 @@ msgstr "" ...@@ -2179,6 +2192,12 @@ msgstr ""
msgid "Help" msgid "Help"
msgstr "" msgstr ""
msgid "Help page"
msgstr ""
msgid "Help page text and support page url."
msgstr ""
msgid "Hide value" msgid "Hide value"
msgid_plural "Hide values" msgid_plural "Hide values"
msgstr[0] "" msgstr[0] ""
...@@ -2348,10 +2367,10 @@ msgstr "" ...@@ -2348,10 +2367,10 @@ msgstr ""
msgid "Labels can be applied to issues and merge requests to categorize them." msgid "Labels can be applied to issues and merge requests to categorize them."
msgstr "" msgstr ""
msgid "Labels|Promote Label" msgid "Labels|<span>Promote label</span> %{labelTitle} <span>to Group Label?</span>"
msgstr "" msgstr ""
msgid "Labels|Promote label %{labelTitle} to Group Label?" msgid "Labels|Promote Label"
msgstr "" msgstr ""
msgid "Last %d day" msgid "Last %d day"
...@@ -2500,6 +2519,12 @@ msgstr "" ...@@ -2500,6 +2519,12 @@ msgstr ""
msgid "Messages" msgid "Messages"
msgstr "" msgstr ""
msgid "Metrics - Influx"
msgstr ""
msgid "Metrics - Prometheus"
msgstr ""
msgid "Metrics|Business" msgid "Metrics|Business"
msgstr "" msgstr ""
...@@ -2590,6 +2615,9 @@ msgstr "" ...@@ -2590,6 +2615,9 @@ msgstr ""
msgid "Milestones|Promote Milestone" msgid "Milestones|Promote Milestone"
msgstr "" msgstr ""
msgid "Milestones|This action cannot be reversed."
msgstr ""
msgid "MissingSSHKeyWarningLink|add an SSH key" msgid "MissingSSHKeyWarningLink|add an SSH key"
msgstr "" msgstr ""
...@@ -2859,6 +2887,9 @@ msgstr "" ...@@ -2859,6 +2887,9 @@ msgstr ""
msgid "Owner" msgid "Owner"
msgstr "" msgstr ""
msgid "Pages"
msgstr ""
msgid "Pagination|Last »" msgid "Pagination|Last »"
msgstr "" msgstr ""
...@@ -3524,9 +3555,18 @@ msgstr "" ...@@ -3524,9 +3555,18 @@ msgstr ""
msgid "Service URL" msgid "Service URL"
msgstr "" msgstr ""
msgid "Session expiration, projects limit and attachment size."
msgstr ""
msgid "Set a password on your account to pull or push via %{protocol}." msgid "Set a password on your account to pull or push via %{protocol}."
msgstr "" msgstr ""
msgid "Set default and restrict visibility levels. Configure import sources and git access protocol."
msgstr ""
msgid "Set requirements for a user to sign-in. Enable mandatory two-factor authentication."
msgstr ""
msgid "Set up CI/CD" msgid "Set up CI/CD"
msgstr "" msgstr ""
...@@ -3577,12 +3617,24 @@ msgstr "" ...@@ -3577,12 +3617,24 @@ msgstr ""
msgid "Sidebar|Weight" msgid "Sidebar|Weight"
msgstr "" msgstr ""
msgid "Sign-in restrictions"
msgstr ""
msgid "Sign-up restrictions"
msgstr ""
msgid "Size and domain settings for static websites"
msgstr ""
msgid "Snippets" msgid "Snippets"
msgstr "" msgstr ""
msgid "Something went wrong on our end" msgid "Something went wrong on our end"
msgstr "" msgstr ""
msgid "Something went wrong on our end."
msgstr ""
msgid "Something went wrong trying to change the confidentiality of this issue" msgid "Something went wrong trying to change the confidentiality of this issue"
msgstr "" msgstr ""
...@@ -3595,9 +3647,6 @@ msgstr "" ...@@ -3595,9 +3647,6 @@ msgstr ""
msgid "Something went wrong while fetching Dependency Scanning." msgid "Something went wrong while fetching Dependency Scanning."
msgstr "" msgstr ""
msgid "Something went wrong while fetching the projects."
msgstr ""
msgid "Something went wrong while fetching SAST." msgid "Something went wrong while fetching SAST."
msgstr "" msgstr ""
...@@ -3730,6 +3779,12 @@ msgstr "" ...@@ -3730,6 +3779,12 @@ msgstr ""
msgid "StarProject|Star" msgid "StarProject|Star"
msgstr "" msgstr ""
msgid "Starred Projects"
msgstr ""
msgid "Starred Projects' Activity"
msgstr ""
msgid "Starred projects" msgid "Starred projects"
msgstr "" msgstr ""
...@@ -3957,6 +4012,9 @@ msgstr "" ...@@ -3957,6 +4012,9 @@ msgstr ""
msgid "There are problems accessing Git storage: " msgid "There are problems accessing Git storage: "
msgstr "" msgstr ""
msgid "There was an error loading results"
msgstr ""
msgid "There was an error loading users activity calendar." msgid "There was an error loading users activity calendar."
msgstr "" msgstr ""
...@@ -4228,6 +4286,9 @@ msgstr "" ...@@ -4228,6 +4286,9 @@ msgstr ""
msgid "To only use CI/CD features for an external repository, choose <strong>CI/CD for external repo</strong>." msgid "To only use CI/CD features for an external repository, choose <strong>CI/CD for external repo</strong>."
msgstr "" msgstr ""
msgid "To validate your GitLab CI configurations, go to 'CI/CD → Pipelines' inside your project, and click on the 'CI Lint' button."
msgstr ""
msgid "To view the roadmap, add a planned start or finish date to one of your epics in this group or its subgroups. Only epics in the past 3 months and the next 3 months are shown." msgid "To view the roadmap, add a planned start or finish date to one of your epics in this group or its subgroups. Only epics in the past 3 months and the next 3 months are shown."
msgstr "" msgstr ""
...@@ -4354,6 +4415,9 @@ msgstr "" ...@@ -4354,6 +4415,9 @@ msgstr ""
msgid "View replaced file @ " msgid "View replaced file @ "
msgstr "" msgstr ""
msgid "Visibility and access controls"
msgstr ""
msgid "VisibilityLevel|Internal" msgid "VisibilityLevel|Internal"
msgstr "" msgstr ""
...@@ -4600,9 +4664,21 @@ msgstr "" ...@@ -4600,9 +4664,21 @@ msgstr ""
msgid "You're receiving this email because of your account on %{host}. %{manage_notifications_link} &middot; %{help_link}" msgid "You're receiving this email because of your account on %{host}. %{manage_notifications_link} &middot; %{help_link}"
msgstr "" msgstr ""
msgid "Your Groups"
msgstr ""
msgid "Your Kubernetes cluster information on this page is still editable, but you are advised to disable and reconfigure" msgid "Your Kubernetes cluster information on this page is still editable, but you are advised to disable and reconfigure"
msgstr "" msgstr ""
msgid "Your Projects (default)"
msgstr ""
msgid "Your Projects' Activity"
msgstr ""
msgid "Your Todos"
msgstr ""
msgid "Your changes can be committed to %{branch_name} because a merge request is open." msgid "Your changes can be committed to %{branch_name} because a merge request is open."
msgstr "" msgstr ""
...@@ -4624,6 +4700,11 @@ msgstr "" ...@@ -4624,6 +4700,11 @@ msgstr ""
msgid "among other things" msgid "among other things"
msgstr "" msgstr ""
msgid "and %d fixed vulnerability"
msgid_plural "and %d fixed vulnerabilities"
msgstr[0] ""
msgstr[1] ""
msgid "assign yourself" msgid "assign yourself"
msgstr "" msgstr ""
...@@ -4633,6 +4714,12 @@ msgstr "" ...@@ -4633,6 +4714,12 @@ msgstr ""
msgid "by" msgid "by"
msgstr "" msgstr ""
msgid "ciReport|%{type} detected no new security vulnerabilities"
msgstr ""
msgid "ciReport|%{type} detected no security vulnerabilities"
msgstr ""
msgid "ciReport|Code quality" msgid "ciReport|Code quality"
msgstr "" msgstr ""
...@@ -4690,6 +4777,12 @@ msgstr "" ...@@ -4690,6 +4777,12 @@ msgstr ""
msgid "ciReport|SAST:container no vulnerabilities were found" msgid "ciReport|SAST:container no vulnerabilities were found"
msgstr "" msgstr ""
msgid "ciReport|Security scanning"
msgstr ""
msgid "ciReport|Security scanning failed loading any results"
msgstr ""
msgid "ciReport|Show complete code vulnerabilities report" msgid "ciReport|Show complete code vulnerabilities report"
msgstr "" msgstr ""
...@@ -4719,6 +4812,19 @@ msgid_plural "days" ...@@ -4719,6 +4812,19 @@ msgid_plural "days"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "detected %d fixed vulnerability"
msgid_plural "detected %d fixed vulnerabilities"
msgstr[0] ""
msgstr[1] ""
msgid "detected %d new vulnerability"
msgid_plural "detected %d new vulnerabilities"
msgstr[0] ""
msgstr[1] ""
msgid "detected no vulnerabilities"
msgstr ""
msgid "estimateCommand|%{slash_command} will update the estimated time with the latest command." msgid "estimateCommand|%{slash_command} will update the estimated time with the latest command."
msgstr "" msgstr ""
...@@ -4728,6 +4834,9 @@ msgstr "" ...@@ -4728,6 +4834,9 @@ msgstr ""
msgid "importing" msgid "importing"
msgstr "" msgstr ""
msgid "in progress"
msgstr ""
msgid "is invalid because there is downstream lock" msgid "is invalid because there is downstream lock"
msgstr "" msgstr ""
......
require 'spec_helper'
describe Backup::Files do
let(:progress) { StringIO.new }
let!(:project) { create(:project) }
before do
allow(progress).to receive(:puts)
allow(progress).to receive(:print)
allow(FileUtils).to receive(:mkdir_p).and_return(true)
allow(FileUtils).to receive(:mv).and_return(true)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:realpath).with("/var/gitlab-registry").and_return("/var/gitlab-registry")
allow(File).to receive(:realpath).with("/var/gitlab-registry/..").and_return("/var")
allow_any_instance_of(String).to receive(:color) do |string, _color|
string
end
allow_any_instance_of(described_class).to receive(:progress).and_return(progress)
end
describe '#restore' do
subject { described_class.new('registry', '/var/gitlab-registry') }
let(:timestamp) { Time.utc(2017, 3, 22) }
around do |example|
Timecop.freeze(timestamp) { example.run }
end
describe 'folders with permission' do
before do
allow(subject).to receive(:run_pipeline!).and_return(true)
allow(subject).to receive(:backup_existing_files).and_return(true)
allow(Dir).to receive(:glob).with("/var/gitlab-registry/*", File::FNM_DOTMATCH).and_return(["/var/gitlab-registry/.", "/var/gitlab-registry/..", "/var/gitlab-registry/sample1"])
end
it 'moves all necessary files' do
allow(subject).to receive(:backup_existing_files).and_call_original
expect(FileUtils).to receive(:mv).with(["/var/gitlab-registry/sample1"], File.join(Gitlab.config.backup.path, "tmp", "registry.#{Time.now.to_i}"))
subject.restore
end
it 'raises no errors' do
expect { subject.restore }.not_to raise_error
end
it 'calls tar command with unlink' do
expect(subject).to receive(:run_pipeline!).with([%w(gzip -cd), %w(tar --unlink-first --recursive-unlink -C /var/gitlab-registry -xf -)], any_args)
subject.restore
end
end
describe 'folders without permissions' do
before do
allow(FileUtils).to receive(:mv).and_raise(Errno::EACCES)
allow(subject).to receive(:run_pipeline!).and_return(true)
end
it 'shows error message' do
expect(subject).to receive(:access_denied_error).with("/var/gitlab-registry")
subject.restore
end
end
end
end
...@@ -7,6 +7,8 @@ describe Backup::Repository do ...@@ -7,6 +7,8 @@ describe Backup::Repository do
before do before do
allow(progress).to receive(:puts) allow(progress).to receive(:puts)
allow(progress).to receive(:print) allow(progress).to receive(:print)
allow(FileUtils).to receive(:mkdir_p).and_return(true)
allow(FileUtils).to receive(:mv).and_return(true)
allow_any_instance_of(String).to receive(:color) do |string, _color| allow_any_instance_of(String).to receive(:color) do |string, _color|
string string
...@@ -68,6 +70,17 @@ describe Backup::Repository do ...@@ -68,6 +70,17 @@ describe Backup::Repository do
end end
end end
end end
describe 'folders without permissions' do
before do
allow(FileUtils).to receive(:mv).and_raise(Errno::EACCES)
end
it 'shows error message' do
expect(subject).to receive(:access_denied_error)
subject.restore
end
end
end end
describe '#empty_repo?' do describe '#empty_repo?' do
......
...@@ -20,9 +20,23 @@ describe 'gitlab:uploads:migrate rake tasks' do ...@@ -20,9 +20,23 @@ describe 'gitlab:uploads:migrate rake tasks' do
run_rake_task("gitlab:uploads:migrate", *args) run_rake_task("gitlab:uploads:migrate", *args)
end end
it 'enqueue jobs in batch' do shared_examples 'enqueue jobs in batch' do |batch:|
expect(ObjectStorage::MigrateUploadsWorker).to receive(:enqueue!).exactly(4).times it do
expect(ObjectStorage::MigrateUploadsWorker)
.to receive(:perform_async).exactly(batch).times
.and_return("A fake job.")
run run
end
end
it_behaves_like 'enqueue jobs in batch', batch: 4
context 'Upload has store = nil' do
before do
Upload.where(model: projects).update_all(store: nil)
end
it_behaves_like 'enqueue jobs in batch', batch: 4
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment