summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-17 17:15:21 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-17 17:15:21 +0000
commit76044a792737e4b966be861b68947d289539c66e (patch)
tree6355ac9d8b54beb5e6e0fd8fe6d28a464f8a5395
parentf63ce3000c16c04b7a7d5200c5da7c07b9af0cf2 (diff)
downloadgitlab-ce-76044a792737e4b966be861b68947d289539c66e.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-ee
-rw-r--r--GITLAB_KAS_VERSION2
-rw-r--r--app/controllers/admin/users_controller.rb2
-rw-r--r--app/controllers/concerns/project_unauthorized.rb2
-rw-r--r--app/controllers/concerns/routable_actions.rb20
-rw-r--r--app/controllers/groups/application_controller.rb2
-rw-r--r--app/controllers/groups/clusters/applications_controller.rb2
-rw-r--r--app/controllers/groups/clusters/integrations_controller.rb2
-rw-r--r--app/controllers/groups/clusters_controller.rb2
-rw-r--r--app/controllers/profiles/groups_controller.rb2
-rw-r--r--app/controllers/projects/application_controller.rb2
-rw-r--r--app/controllers/projects/clusters/applications_controller.rb2
-rw-r--r--app/controllers/projects/clusters/integrations_controller.rb2
-rw-r--r--app/controllers/projects/clusters_controller.rb2
-rw-r--r--app/controllers/users_controller.rb2
-rw-r--r--app/models/namespace/traversal_hierarchy.rb8
-rw-r--r--doc/administration/geo/replication/disable_geo.md1
-rw-r--r--doc/administration/geo/replication/version_specific_updates.md10
-rw-r--r--locale/gitlab.pot5
-rw-r--r--spec/controllers/concerns/routable_actions_spec.rb4
19 files changed, 41 insertions, 33 deletions
diff --git a/GITLAB_KAS_VERSION b/GITLAB_KAS_VERSION
index 7b3b6e02bb3..26f2bbc1975 100644
--- a/GITLAB_KAS_VERSION
+++ b/GITLAB_KAS_VERSION
@@ -1 +1 @@
-14.1.0
+14.1.1
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 700acc46d8d..145b4d10b16 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -304,7 +304,7 @@ class Admin::UsersController < Admin::ApplicationController
end
def user
- @user ||= find_routable!(User, params[:id])
+ @user ||= find_routable!(User, params[:id], request.path_info)
end
def build_canonical_path(user)
diff --git a/app/controllers/concerns/project_unauthorized.rb b/app/controllers/concerns/project_unauthorized.rb
index 7238840440f..b58f6589f9b 100644
--- a/app/controllers/concerns/project_unauthorized.rb
+++ b/app/controllers/concerns/project_unauthorized.rb
@@ -3,7 +3,7 @@
module ProjectUnauthorized
module ControllerActions
def self.on_routable_not_found
- lambda do |routable|
+ lambda do |routable, path_info|
return unless routable.is_a?(Project)
label = routable.external_authorization_classification_label
diff --git a/app/controllers/concerns/routable_actions.rb b/app/controllers/concerns/routable_actions.rb
index 7257378f465..57108369c64 100644
--- a/app/controllers/concerns/routable_actions.rb
+++ b/app/controllers/concerns/routable_actions.rb
@@ -3,13 +3,13 @@
module RoutableActions
extend ActiveSupport::Concern
- def find_routable!(routable_klass, requested_full_path, extra_authorization_proc: nil)
- routable = routable_klass.find_by_full_path(requested_full_path, follow_redirects: request.get?)
+ def find_routable!(routable_klass, routable_full_path, path_info, extra_authorization_proc: nil)
+ routable = routable_klass.find_by_full_path(routable_full_path, follow_redirects: request.get?)
if routable_authorized?(routable, extra_authorization_proc)
- ensure_canonical_path(routable, requested_full_path)
+ ensure_canonical_path(routable, routable_full_path)
routable
else
- perform_not_found_actions(routable, not_found_actions)
+ perform_not_found_actions(routable, not_found_actions, path_info)
route_not_found unless performed?
@@ -21,11 +21,11 @@ module RoutableActions
[ProjectUnauthorized::ControllerActions.on_routable_not_found]
end
- def perform_not_found_actions(routable, actions)
+ def perform_not_found_actions(routable, actions, path_info)
actions.each do |action|
break if performed?
- instance_exec(routable, &action)
+ instance_exec(routable, path_info, &action)
end
end
@@ -42,13 +42,13 @@ module RoutableActions
end
end
- def ensure_canonical_path(routable, requested_full_path)
+ def ensure_canonical_path(routable, routable_full_path)
return unless request.get?
canonical_path = routable.full_path
- if canonical_path != requested_full_path
- if !request.xhr? && request.format.html? && canonical_path.casecmp(requested_full_path) != 0
- flash[:notice] = "#{routable.class.to_s.titleize} '#{requested_full_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path."
+ if canonical_path != routable_full_path
+ if !request.xhr? && request.format.html? && canonical_path.casecmp(routable_full_path) != 0
+ flash[:notice] = "#{routable.class.to_s.titleize} '#{routable_full_path}' was moved to '#{canonical_path}'. Please update any links and bookmarks that may still have the old path."
end
redirect_to build_canonical_path(routable), status: :moved_permanently
diff --git a/app/controllers/groups/application_controller.rb b/app/controllers/groups/application_controller.rb
index f6c71ac8087..69081835c4d 100644
--- a/app/controllers/groups/application_controller.rb
+++ b/app/controllers/groups/application_controller.rb
@@ -24,7 +24,7 @@ class Groups::ApplicationController < ApplicationController
end
def group
- @group ||= find_routable!(Group, params[:group_id] || params[:id])
+ @group ||= find_routable!(Group, params[:group_id] || params[:id], request.path_info)
end
def group_projects
diff --git a/app/controllers/groups/clusters/applications_controller.rb b/app/controllers/groups/clusters/applications_controller.rb
index 8dd8a01cf40..ce6fda4143c 100644
--- a/app/controllers/groups/clusters/applications_controller.rb
+++ b/app/controllers/groups/clusters/applications_controller.rb
@@ -13,6 +13,6 @@ class Groups::Clusters::ApplicationsController < Clusters::ApplicationsControlle
end
def group
- @group ||= find_routable!(Group, params[:group_id] || params[:id])
+ @group ||= find_routable!(Group, params[:group_id] || params[:id], request.path_info)
end
end
diff --git a/app/controllers/groups/clusters/integrations_controller.rb b/app/controllers/groups/clusters/integrations_controller.rb
index e8c8a14c164..61b308f7d1b 100644
--- a/app/controllers/groups/clusters/integrations_controller.rb
+++ b/app/controllers/groups/clusters/integrations_controller.rb
@@ -13,6 +13,6 @@ class Groups::Clusters::IntegrationsController < Clusters::IntegrationsControlle
end
def group
- @group ||= find_routable!(Group, params[:group_id] || params[:id])
+ @group ||= find_routable!(Group, params[:group_id] || params[:id], request.path_info)
end
end
diff --git a/app/controllers/groups/clusters_controller.rb b/app/controllers/groups/clusters_controller.rb
index 33bfc24885f..6f3eecf8296 100644
--- a/app/controllers/groups/clusters_controller.rb
+++ b/app/controllers/groups/clusters_controller.rb
@@ -15,7 +15,7 @@ class Groups::ClustersController < Clusters::ClustersController
end
def group
- @group ||= find_routable!(Group, params[:group_id] || params[:id])
+ @group ||= find_routable!(Group, params[:group_id] || params[:id], request.path_info)
end
def metrics_dashboard_params
diff --git a/app/controllers/profiles/groups_controller.rb b/app/controllers/profiles/groups_controller.rb
index e76ee0a6cea..2571e92e071 100644
--- a/app/controllers/profiles/groups_controller.rb
+++ b/app/controllers/profiles/groups_controller.rb
@@ -6,7 +6,7 @@ class Profiles::GroupsController < Profiles::ApplicationController
feature_category :users
def update
- group = find_routable!(Group, params[:id])
+ group = find_routable!(Group, params[:id], request.path_info)
notification_setting = current_user.notification_settings_for(group)
if notification_setting.update(update_params)
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index ca2692438e8..cf2ecb0673e 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -26,7 +26,7 @@ class Projects::ApplicationController < ApplicationController
path = File.join(params[:namespace_id], params[:project_id] || params[:id])
auth_proc = ->(project) { !project.pending_delete? }
- @project = find_routable!(Project, path, extra_authorization_proc: auth_proc)
+ @project = find_routable!(Project, path, request.path_info, extra_authorization_proc: auth_proc)
end
def build_canonical_path(project)
diff --git a/app/controllers/projects/clusters/applications_controller.rb b/app/controllers/projects/clusters/applications_controller.rb
index 2a04b007304..6c5778124e8 100644
--- a/app/controllers/projects/clusters/applications_controller.rb
+++ b/app/controllers/projects/clusters/applications_controller.rb
@@ -10,6 +10,6 @@ class Projects::Clusters::ApplicationsController < Clusters::ApplicationsControl
end
def project
- @project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]))
+ @project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]), request.path_info)
end
end
diff --git a/app/controllers/projects/clusters/integrations_controller.rb b/app/controllers/projects/clusters/integrations_controller.rb
index 94b8dd653e6..eed6c1dccc4 100644
--- a/app/controllers/projects/clusters/integrations_controller.rb
+++ b/app/controllers/projects/clusters/integrations_controller.rb
@@ -10,6 +10,6 @@ class Projects::Clusters::IntegrationsController < ::Clusters::IntegrationsContr
end
def project
- @project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]))
+ @project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]), request.path_info)
end
end
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb
index 8acf5235c1a..0aef497d28d 100644
--- a/app/controllers/projects/clusters_controller.rb
+++ b/app/controllers/projects/clusters_controller.rb
@@ -17,7 +17,7 @@ class Projects::ClustersController < Clusters::ClustersController
end
def project
- @project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]))
+ @project ||= find_routable!(Project, File.join(params[:namespace_id], params[:project_id]), request.path_info)
end
def repository
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 7282fc26121..1b927afdcf5 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -172,7 +172,7 @@ class UsersController < ApplicationController
private
def user
- @user ||= find_routable!(User, params[:username])
+ @user ||= find_routable!(User, params[:username], request.path_info)
end
def personal_projects
diff --git a/app/models/namespace/traversal_hierarchy.rb b/app/models/namespace/traversal_hierarchy.rb
index 093b7dae246..34086a8af5d 100644
--- a/app/models/namespace/traversal_hierarchy.rb
+++ b/app/models/namespace/traversal_hierarchy.rb
@@ -36,7 +36,7 @@ class Namespace
SET traversal_ids = cte.traversal_ids
FROM (#{recursive_traversal_ids}) as cte
WHERE namespaces.id = cte.id
- AND namespaces.traversal_ids <> cte.traversal_ids
+ AND namespaces.traversal_ids::bigint[] <> cte.traversal_ids
"""
Namespace.transaction do
@root.lock!
@@ -51,7 +51,7 @@ class Namespace
def incorrect_traversal_ids
Namespace
.joins("INNER JOIN (#{recursive_traversal_ids}) as cte ON namespaces.id = cte.id")
- .where('namespaces.traversal_ids <> cte.traversal_ids')
+ .where('namespaces.traversal_ids::bigint[] <> cte.traversal_ids')
end
private
@@ -66,9 +66,9 @@ class Namespace
<<~SQL
WITH RECURSIVE cte(id, traversal_ids, cycle) AS (
- VALUES(#{root_id}, ARRAY[#{root_id}], false)
+ VALUES(#{root_id}::bigint, ARRAY[#{root_id}]::bigint[], false)
UNION ALL
- SELECT n.id, cte.traversal_ids || n.id, n.id = ANY(cte.traversal_ids)
+ SELECT n.id, cte.traversal_ids || n.id::bigint, n.id = ANY(cte.traversal_ids)
FROM namespaces n, cte
WHERE n.parent_id = cte.id AND NOT cycle
)
diff --git a/doc/administration/geo/replication/disable_geo.md b/doc/administration/geo/replication/disable_geo.md
index ba01c55a157..485a5ee1950 100644
--- a/doc/administration/geo/replication/disable_geo.md
+++ b/doc/administration/geo/replication/disable_geo.md
@@ -35,6 +35,7 @@ to do that.
To remove the **primary** site:
+1. [Remove all secondary Geo sites](remove_geo_site.md)
1. On the top bar, select **Menu >** **{admin}** **Admin**.
1. On the left sidebar, select **Geo > Nodes**.
1. Select **Remove** for the **primary** node.
diff --git a/doc/administration/geo/replication/version_specific_updates.md b/doc/administration/geo/replication/version_specific_updates.md
index e193fc630b9..155c06f90b8 100644
--- a/doc/administration/geo/replication/version_specific_updates.md
+++ b/doc/administration/geo/replication/version_specific_updates.md
@@ -11,6 +11,16 @@ Review this page for update instructions for your version. These steps
accompany the [general steps](updating_the_geo_nodes.md#general-update-steps)
for updating Geo nodes.
+## Updating to GitLab 14.0/14.1
+
+We found an issue where [Primary sites can not be removed from the UI](https://gitlab.com/gitlab-org/gitlab/-/issues/338231).
+
+This bug only exists in the UI and does not block the removal of Primary sites using any other method.
+
+### If you have already updated to an affected version and need to remove your Primary site
+
+You can manually remove the Primary site by using the [Geo Nodes API](../../../api/geo_nodes.md#delete-a-geo-node).
+
## Updating to GitLab 13.12
We found an issue where [secondary nodes re-download all LFS files](https://gitlab.com/gitlab-org/gitlab/-/issues/334550) upon update. This bug:
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 7e0f6f0b2c5..70a16069eb0 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -14668,13 +14668,10 @@ msgstr ""
msgid "Geo|Remove node"
msgstr ""
-msgid "Geo|Remove secondary node"
-msgstr ""
-
msgid "Geo|Remove tracking database entry"
msgstr ""
-msgid "Geo|Removing a Geo secondary node stops the synchronization to that node. Are you sure?"
+msgid "Geo|Removing a Geo node stops the synchronization to and from that node. Are you sure?"
msgstr ""
msgid "Geo|Replicated data is verified with the secondary node(s) using checksums"
diff --git a/spec/controllers/concerns/routable_actions_spec.rb b/spec/controllers/concerns/routable_actions_spec.rb
index f28f990ecbb..11eb2ab1c2a 100644
--- a/spec/controllers/concerns/routable_actions_spec.rb
+++ b/spec/controllers/concerns/routable_actions_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe RoutableActions do
def routable
@klass = params[:type].constantize
- @routable = find_routable!(params[:type].constantize, params[:id])
+ @routable = find_routable!(params[:type].constantize, params[:id], '/')
end
def show
@@ -135,7 +135,7 @@ RSpec.describe RoutableActions do
end
it 'performs checks in the context of the controller' do
- check = lambda { |routable| redirect_to routable }
+ check = lambda { |routable, path_info| redirect_to routable }
allow(subject).to receive(:not_found_actions).and_return([check])
get_routable(routable)