tea organizations list command #264

Merged
6543 merged 2 commits from khmarbaise/tea:issue-tea-263-ls into master 2020-12-06 22:02:50 +00:00
Member

A starting point...

close #263

A starting point... close #263
khmarbaise added 1 commit 2020-12-05 21:49:09 +00:00
[WIP] tea organizations list command #263
Some checks failed
continuous-integration/drone/pr Build is failing
5a8fe1e860
khmarbaise reviewed 2020-12-05 21:52:48 +00:00
Dismissed
@ -0,0 +36,4 @@
log.Printf("Login.Name {}", login.Name)
log.Printf("Info.Username {}", info.UserName)
userOrganizations, _, err := client.ListUserOrgs(info.UserName, gitea.ListOrgsOptions{})
Author
Member

Here I'm not sure which exact user information should be used info.UserName makes it working. where is the difference to long.Name ?

Here I'm not sure which exact user information should be used `info.UserName` makes it working. where is the difference to `long.Name` ?
Member

login.Name is the ID of tea specific configuration for each gitea instance.
login.User holds the user name that the auth token belongs to, so you can skip the call to GetMyUserInfo()

`login.Name` is the ID of tea specific configuration for each gitea instance. `login.User` holds the user name that the auth token belongs to, so you can skip the call to `GetMyUserInfo()`
noerw marked this conversation as resolved
khmarbaise added 1 commit 2020-12-05 22:07:45 +00:00
WIP: Removed Printf(); Orgs module. Not used yet.
Some checks failed
continuous-integration/drone/pr Build is failing
7aed5884f9
khmarbaise added 1 commit 2020-12-05 22:22:21 +00:00
WIP: Reorded imports.
All checks were successful
continuous-integration/drone/pr Build is passing
e662305b7b
noerw reviewed 2020-12-05 22:48:34 +00:00
Dismissed
@ -0,0 +59,4 @@
for _, org := range userOrganizations {
values = append(
values,
[]string{
Member

I think we shouldn't print the ID, as users identify orgs via their name

I think we shouldn't print the ID, as users identify orgs via their name
Author
Member

Changed as you suggested.

Changed as you suggested.
noerw marked this conversation as resolved
noerw reviewed 2020-12-05 22:53:33 +00:00
Dismissed
@ -0,0 +27,4 @@
// RunOrganizationList list user organizations
func RunOrganizationList(ctx *cli.Context) error {
log.Printf("GlobalLoginValue: {}", flags.GlobalLoginValue)
Member

Note for later (no need to adress this in this PR):
By using InitCommandLoginOnly() repo-based login detection fails, see #200

Note for later (no need to adress this in this PR): By using `InitCommandLoginOnly()` repo-based login detection fails, see #200
noerw marked this conversation as resolved
khmarbaise added 1 commit 2020-12-05 23:08:51 +00:00
WIP: Improved based on review comments.
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
cd2ebe8b12
6543 reviewed 2020-12-06 07:07:02 +00:00
Dismissed
@ -0,0 +37,4 @@
log.Printf("Login.Name {}", login.Name)
log.Printf("Info.Username {}", info.UserName)
userOrganizations, _, err := client.ListUserOrgs(info.UserName, gitea.ListOrgsOptions{})
if err != nil {
Owner

can you move list printing func into modules/print

like it's done with list repos:

https://gitea.com/gitea/tea/src/branch/master/cmd/repos/list.go#L83
https://gitea.com/gitea/tea/src/branch/master/modules/print/repo.go#L63

yes list issues do not do it now - need a refactor ...

can you move list printing func into `modules/print` like it's done with list repos: https://gitea.com/gitea/tea/src/branch/master/cmd/repos/list.go#L83 https://gitea.com/gitea/tea/src/branch/master/modules/print/repo.go#L63 yes list issues do not do it now - need a refactor ...
Author
Member

Changed as requested.

Changed as requested.
6543 marked this conversation as resolved
6543 changed title from [WIP] tea organizations list command #263 to [WIP] tea organizations list command 2020-12-06 07:10:49 +00:00
Owner

@khmarbaise update your pull desc so automatic close on merge works :)

@khmarbaise update your pull desc so automatic close on merge works :)
6543 added the
kind
feature
label 2020-12-06 07:11:51 +00:00
khmarbaise force-pushed issue-tea-263-ls from cd2ebe8b12 to 9b77fdc205 2020-12-06 10:17:54 +00:00 Compare
khmarbaise force-pushed issue-tea-263-ls from 9b77fdc205 to 970cbad6f9 2020-12-06 10:26:02 +00:00 Compare
Author
Member

@6543 So added things like this in my commit messag:

Introduce tea organizations list command (#263)
    
Fix #263
    
Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>

Is this the way you like it?

@6543 So added things like this in my commit messag: ``` Introduce tea organizations list command (#263) Fix #263 Signed-off-by: Karl Heinz Marbaise <kama@soebes.de> ``` Is this the way you like it?
khmarbaise changed title from [WIP] tea organizations list command to tea organizations list command 2020-12-06 10:29:42 +00:00
noerw approved these changes 2020-12-06 11:34:43 +00:00
Dismissed
Owner

as long as it make sence i dont care what you write in your commits ;)

(pull's are squashmerged)

Just the issue should be refeerenct within the pull request details/body how yo call it ... and not in the title ;)

as long as it make sence i dont care what you write in your commits ;) (pull's are squashmerged) Just the issue should be refeerenct within the pull request details/body how yo call it ... and not in the title ;)
6543 reviewed 2020-12-06 21:29:57 +00:00
Dismissed
@ -0,0 +21,4 @@
Aliases: []string{"list"},
Usage: "List Organizations",
Description: "List users organizations",
Action: RunOrganizationList,
Owner

paggination options missing

paggination options missing
Owner
example: * https://gitea.com/gitea/tea/src/branch/master/cmd/releases/list.go#L27-L28 * https://gitea.com/gitea/tea/src/branch/master/cmd/releases/list.go#L36
Author
Member

Changes as suggested. Thanks for the hints.

Changes as suggested. Thanks for the hints.
khmarbaise added 1 commit 2020-12-06 21:45:50 +00:00
Add missing pagination options missing as suggest by reviewers. (#263)
All checks were successful
continuous-integration/drone/pr Build is passing
e65eda04c4
Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
6543 approved these changes 2020-12-06 22:02:27 +00:00
Dismissed
6543 merged commit 7d486c2ec6 into master 2020-12-06 22:02:50 +00:00
Owner

@khmarbaise thanks

@khmarbaise thanks
6543 added this to the v0.6.0 milestone 2020-12-12 10:58:04 +00:00
Sign in to join this conversation.
No description provided.