-
Notifications
You must be signed in to change notification settings - Fork 881
feat: allow setting port share protocol #12383
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
Conversation
Looks good to me, thanks for plumbing that through, glad it was this simple of a change. I can handle the frontend if you want me to take over this PR from here. |
Can we default it to |
There is no URL in the request it's just a port, so the separate field is necessary. The frontend will default to HTTP but the API will require it as a field. |
SELECT | ||
* | ||
FROM | ||
workspace_agent_port_share | ||
WHERE | ||
workspace_id = $1 | ||
AND agent_name = $2 | ||
AND port = $3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a formatter I should be using but am somehow missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope :( I just did it manually
// list | ||
list, err := client.GetWorkspaceAgentPortShares(ctx, r.Workspace.ID) | ||
require.NoError(t, err) | ||
require.Len(t, list.Shares, 1) | ||
require.EqualValues(t, agents[0].Name, list.Shares[0].AgentName) | ||
require.EqualValues(t, 8080, list.Shares[0].Port) | ||
require.EqualValues(t, codersdk.WorkspaceAgentPortShareLevelPublic, list.Shares[0].ShareLevel) | ||
require.EqualValues(t, codersdk.WorkspaceAgentPortShareProtocolHTTPS, list.Shares[0].Protocol) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding this extra coverage
99ed006
to
c925496
Compare
@deansheather Please review my additions, and just comment since you can't review your own PR lol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Garrett's changes look good to me 👍
Adds
protocol
to port shares. Value can either behttp
orhttps
. Previous port shares default tohttp
. It's a required field in the API so clients must specify it from now on.Frontend:
