diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-30 15:10:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-30 15:10:12 +0300 |
commit | b51258eac273fa8aad9ec7d8a2888b9fd747b107 (patch) | |
tree | a4a0d580fb6be3596aceed8910f1db59eb65a8be /lib | |
parent | a16109b67fdee47ff1ccf4c0c831a0b47a17ab34 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/project_templates.rb | 2 | ||||
-rw-r--r-- | lib/api/tags.rb | 2 | ||||
-rw-r--r-- | lib/api/templates.rb | 19 | ||||
-rw-r--r-- | lib/gitlab/github_import/importer/repository_importer.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/sidekiq_cluster/cli.rb | 16 |
5 files changed, 28 insertions, 13 deletions
diff --git a/lib/api/project_templates.rb b/lib/api/project_templates.rb index acf9bfece65..fe0e837c596 100644 --- a/lib/api/project_templates.rb +++ b/lib/api/project_templates.rb @@ -12,7 +12,7 @@ module API before { authenticate_non_get! } - feature_category :templates + feature_category :source_code_management params do requires :id, type: String, desc: 'The ID of a project' diff --git a/lib/api/tags.rb b/lib/api/tags.rb index 6c8e2c69a6d..395aacced78 100644 --- a/lib/api/tags.rb +++ b/lib/api/tags.rb @@ -59,8 +59,6 @@ module API optional :message, type: String, desc: 'Specifying a message creates an annotated tag' end post ':id/repository/tags', :release_orchestration do - deprecate_release_notes unless params[:release_description].blank? - authorize_admin_tag result = ::Tags::CreateService.new(user_project, current_user) diff --git a/lib/api/templates.rb b/lib/api/templates.rb index b7fb35eac03..a595129fd6a 100644 --- a/lib/api/templates.rb +++ b/lib/api/templates.rb @@ -4,17 +4,18 @@ module API class Templates < ::API::Base include PaginationParams - feature_category :templates - GLOBAL_TEMPLATE_TYPES = { gitignores: { - gitlab_version: 8.8 + gitlab_version: 8.8, + feature_category: :source_code_management }, gitlab_ci_ymls: { - gitlab_version: 8.9 + gitlab_version: 8.9, + feature_category: :continuous_integration }, dockerfiles: { - gitlab_version: 8.15 + gitlab_version: 8.15, + feature_category: :source_code_management } }.freeze @@ -33,7 +34,7 @@ module API optional :popular, type: Boolean, desc: 'If passed, returns only popular licenses' use :pagination end - get "templates/licenses" do + get "templates/licenses", feature_category: :source_code_management do popular = declared(params)[:popular] popular = to_boolean(popular) if popular.present? @@ -49,7 +50,7 @@ module API params do requires :name, type: String, desc: 'The name of the template' end - get "templates/licenses/:name", requirements: { name: /[\w\.-]+/ } do + get "templates/licenses/:name", requirements: { name: /[\w\.-]+/ }, feature_category: :source_code_management do template = TemplateFinder.build(:licenses, nil, name: params[:name]).execute not_found!('License') unless template.present? @@ -72,7 +73,7 @@ module API params do use :pagination end - get "templates/#{template_type}" do + get "templates/#{template_type}", feature_category: properties[:feature_category] do templates = ::Kaminari.paginate_array(TemplateFinder.build(template_type, nil).execute) present paginate(templates), with: Entities::TemplatesList end @@ -84,7 +85,7 @@ module API params do requires :name, type: String, desc: 'The name of the template' end - get "templates/#{template_type}/:name", requirements: { name: /[\w\.-]+/ } do + get "templates/#{template_type}/:name", requirements: { name: /[\w\.-]+/ }, feature_category: properties[:feature_category] do finder = TemplateFinder.build(template_type, nil, name: declared(params)[:name]) new_template = finder.execute diff --git a/lib/gitlab/github_import/importer/repository_importer.rb b/lib/gitlab/github_import/importer/repository_importer.rb index 1401c92a44e..b4a40811d6e 100644 --- a/lib/gitlab/github_import/importer/repository_importer.rb +++ b/lib/gitlab/github_import/importer/repository_importer.rb @@ -50,7 +50,7 @@ module Gitlab project.ensure_repository refmap = Gitlab::GithubImport.refmap - project.repository.fetch_as_mirror(project.import_url, refmap: refmap, forced: true, remote_name: 'github') + project.repository.fetch_as_mirror(project.import_url, refmap: refmap, forced: true) project.change_head(default_branch) if default_branch diff --git a/lib/gitlab/sidekiq_cluster/cli.rb b/lib/gitlab/sidekiq_cluster/cli.rb index e20834fa912..05319ba17a2 100644 --- a/lib/gitlab/sidekiq_cluster/cli.rb +++ b/lib/gitlab/sidekiq_cluster/cli.rb @@ -37,6 +37,7 @@ module Gitlab @logger.formatter = ::Gitlab::SidekiqLogging::JSONFormatter.new @rails_path = Dir.pwd @dryrun = false + @list_queues = false end def run(argv = ARGV) @@ -47,6 +48,11 @@ module Gitlab option_parser.parse!(argv) + if @dryrun && @list_queues + raise CommandError, + 'The --dryrun and --list-queues options are mutually exclusive' + end + worker_metadatas = SidekiqConfig::CliMethods.worker_metadatas(@rails_path) worker_queues = SidekiqConfig::CliMethods.worker_queues(@rails_path) @@ -73,6 +79,12 @@ module Gitlab 'No queues found, you must select at least one queue' end + if @list_queues + puts queue_groups.map(&:sort) # rubocop:disable Rails/Output + + return + end + unless @dryrun @logger.info("Starting cluster with #{queue_groups.length} processes") end @@ -202,6 +214,10 @@ module Gitlab opt.on('-d', '--dryrun', 'Print commands that would be run without this flag, and quit') do |int| @dryrun = true end + + opt.on('--list-queues', 'List matching queues, and quit') do |int| + @list_queues = true + end end end end |