Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

brettkolodny
Copy link
Contributor

@brettkolodny brettkolodny marked this pull request as ready for review September 10, 2025 16:28
Copy link
Member

@aslilac aslilac left a comment

Choose a reason for hiding this comment

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

mostly looks good! main concern is just that we should not take an --org flag

)
clitest.SetupConfig(t, workspaceOwnerClient, root)

out := bytes.NewBuffer(nil)
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
out := bytes.NewBuffer(nil)
out := new(bytes.Buffer)

https://pkg.go.dev/bytes#NewBuffer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved in this commit

Comment on lines 2219 to 2220
// `GetGroups` returns all groups in the org if `GroupIds` is empty so we check
// the length before making the DB call.
Copy link
Member

Choose a reason for hiding this comment

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

oops! good catch!

are you sure it's just all groups in the org tho? how would it know which org? looking at the query it seems like it would just return every group regardless of org.

Suggested change
// `GetGroups` returns all groups in the org if `GroupIds` is empty so we check
// the length before making the DB call.
// `GetGroups` returns all groups if `GroupIds` is empty so we check the length first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved in this commit

cli/sharing.go Outdated
Comment on lines 215 to 218
org, err := orgContext.Selected(inv, client)
if err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should take --org as a flag. we can already uniquely identify the organization just from the codersdk.Workspace which has OrganizationID and OrganizationName fields. this just makes it likely that someone will accidentally pass in the wrong org and cause problems. from looking through this file it seems like those are the only two org values that get used anyway, so it also saves us a network round trip!

same for the share/add command.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I didn't realize that the workspaces had that information already

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved in this commit

@brettkolodny brettkolodny merged commit 8d5c566 into main Sep 11, 2025
31 checks passed
@brettkolodny brettkolodny deleted the brett/i861 branch September 11, 2025 20:22
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

coder sharing remove command
2 participants