Cells 2nd Cell should share User Sessions with the primary cell
Background
As part of the ongoing project on the Cells project, we previously have added support to GDK to create another Cell that shares the main_clusterside
tables with the first existing GDK (Cell1). You can find these instructions here
This MR has extended this work to solve the problem referenced in this issue, which is enable Users Sharing Sessions between these two cells. Which would solve the problem of: When a user signs in on Cell1 or Cell2, they will also be signed in the other Cell.
In order to solve this problem [three problems that have be solved], and this is what this MR is addressing:
-
secret_key_base
has to be the same. Seeconfig/secrets.yml
-
cookie_key has
to be the same. Seeconfig/initializers/session_store.rb
- Redis Session Store should be the same. Ideally GDK2 should point to the Redis Sessions of GDK1. See
config/redis.sessions.yml
As part of this [previously merged MR], We have prepared the GitLab application itself to address point (2), and have a configurable user session cookie_key
.
What does this merge request do and why?
This MR extends the script ./support/cells-add-secondary
to configure GDK2 to address the 3 points above. The end goal would like this following diagram:
(this is an editable png via draw.io tool)
How to set up and validate locally
- From your current
gdk
directory, pull this development branch1894-user-session-shared-between-cells
- Follow the instructions here to setup GDK Cell2: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/cells.md?ref_type=heads
- After GDK Cell2 is up and running on http://localhost:3001, Make sure you are logged out on Cell1 http://localhost:3000. Then try to login on Cell1. Refresh http://localhost:3001 and you will see that you have been automatically logged in.
- Log out from Cell1, and you will see that you have been logged out as well from Cell 2 on
localhost:3001
- Make sure you switch back to the
main
branch ongdk
Known issues
- Logging in or out from Cell2 is broken at the moment, and it will be solved in another issue: gitlab#421597 (closed)
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Closes #1894 (closed)