Skip to content

Cells 2nd Cell should share User Sessions with the primary cell

Omar Qunsul requested to merge 1894-user-session-shared-between-cells into main

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:

  1. secret_key_base has to be the same. See config/secrets.yml
  2. cookie_key has to be the same. See config/initializers/session_store.rb
  3. 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) GDK_Cells

How to set up and validate locally

  1. From your current gdk directory, pull this development branch 1894-user-session-shared-between-cells
  2. 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
  3. 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.
  4. Log out from Cell1, and you will see that you have been logged out as well from Cell 2 on localhost:3001
  5. Make sure you switch back to the main branch on gdk

Known issues

  1. 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:

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 the CHANGELOG.md.

Closes #1894 (closed)

Edited by Omar Qunsul

Merge request reports