Skip to content

Use workspaceStatus stream rpc in supervisor #15403

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
Jan 12, 2023
Merged

Use workspaceStatus stream rpc in supervisor #15403

merged 1 commit into from
Jan 12, 2023

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Dec 18, 2022

Description

Use workspaceStatus stream rpc in supervisor

Requires #15451

Related #15383

How to test

Open a workspace and check port view updates successfully when changing port state to public/private

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-hw-pub-stream.3 because the annotations in the pull request description changed
(with .werft/ from main)

@jeanp413 jeanp413 force-pushed the hw/pub-stream branch 2 times, most recently from f6fd8d7 to 4ba5e33 Compare December 20, 2022 15:12
@roboquat roboquat added size/XL and removed size/L labels Dec 21, 2022
@jeanp413 jeanp413 marked this pull request as ready for review December 21, 2022 06:19
@jeanp413 jeanp413 requested review from a team December 21, 2022 06:19
@jeanp413
Copy link
Member

/hold

@github-actions github-actions bot added team: SID team: IDE team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team labels Dec 21, 2022
@mustard-mh mustard-mh removed team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team team: SID labels Jan 10, 2023
Comment on lines +406 to +418
if port.Policy == v1.PortPolicy_PORT_POLICY_PUBLIC {
info.Visibility = gitpod.PortVisibilityPublic
} else {
info.Visibility = gitpod.PortVisibilityPrivate
}
Copy link
Member

Choose a reason for hiding this comment

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

PortPolicy is one of 3 values:

	PortPolicy_PORT_POLICY_UNSPECIFIED PortPolicy = 0
	// Private means the port is accessible by the workspace owner only using the workspace port URL
	PortPolicy_PORT_POLICY_PRIVATE PortPolicy = 1
	// Public means the port is accessible by everybody using the workspace port URL
	PortPolicy_PORT_POLICY_PUBLIC PortPolicy = 2

Use a switch here and handle them all. This ensures that you actually detect cases where the port policy is not set (UNSPECIFIED)

Copy link
Member

Choose a reason for hiding this comment

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

It's the same as here, it can only be public or private and if for some reason is unspecified it should convert to private either way 🤔

if port.Policy == v1.PortPolicy_PORT_POLICY_PUBLIC {
info.Visibility = gitpod.PortVisibilityPublic
} else {
info.Visibility = gitpod.PortVisibilityPrivate
}

@mustard-mh mustard-mh marked this pull request as draft January 10, 2023 13:17
@jeanp413 jeanp413 marked this pull request as ready for review January 11, 2023 03:37
@mustard-mh mustard-mh marked this pull request as draft January 11, 2023 12:20
@mustard-mh mustard-mh force-pushed the hw/pub-stream branch 2 times, most recently from f98130f to 829f1ea Compare January 11, 2023 18:49
@mustard-mh mustard-mh marked this pull request as ready for review January 12, 2023 09:30
Co-authored-by: mustard <[email protected]>
Co-authored-by: Jean Pierre <[email protected]>
@mustard-mh
Copy link
Contributor Author

Test with

  • Switch configcat flag, traffic of instanceUpdates can be switched between server and public API
  • Scale down server / public API, and scale up, it can reconnect

@mustard-mh
Copy link
Contributor Author

/unhold

@mustard-mh
Copy link
Contributor Author

mustard-mh commented Jan 12, 2023

/werft run

👍 started the job as gitpod-build-hw-pub-stream.19
(with .werft/ from main)

@roboquat roboquat merged commit 228cf59 into main Jan 12, 2023
@roboquat roboquat deleted the hw/pub-stream branch January 12, 2023 10:01
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production feature: public-api Issues relating to Public API release-note-none size/L team: IDE
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants