diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-08 03:32:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-08 03:32:37 +0300 |
commit | 469a50879c1085ec77c95d650b7f135fee2c9e13 (patch) | |
tree | 0d639a63294b5abdb4e4a7bf1ed5a497d5e6869f /lib | |
parent | aa5ca44f172f02f04cca448b1f9c17d6d933de40 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-ee
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/auth.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/database/migration_helpers.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/kubernetes/helm.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/kubernetes/helm/v2/base_command.rb | 2 |
4 files changed, 11 insertions, 8 deletions
diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index 1aabb05f19e..1f5cce249d8 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -198,7 +198,9 @@ module Gitlab return unless valid_scoped_token?(token, all_available_scopes) - if token.user.can?(:log_in) || token.user.can?(:bot_log_in, project) + return if project && token.user.project_bot? && !project.bots.include?(token.user) + + if token.user.can?(:log_in) || token.user.project_bot? Gitlab::Auth::Result.new(token.user, nil, :personal_access_token, abilities_for_scopes(token.scopes)) end end @@ -283,7 +285,7 @@ module Gitlab return unless build.project.builds_enabled? if build.user - return unless build.user.can?(:log_in) || build.user.can?(:bot_log_in, build.project) + return unless build.user.can?(:log_in) || (build.user.project_bot? && build.project.bots&.include?(build.user)) # If user is assigned to build, use restricted credentials of user Gitlab::Auth::Result.new(build.user, build.project, :build, build_authentication_abilities) diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index 66b6ce1ec55..164fce5a5a3 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -578,7 +578,7 @@ module Gitlab # type_cast_function - Required if the conversion back to the original type is not automatic # batch_column_name - option for tables without a primary key, in this case # another unique integer column can be used. Example: :user_id - def undo_cleanup_concurrent_column_type_change(table, column, old_type, type_cast_function: nil, batch_column_name: :id) + def undo_cleanup_concurrent_column_type_change(table, column, old_type, type_cast_function: nil, batch_column_name: :id, limit: nil) temp_column = "#{column}_for_type_change" # Using a descriptive name that includes orinal column's name risks @@ -604,7 +604,8 @@ module Gitlab temp_undo_cleanup_column, type: old_type, batch_column_name: batch_column_name, - type_cast_function: type_cast_function + type_cast_function: type_cast_function, + limit: limit ) transaction do @@ -1489,12 +1490,13 @@ into similar problems in the future (e.g. when new tables are created). "ON DELETE #{on_delete.upcase}" end - def create_column_from(table, old, new, type: nil, batch_column_name: :id, type_cast_function: nil) + def create_column_from(table, old, new, type: nil, batch_column_name: :id, type_cast_function: nil, limit: nil) old_col = column_for(table, old) new_type = type || old_col.type + new_limit = limit || old_col.limit add_column(table, new, new_type, - limit: old_col.limit, + limit: new_limit, precision: old_col.precision, scale: old_col.scale) diff --git a/lib/gitlab/kubernetes/helm.rb b/lib/gitlab/kubernetes/helm.rb index 39bd8d5a01f..f67dfd41e22 100644 --- a/lib/gitlab/kubernetes/helm.rb +++ b/lib/gitlab/kubernetes/helm.rb @@ -3,7 +3,6 @@ module Gitlab module Kubernetes module Helm - HELM_VERSION = '2.16.9' KUBECTL_VERSION = '1.13.12' NAMESPACE = 'gitlab-managed-apps' NAMESPACE_LABELS = { 'app.gitlab.com/managed_by' => :gitlab }.freeze diff --git a/lib/gitlab/kubernetes/helm/v2/base_command.rb b/lib/gitlab/kubernetes/helm/v2/base_command.rb index 931c2248310..26c77b2149e 100644 --- a/lib/gitlab/kubernetes/helm/v2/base_command.rb +++ b/lib/gitlab/kubernetes/helm/v2/base_command.rb @@ -7,7 +7,7 @@ module Gitlab class BaseCommand attr_reader :name, :files - HELM_VERSION = '2.16.9' + HELM_VERSION = '2.17.0' def initialize(rbac:, name:, files:) @rbac = rbac |