Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gpl/970-multi-org-tests #20436

Merged
merged 3 commits into from
Dec 9, 2024
Merged

Gpl/970-multi-org-tests #20436

merged 3 commits into from
Dec 9, 2024

Conversation

geropl
Copy link
Member

@geropl geropl commented Dec 9, 2024

Description

Fixes the tests after the latest "not allowed to join org" changes

Related Issue(s)

Fixes #

How to test

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

@@ -473,4 +473,54 @@ describe("OrganizationService", async () => {
);
await assertUpdateSettings("should enable workspace sharing", { workspaceSharingDisabled: false }, {});
});

it("org-owned users can't create new organizations", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

@filiptronicek These are the core tests added

/**
* Conveniece method, analogue to UserService.createUser()
*/
public async createOrgOwnedUser(params: CreateUserParams & { organizationId: string }): Promise<User> {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the method that before was buried in IamSessionApp.

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.

LGTM 🚀

components/server/src/orgs/organization-service.ts Outdated Show resolved Hide resolved
Co-authored-by: Filip Troníček <filip@gitpod.io>
@geropl
Copy link
Member Author

geropl commented Dec 9, 2024

/unhold

@roboquat roboquat merged commit cf3a7e9 into gpl/970-multi-org Dec 9, 2024
5 checks passed
@roboquat roboquat deleted the gpl/970-multi-org-tests branch December 9, 2024 12:42
roboquat pushed a commit that referenced this pull request Dec 9, 2024
* [server config] Introduce isDedicatedInstallation, and use it to replace isSIngleOrgInstallation

incl. further cleanup around getConfiguration and server config

* [server, dashboard] Remove enableDedicatedOnboardingFlow feature flag and replace is with getInstallationConfiguration.IsDedicatedInstallation

* [dashboard, server] Remove "sinlgeOrgMode"

* [server] OrganizationService: block createTeam consistently for org-owned users

* [server, dashboard] Introduce "enable_multi_org" feature flag to allow admin-user to create organizations

* [dashboard] introduce "/?orgSlug=", which allows to pre-select an org in a "create workspace" URL (e.g. "/?orgSlug=org1#github.com/my/repo")

* [db] Auto-delete container "test-mysql" if it's already present

* fix tests

* [dashboard] Check if localStorage is available before using it

* [dashboard] SSOLogin: fix orgSlug source precedence to: path/search/localStorage

* [server] Deny "joinOrganization" for org-owned users

* Gpl/970-multi-org-tests (#20436)

* 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 <filip@gitpod.io>

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>

---------

Co-authored-by: Filip Troníček <filip@gitpod.io>
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