Skip to content

[server] don't error on project not_found #18400

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

Merged
merged 1 commit into from
Aug 1, 2023
Merged

Conversation

svenefftinge
Copy link
Member

@svenefftinge svenefftinge commented Aug 1, 2023

Description

We need to handle the not_found error during when projects are actually optional, i.e. during workspace start.

Related Issue(s)

Fixes WEB-628

How to test

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

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
  • 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

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Code LGTM ✅

@svenefftinge Do you want me to do some testing as well or did you already do so?

@@ -1593,9 +1607,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
const user = await this.checkAndBlockUser("getPrebuildEvents");

const project = await this.projectsService.getProject(user.id, projectId);
if (!project) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed these unnecessary checks, as getProject already throws that error

if (project && project.teamId) {
metadata.setTeam(project.teamId);
}
metadata.setTeam(workspace.organizationId);
Copy link
Member Author

Choose a reason for hiding this comment

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

no need to fetch the project as we have the org id on the workspace

@svenefftinge
Copy link
Member Author

I did not, but will do when the preview env is up

@svenefftinge svenefftinge force-pushed the se/start-ws-wo-project branch from d4bb555 to 746e0b2 Compare August 1, 2023 13:11
@svenefftinge svenefftinge force-pushed the se/start-ws-wo-project branch from 746e0b2 to 22ad9e3 Compare August 1, 2023 13:33
@roboquat roboquat added size/L and removed size/M labels Aug 1, 2023
@@ -844,17 +844,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
await this.userDeletionService.deleteUser(user.id);
}

private async getTeamMembersByProject(projectId: string | undefined): Promise<TeamMemberInfo[]> {
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 was unnecessariuly going through project. We now have an organizationId on workspaces so I replaced these with organizationService.listMembers.

@svenefftinge
Copy link
Member Author

/unhold

@roboquat roboquat merged commit ded77f3 into main Aug 1, 2023
@roboquat roboquat deleted the se/start-ws-wo-project branch August 1, 2023 13:51
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