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

[papi] add watchWorkspace API #19010

Merged
merged 11 commits into from
Nov 8, 2023
Merged

[papi] add watchWorkspace API #19010

merged 11 commits into from
Nov 8, 2023

Conversation

mustard-mh
Copy link
Contributor

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

Description

Summary generated by Copilot

🤖 Generated by Copilot at 4ac219e

This pull request adds a new feature to the WorkspaceService service that allows clients to stream updates about the status of a workspace. It defines the new WatchWorkspace RPC method and its message types in the workspace.proto file, and implements it in the server component using the connect and grpc libraries. It also adds support for the new method to the TypeScript client library. Additionally, it updates the @types/node dependency to a compatible version.

Related Issue(s)

Fixes #

How to test

With debug commit (hot-deployed) 50e7527

  • Open preview env, and use DevTool Console window.$testWatch to watch status
  • Try to enable / disable dashboard_public_api_enabled feature flag
  • Re watchWorkspaces, it should works
  • Abort public api one, we should see logging ======dispose in server

✅ Test result share

JSON RPC gRPC
image image imageimage

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

socket-security bot commented Nov 3, 2023

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
event-iterator 2.0.0 None +0 40 kB rolftimmermans
@types/node 16.11.6...16.18.61 None +0/-0 3.51 MB types
@types/node 16.11.6...18.18.8 None +2/-0 3.95 MB types

@roboquat roboquat added size/XL and removed size/L labels Nov 7, 2023
@mustard-mh mustard-mh marked this pull request as ready for review November 7, 2023 19:43
@mustard-mh mustard-mh requested a review from a team as a code owner November 7, 2023 19:43
@mustard-mh mustard-mh marked this pull request as draft November 7, 2023 19:43

message WatchWorkspaceStatusResponse {
// workspace_id is the ID of the workspace that has status updated
string workspace_id = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need workspace_id since there's no workspace_id field in WorkspaceStatus

@mustard-mh mustard-mh marked this pull request as ready for review November 7, 2023 19:46
if (req.workspaceId && instance.workspaceId !== req.workspaceId) {
continue;
}
const status = this.apiConverter.toWorkspace(instance).status;
Copy link
Member

Choose a reason for hiding this comment

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

to me to understand if here happens some exception what happens with it?

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.

pre approved since it is not really used

but please look at comments, for async generator adding extensive tests would be helpful, we should be careful with its lifecycle

@mustard-mh mustard-mh changed the title WIP [papi] add watchWorkspace API [papi] add watchWorkspace API Nov 8, 2023
@mustard-mh
Copy link
Contributor Author

  • Added some unit tests for asyncIterator generate.
  • Tested with preview env that refresh webview will make connect-es 's context receive Abort Signal too.

Going to remove test commits and merge

@mustard-mh
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 70a0f12 into main Nov 8, 2023
13 of 14 checks passed
@roboquat roboquat deleted the hw/watch-workspace branch November 8, 2023 15: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.

3 participants