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

Skip to content

feat: implement create org commands from cli #12308

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 3 commits into from
Feb 27, 2024
Merged

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Feb 26, 2024

Adding a command to add organizations because the only other way currently is with a curl command. When developing multi-org stuff, it is a little annoying to have to do.

The command is hidden and should not be made visible while the action is irreversible. Organizations cannot be deleted at the moment.

Screenshot from 2024-02-26 12-36-53

@Emyrk Emyrk marked this pull request as ready for review February 26, 2024 18:38
@Emyrk Emyrk requested a review from mafredri February 27, 2024 14:03
return fmt.Errorf("organization %q already exists", orgName)
}

// Confirm deletion of the template.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Confirm deletion of the template.

IsConfirm: true,
Default: cliui.ConfirmNo,
})
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Handle cliui.Canceled? Just exit with code 1 and show no error (didn't test, maybe that's what happens).

Copy link
Member Author

@Emyrk Emyrk Feb 27, 2024

Choose a reason for hiding this comment

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

I just confirmed if the context is cancelled, then it is exit code 1 with

$ coder orgs create test
> Are you sure you want to create an organization with the name  test ?
This action is irreversible. (yes/no) 
Encountered an error running "coder organizations create"
context canceled

Copy link
Member

Choose a reason for hiding this comment

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

The problem is that we print context cancelled. Should just exit silently with 1.

@Emyrk Emyrk merged commit 19baca5 into main Feb 27, 2024
@Emyrk Emyrk deleted the stevenmasley/org_cli_create branch February 27, 2024 16:13
@Emyrk Emyrk changed the title feat: implement create/delete org commands from cli feat: implement create org commands from cli Feb 27, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2024
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.

2 participants