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

Migrate CreateAndStartWorkspace method in dashboard #19076

Merged
merged 3 commits into from
Nov 22, 2023
Merged

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Nov 15, 2023

Description

Proto is based on internal doc

Summary generated by Copilot

🤖 Generated by Copilot at 748f008

This pull request adds new public API methods for creating and starting workspaces using the connect and gRPC protocols. It updates the workspace.proto file and the corresponding TypeScript and Go files with the new RPC methods and message types. It also implements the new methods in the connect client and server handlers and the gRPC server handler. The purpose of this pull request is to enable the public API to interact with the workspace's port management and tunneling features.

Related Issue(s)

Fixes #

How to test

It should be able to create/start workspace from

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

@roboquat roboquat added size/XL and removed size/L labels Nov 15, 2023
@mustard-mh mustard-mh changed the base branch from hw/papi-list-ws to main November 16, 2023 16:41
@roboquat roboquat added size/XXL and removed size/XL labels Nov 17, 2023
@mustard-mh mustard-mh changed the title [WIP] Migrate CreateAndStartWorkspace method in dashboard Migrate CreateAndStartWorkspace method in dashboard Nov 17, 2023
@mustard-mh mustard-mh marked this pull request as ready for review November 21, 2023 07:54
@mustard-mh mustard-mh requested a review from a team as a code owner November 21, 2023 07:54
@mustard-mh mustard-mh marked this pull request as draft November 21, 2023 07:55
@@ -92,4 +99,80 @@ export class WorkspaceServiceAPI implements ServiceImpl<typeof WorkspaceServiceI
response.pagination.total = resultTotal;
return response;
}

async createAndStartWorkspace(req: CreateAndStartWorkspaceRequest): Promise<CreateAndStartWorkspaceResponse> {
// We rely on FGA to do the permission checking
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Permission checking is inside WorkspaceService

Copy link
Member

Choose a reason for hiding this comment

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

✔️

@mustard-mh mustard-mh marked this pull request as ready for review November 21, 2023 08:55
@akosyakov
Copy link
Member

akosyakov commented Nov 21, 2023

@mustard-mh when I click to start a workspace from Prbuild it does not seem to start it automatically. I had a feeling it will before. Maybe I'm wrong.
Screenshot 2023-11-21 at 15 02 09

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Nov 21, 2023

mustard-mh when I click to start a workspace from Prbuild it does not seem to start it automatically. I had a feeling it will before. Maybe I'm wrong.

@akosyakov checked with Cloud, it will not start automatically too (we control whether to start it automatically via a param in URL)

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

I tested only JSON-RPC shim. It seems to work well for common scenarious. I left a question about starting a worksapce from prebuild, but maybe it is the same on main.

Please have a look at comments, add tests and address comments and merge as you think it fits.

@mustard-mh mustard-mh force-pushed the hw/papi-create-ws branch 2 times, most recently from ed9c41a to 96ad968 Compare November 22, 2023 07:21
@akosyakov
Copy link
Member

@mustard-mh do you need anything else to land it?

@mustard-mh
Copy link
Contributor Author

@akosyakov It's too hard to add unit tests, it takes me hours (). I just added it

@mustard-mh
Copy link
Contributor Author

@akosyakov Tests is based on context-parser is correct, so I rebind related stuff inside

@akosyakov
Copy link
Member

akosyakov commented Nov 22, 2023

@akosyakov It's too hard to add unit tests, it takes me hours (). I just added it

@mustard-mh if we just moved stuff and did not change much it is fine to skip. I did not imply you need to add tests for everything only for things which we rather changed, please find a balance 🙏

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Nov 22, 2023

Unit tests were passed. But it seems will cause some conflict between unit-test, I will mark them with .skip Resolved

image

@mustard-mh mustard-mh force-pushed the hw/papi-create-ws branch 3 times, most recently from e9df853 to 9e84b3d Compare November 22, 2023 15:02
@mustard-mh
Copy link
Contributor Author

Rebased to main, let's unhold after final test

@mustard-mh
Copy link
Contributor Author

Tested in preview env ✅

/unhold

@roboquat roboquat merged commit fa3cca4 into main Nov 22, 2023
15 of 16 checks passed
@roboquat roboquat deleted the hw/papi-create-ws branch November 22, 2023 16:24
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.

5 participants