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

feat(ws): add http service paths to WS get on backend #213

Open
wants to merge 5 commits into
base: notebooks-v2
Choose a base branch
from

Conversation

yehudit1987
Copy link

This PR is for adding missing ports field to workspace model.

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kimwnasptd for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@thesuperzapper
Copy link
Member

/ok-to-test

Ports []ImagePort `json:"ports,omitempty"`
}

type ImagePort struct {
Copy link
Member

@thesuperzapper thesuperzapper Feb 20, 2025

Choose a reason for hiding this comment

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

@yehudit1987 it might be more useful for the frontend if we do something more abstract like "services" (which initially only includes "HTTP" type services).

That makes it a bit easier to populate the front-end "connect" box, because rather than constructing the HTTP path in the front end we could just include the httpPath (relative to the UI base, not absolute) rather than constructing it in the front end.

Also, stuff like "port number" don't need to be included because this is hidden from the end user.

For example (written in YAML for clarity, but payload is JSON in app):

...
  services:
    - httpService:
       displayName: "XXXXX"
       httpPath: "/workspace/{namespace}/{workspace_name}/{port_id}/

Copy link
Author

Choose a reason for hiding this comment

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

Hey @thesuperzapper, thanks for the review! I totally agree with your suggestion—it makes more sense. I initially followed the frontend mock, but once the PR is approved, I'll update the frontend accordingly. Also, I’ve moved the location in the struct; hope that makes sense to you as well!

Yehudit Kerido added 2 commits February 24, 2025 10:25
@yehudit1987 yehudit1987 marked this pull request as ready for review February 24, 2025 13:33
Copy link
Member

@ederign ederign left a comment

Choose a reason for hiding this comment

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

@yehudit1987 thank you for the PR. Just two small comments there.

if len(val.Spec.Ports) == 0 {
continue
}
firstPort := val.Spec.Ports[0]
Copy link
Member

Choose a reason for hiding this comment

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

// ports that the container listens on
	//   - if multiple ports are defined, the user will see multiple "Connect" buttons
	//     in a dropdown menu on the Workspace overview page
	// +kubebuilder:validation:MinItems:=1
	// +listType:="map"
	// +listMapKey:="id"
	Ports []ImagePort `json:"ports"`	

Shall we support here multiple ports here?

Copy link
Member

Choose a reason for hiding this comment

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

Or we deliberatelly are going to always use the first port here?

Copy link
Member

Choose a reason for hiding this comment

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

@thesuperzapper maybe you can chime in on this one. ^

I'm good to support just one for now and do a FUP PR on it.

Copy link
Author

Choose a reason for hiding this comment

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

@ederign I think it's a mistake (mine). Will fix it soon.

Copy link
Member

Choose a reason for hiding this comment

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

No worries @yehudit1987 ! Thank you for the PR

if displayName == "" {
displayName = val.Id
}
basePath := "/workspace"
Copy link
Member

Choose a reason for hiding this comment

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

Just out of my curiosity, where this /workspace path comes from?

@ederign
Copy link
Member

ederign commented Feb 27, 2025

/assign @ederign

Yehudit Kerido added 2 commits February 27, 2025 16:28
@thesuperzapper thesuperzapper changed the title feat(ws): Notebooks 2.0 // Backend// Add missing field feat(ws): add http service paths to WS get on backend Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

3 participants