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/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 21:06:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 21:06:29 +0300
commite66d6781ef36e39d15b1b9bc84cc30e87969edad (patch)
tree0165ff173dee501a55115d605dd8fa8a09f8d313 /lib
parent4e9f718e190a944c39fda2a178eb8b901e7e6ec7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/group_labels.rb4
-rw-r--r--lib/api/helpers/groups_helpers.rb2
-rw-r--r--lib/api/helpers/label_helpers.rb4
-rw-r--r--lib/api/labels.rb4
-rw-r--r--lib/bitbucket/client.rb4
-rw-r--r--lib/tasks/gitlab/setup.rake1
-rw-r--r--lib/tasks/migrate/setup_postgresql.rake11
7 files changed, 11 insertions, 19 deletions
diff --git a/lib/api/group_labels.rb b/lib/api/group_labels.rb
index 79a44941c81..cb044d4095f 100644
--- a/lib/api/group_labels.rb
+++ b/lib/api/group_labels.rb
@@ -18,10 +18,12 @@ module API
params do
optional :with_counts, type: Boolean, default: false,
desc: 'Include issue and merge request counts'
+ optional :include_ancestor_groups, type: Boolean, default: true,
+ desc: 'Include ancestor groups'
use :pagination
end
get ':id/labels' do
- get_labels(user_group, Entities::GroupLabel)
+ get_labels(user_group, Entities::GroupLabel, include_ancestor_groups: params[:include_ancestor_groups])
end
desc 'Create a new label' do
diff --git a/lib/api/helpers/groups_helpers.rb b/lib/api/helpers/groups_helpers.rb
index 585ae1eb5c4..abe9d457a5b 100644
--- a/lib/api/helpers/groups_helpers.rb
+++ b/lib/api/helpers/groups_helpers.rb
@@ -10,8 +10,6 @@ module API
optional :description, type: String, desc: 'The description of the group'
optional :visibility, type: String,
values: Gitlab::VisibilityLevel.string_values,
- default: Gitlab::VisibilityLevel.string_level(
- Gitlab::CurrentSettings.current_application_settings.default_group_visibility),
desc: 'The visibility of the group'
optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group'
optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access'
diff --git a/lib/api/helpers/label_helpers.rb b/lib/api/helpers/label_helpers.rb
index ec5b688dd1c..126747e4f34 100644
--- a/lib/api/helpers/label_helpers.rb
+++ b/lib/api/helpers/label_helpers.rb
@@ -18,8 +18,8 @@ module API
label || not_found!('Label')
end
- def get_labels(parent, entity)
- present paginate(available_labels_for(parent)),
+ def get_labels(parent, entity, include_ancestor_groups: true)
+ present paginate(available_labels_for(parent, include_ancestor_groups: include_ancestor_groups)),
with: entity,
current_user: current_user,
parent: parent,
diff --git a/lib/api/labels.rb b/lib/api/labels.rb
index de89e94b0c0..12553cbbbfa 100644
--- a/lib/api/labels.rb
+++ b/lib/api/labels.rb
@@ -17,10 +17,12 @@ module API
params do
optional :with_counts, type: Boolean, default: false,
desc: 'Include issue and merge request counts'
+ optional :include_ancestor_groups, type: Boolean, default: true,
+ desc: 'Include ancestor groups'
use :pagination
end
get ':id/labels' do
- get_labels(user_project, Entities::ProjectLabel)
+ get_labels(user_project, Entities::ProjectLabel, include_ancestor_groups: params[:include_ancestor_groups])
end
desc 'Create a new label' do
diff --git a/lib/bitbucket/client.rb b/lib/bitbucket/client.rb
index 1343f424c51..92894575ec2 100644
--- a/lib/bitbucket/client.rb
+++ b/lib/bitbucket/client.rb
@@ -38,8 +38,10 @@ module Bitbucket
Representation::Repo.new(parsed_response)
end
- def repos
+ def repos(filter: nil)
path = "/repositories?role=member"
+ path += "&q=name~\"#{filter}\"" if filter
+
get_collection(path, :repo)
end
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake
index 5d86d6e466c..50774de77c9 100644
--- a/lib/tasks/gitlab/setup.rake
+++ b/lib/tasks/gitlab/setup.rake
@@ -31,7 +31,6 @@ namespace :gitlab do
terminate_all_connections unless Rails.env.production?
Rake::Task["db:reset"].invoke
- Rake::Task["setup_postgresql"].invoke
Rake::Task["db:seed_fu"].invoke
rescue Gitlab::TaskAbortedByUserError
puts "Quitting...".color(:red)
diff --git a/lib/tasks/migrate/setup_postgresql.rake b/lib/tasks/migrate/setup_postgresql.rake
index cda88c130bb..4c8f13b63a4 100644
--- a/lib/tasks/migrate/setup_postgresql.rake
+++ b/lib/tasks/migrate/setup_postgresql.rake
@@ -1,14 +1,3 @@
-desc 'GitLab | Sets up PostgreSQL'
-task setup_postgresql: :environment do
- require Rails.root.join('db/migrate/20180215181245_users_name_lower_index.rb')
- require Rails.root.join('db/migrate/20180504195842_project_name_lower_index.rb')
- require Rails.root.join('db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb')
-
- UsersNameLowerIndex.new.up
- ProjectNameLowerIndex.new.up
- AddPathIndexToRedirectRoutes.new.up
-end
-
desc 'GitLab | Generate PostgreSQL Password Hash'
task :postgresql_md5_hash do
require 'digest'