tea organizations list command #264

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

A starting point...

close #263

A starting point... close #263
khmarbaise added 1 commit 2 years ago
5a8fe1e860
[WIP] tea organizations list command #263
khmarbaise reviewed 2 years ago
Dismissed
log.Printf("Login.Name {}", login.Name)
log.Printf("Info.Username {}", info.UserName)
userOrganizations, _, err := client.ListUserOrgs(info.UserName, gitea.ListOrgsOptions{})
Poster
Collaborator

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` ?
noerw commented 2 years ago
Collaborator

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 2 years ago
7aed5884f9
WIP: Removed Printf(); Orgs module. Not used yet.
khmarbaise added 1 commit 2 years ago
e662305b7b
WIP: Reorded imports.
noerw reviewed 2 years ago
Dismissed
for _, org := range userOrganizations {
values = append(
values,
[]string{
noerw commented 2 years ago
Collaborator

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
Poster
Collaborator

Changed as you suggested.

Changed as you suggested.
noerw marked this conversation as resolved
noerw reviewed 2 years ago
Dismissed
// RunOrganizationList list user organizations
func RunOrganizationList(ctx *cli.Context) error {
log.Printf("GlobalLoginValue: {}", flags.GlobalLoginValue)
noerw commented 2 years ago
Collaborator

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 2 years ago
cd2ebe8b12
WIP: Improved based on review comments.
6543 reviewed 2 years ago
Dismissed
log.Printf("Login.Name {}", login.Name)
log.Printf("Info.Username {}", info.UserName)
userOrganizations, _, err := client.ListUserOrgs(info.UserName, gitea.ListOrgsOptions{})
if err != nil {
6543 commented 2 years ago
Collaborator

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 ...
Poster
Collaborator

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 2 years ago
Collaborator

@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 2 years ago
khmarbaise force-pushed issue-tea-263-ls from cd2ebe8b12 to 9b77fdc205 2 years ago
khmarbaise force-pushed issue-tea-263-ls from 9b77fdc205 to 970cbad6f9 2 years ago
Poster
Collaborator

@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 2 years ago
noerw approved these changes 2 years ago
Dismissed
Collaborator

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 2 years ago
Dismissed
Aliases: []string{"list"},
Usage: "List Organizations",
Description: "List users organizations",
Action: RunOrganizationList,
6543 commented 2 years ago
Collaborator

paggination options missing

paggination options missing
6543 commented 2 years ago
Collaborator
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
Poster
Collaborator

Changes as suggested. Thanks for the hints.

Changes as suggested. Thanks for the hints.
khmarbaise added 1 commit 2 years ago
e65eda04c4
Add missing pagination options missing as suggest by reviewers. (#263)
6543 approved these changes 2 years ago
Dismissed
6543 merged commit 7d486c2ec6 into master 2 years ago
6543 referenced this issue from a commit 2 years ago
Collaborator

@khmarbaise thanks

@khmarbaise thanks
6543 added this to the v0.6.0 milestone 2 years ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as 7d486c2ec6.
Sign in to join this conversation.
Loading…
There is no content yet.