Added organization delete command. #270

Merged
6543 merged 2 commits from khmarbaise/tea:issue-269 into master 2020-12-07 12:24:05 +00:00
Member

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 2020-12-06 22:31:11 +00:00
Added organization delete command.
All checks were successful
continuous-integration/drone/pr Build is passing
73a21773f5
Fix #269

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

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 2020-12-06 23:19:32 +00:00
6543 added this to the v0.6.0 milestone 2020-12-06 23:29:59 +00:00
Author
Member

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 2020-12-07 00:00:10 +00:00
6543 reviewed 2020-12-07 00:27:21 +00:00
Dismissed
@ -0,0 +35,4 @@
}
response, err := client.DeleteOrg(ctx.Args().First())
if response.StatusCode == 404 {
Owner

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 { ```
Author
Member

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?
Owner

the rest is fine

the rest is fine
Author
Member

Check enhanced as suggested.

Check enhanced as suggested.
6543 marked this conversation as resolved
noerw approved these changes 2020-12-07 00:42:55 +00:00
Dismissed
khmarbaise added 1 commit 2020-12-07 11:56:31 +00:00
Supplemental check for response.
All checks were successful
continuous-integration/drone/pr Build is passing
830fcd433e
6543 approved these changes 2020-12-07 12:23:39 +00:00
Dismissed
6543 merged commit 16df81ac94 into master 2020-12-07 12:24:05 +00:00
6543 removed the
status/needs-reviews
label 2020-12-07 12:24:35 +00:00
Sign in to join this conversation.
No description provided.