diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 06:08:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 06:08:02 +0300 |
commit | ed73d4f207ef6cb8646719baa1188d096c9f3139 (patch) | |
tree | dea7ab9906154c73204a0361163e30500f929d44 /lib/gitlab | |
parent | 2349eabc1a473bfb70555f0ce6d3d808cecb181d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb | 14 | ||||
-rw-r--r-- | lib/gitlab/gon_helper.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/hashed_storage/rake_helper.rb | 14 |
3 files changed, 14 insertions, 15 deletions
diff --git a/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb b/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb index b47238a3083..65445ab3fc4 100644 --- a/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb +++ b/lib/gitlab/ci/build/prerequisite/kubernetes_namespace.rb @@ -8,7 +8,7 @@ module Gitlab def unmet? deployment_cluster.present? && deployment_cluster.managed? && - (missing_namespace? || missing_knative_version_role_binding?) + (missing_namespace? || need_knative_version_role_binding?) end def complete! @@ -23,8 +23,8 @@ module Gitlab kubernetes_namespace.nil? || kubernetes_namespace.service_account_token.blank? end - def missing_knative_version_role_binding? - knative_version_role_binding.nil? + def need_knative_version_role_binding? + !knative_serving_namespace.nil? && knative_version_role_binding.nil? end def deployment_cluster @@ -35,6 +35,14 @@ module Gitlab build.deployment.environment end + def knative_serving_namespace + strong_memoize(:knative_serving_namespace) do + Clusters::KnativeServingNamespaceFinder.new( + deployment_cluster + ).execute + end + end + def knative_version_role_binding strong_memoize(:knative_version_role_binding) do Clusters::KnativeVersionRoleBindingFinder.new( diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index 2616a19fdaa..487dcd58d01 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -42,6 +42,7 @@ module Gitlab # Initialize gon.features with any flags that should be # made globally available to the frontend push_frontend_feature_flag(:suppress_ajax_navigation_errors, default_enabled: true) + push_frontend_feature_flag(:snippets_vue, default_enabled: false) end # Exposes the state of a feature flag to the frontend code. diff --git a/lib/gitlab/hashed_storage/rake_helper.rb b/lib/gitlab/hashed_storage/rake_helper.rb index 14727b03ce9..7965f165683 100644 --- a/lib/gitlab/hashed_storage/rake_helper.rb +++ b/lib/gitlab/hashed_storage/rake_helper.rb @@ -47,23 +47,13 @@ module Gitlab end # rubocop: enable CodeReuse/ActiveRecord - # rubocop: disable CodeReuse/ActiveRecord def self.legacy_attachments_relation - Upload.joins(<<~SQL).where('projects.storage_version < :version OR projects.storage_version IS NULL', version: Project::HASHED_STORAGE_FEATURES[:attachments]) - JOIN projects - ON (uploads.model_type='Project' AND uploads.model_id=projects.id) - SQL + Upload.inner_join_local_uploads_projects.merge(Project.without_storage_feature(:attachments)) end - # rubocop: enable CodeReuse/ActiveRecord - # rubocop: disable CodeReuse/ActiveRecord def self.hashed_attachments_relation - Upload.joins(<<~SQL).where('projects.storage_version >= :version', version: Project::HASHED_STORAGE_FEATURES[:attachments]) - JOIN projects - ON (uploads.model_type='Project' AND uploads.model_id=projects.id) - SQL + Upload.inner_join_local_uploads_projects.merge(Project.with_storage_feature(:attachments)) end - # rubocop: enable CodeReuse/ActiveRecord def self.relation_summary(relation_name, relation) relation_count = relation.count |