Added organization delete command. #270

Merged
6543 merged 2 commits from khmarbaise/tea:issue-269 into master 2 years ago
Collaborator

Fix #269

Signed-off-by: Karl Heinz Marbaise kama@soebes.de

Fix #269 Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
khmarbaise added 1 commit 2 years ago
73a21773f5
Added organization delete command.
Collaborator

Does this action cascade deletion of repos owned by the organization? In that case we should stop or warn and ask for confirmation.

Does this action cascade deletion of repos owned by the organization? In that case we should stop or warn and ask for confirmation.
noerw added the
kind/feature
label 2 years ago
6543 added this to the v0.6.0 milestone 2 years ago
Poster
Collaborator

I've created an organization via the administrator. Created an repository within the organization and tried to delete that organization with the following result:

tea (issue-269)$ ./tea org rm test
2020/12/07 00:22:19 Failed to run app with [./tea org rm test]: user still has ownership of repositories [uid: 4]

After that I have deleted the repository and afterwards there is no error message anymore and the organization has been deleted.

I've created an organization via the `administrator`. Created an repository within the organization and tried to delete that organization with the following result: ``` tea (issue-269)$ ./tea org rm test 2020/12/07 00:22:19 Failed to run app with [./tea org rm test]: user still has ownership of repositories [uid: 4] ``` After that I have deleted the repository and afterwards there is no error message anymore and the organization has been deleted.
noerw added the
status/needs-reviews
label 2 years ago
6543 reviewed 2 years ago
Dismissed
}
response, err := client.DeleteOrg(ctx.Args().First())
if response.StatusCode == 404 {
6543 commented 2 years ago
Collaborator

make sure responce is not nil!!

-	if response.StatusCode == 404 {
+	if response != nil && response.StatusCode == 404 {
make sure responce is not nil!! ```diff - if response.StatusCode == 404 { + if response != nil && response.StatusCode == 404 { ```
Poster
Collaborator

outch ... sure... the other question is: Using a literal value for status code is ok? Or do exist in a module constants which could or should be used?

outch ... sure... the other question is: Using a literal value for status code is ok? Or do exist in a module constants which could or should be used?
6543 commented 2 years ago
Collaborator

the rest is fine

the rest is fine
Poster
Collaborator

Check enhanced as suggested.

Check enhanced as suggested.
6543 marked this conversation as resolved
noerw approved these changes 2 years ago
Dismissed
khmarbaise added 1 commit 2 years ago
830fcd433e
Supplemental check for response.
6543 approved these changes 2 years ago
Dismissed
6543 merged commit 16df81ac94 into master 2 years ago
6543 referenced this issue from a commit 2 years ago
6543 removed the
status/needs-reviews
label 2 years ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as 16df81ac94.
Sign in to join this conversation.
Loading…
There is no content yet.