Skip to content

Conversation

@geropl
Copy link
Member

@geropl geropl commented Dec 6, 2024

Description

This is a POC of "multi-orgs in Dedicated", which comes with two main changesets:

  1. enablement of admin-user
  2. minor streamlining on the UI

admin-user

The core idea is that we enable the admin-user to perform all cross-organization operations ("create org", "configure SSO", etc.).

This approach has a couple of benefits:

  • we don't have to introduce a new concept
  • admin-user already address lot of "2nd day issues", e.g. re-logging into an org even in case of SSO misconfiguration, or manual removal, etc.).
  • we could use this opportunity to actually clean some things up_ conceptually (e.g. how we differentiate between dedicated/not-dedicated, plus some permission special cases)

A limitation is that user who is configuring SSO
for a new organization needs to be able to login using that SSO - which is the same flow as we have today. This is fine, because it works for the current actual usecase.

Another issue not addressed here is "how does a user get hold of the admin link". This is solved out-of-band for the current usecase.

UI

There is one main change, which is the introduction of the /?orgSlug= parameter, which is checked across the dashboard and selects one of your organizations. It's especially understood by /login: This solves the use case of "first time user onboards into correct organization".

Related Issue(s)

Fixes CLC-970

How to test

UI

Setup

  • create a branch from this PR
  • enable the feature flag enable_multi_org for your branch
  • run export GITPOD_WITH_DEDICATED_EMU=true; leeway run dev:preview
  • in your preview, login using an admin link and configure the 1st and 2nd org (using SSO apps from here)

Documentation

Preview status

gitpod:summary

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

…ace isSIngleOrgInstallation

incl. further cleanup around getConfiguration and server config
… and replace is with getInstallationConfiguration.IsDedicatedInstallation
… in a "create workspace" URL (e.g. "/?orgSlug=org1#github.com/my/repo")
@geropl geropl requested review from a team as code owners December 6, 2024 15:16
@geropl geropl changed the title [dashboard] introduce "/?orgSlug=", which allows to pre-select an org in a "create workspace" URL (e.g. "/?orgSlug=org1#github.com/my/repo") [server, dashboard] Introduce multi-org (behind feature flag) Dec 6, 2024
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, let's :shipit: this bad boy.

Left a couple minor comments

}

async createOrganization(userId: string, name: string): Promise<Organization> {
// TODO(gpl): Should we use the authorization layer to make this decision?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted to, could we? Does spicedb allow these conditional decisions from the schema depending on the installation config?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's static, we could also make it a relation. But there's also a way to attach data to a request, and "dynamic" rules that can decide based on that data.

But anyway, this is more speculative, as I don't see it being worth the effort to pull off right now.

@geropl geropl force-pushed the gpl/970-multi-org branch from eac3aed to 2fa6e93 Compare December 9, 2024 10:19
@geropl
Copy link
Member Author

geropl commented Dec 9, 2024

@filiptronicek I fixed the tests + special tests for the "can't create/join org" cases in this separate PR, too ease reviewing: #20436

I don't see the point in separating it from this PR completely, so we'll just wait for that merge. 👍

* fix tests for real

* [server] Create OrgService.createOrgOwnedUser, and use that across tests to fix the "can't join org" permission issues

* Update components/server/src/orgs/organization-service.ts

Co-authored-by: Filip Troníček <[email protected]>

---------

Co-authored-by: Filip Troníček <[email protected]>
@roboquat roboquat added size/XXL and removed size/XL labels Dec 9, 2024
@geropl
Copy link
Member Author

geropl commented Dec 9, 2024

/unhold

@roboquat roboquat merged commit 7f43d48 into main Dec 9, 2024
18 checks passed
@roboquat roboquat deleted the gpl/970-multi-org branch December 9, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants