tea organizations list command #264
No reviewers
Labels
No Label
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind
enhancement
kind
feature
kind/proposal
kind
question
kind
refactor
kind/security
kind/testing
kind/translation
priority/critical
priority/high
priority/low
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/has-backport
status/has-pull
status/needs-backport
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/sdk
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#264
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "khmarbaise/tea:issue-tea-263-ls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A starting point...
close #263
@ -0,0 +36,4 @@
log.Printf("Login.Name {}", login.Name)
log.Printf("Info.Username {}", info.UserName)
userOrganizations, _, err := client.ListUserOrgs(info.UserName, gitea.ListOrgsOptions{})
Here I'm not sure which exact user information should be used
info.UserName
makes it working. where is the difference tolong.Name
?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 toGetMyUserInfo()
@ -0,0 +59,4 @@
for _, org := range userOrganizations {
values = append(
values,
[]string{
I think we shouldn't print the ID, as users identify orgs via their name
Changed as you suggested.
@ -0,0 +27,4 @@
// RunOrganizationList list user organizations
func RunOrganizationList(ctx *cli.Context) error {
log.Printf("GlobalLoginValue: {}", flags.GlobalLoginValue)
Note for later (no need to adress this in this PR):
By using
InitCommandLoginOnly()
repo-based login detection fails, see #200@ -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 {
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 ...
Changed as requested.
[WIP] tea organizations list command #263to [WIP] tea organizations list command@khmarbaise update your pull desc so automatic close on merge works :)
cd2ebe8b12
to9b77fdc205
9b77fdc205
to970cbad6f9
@6543 So added things like this in my commit messag:
Is this the way you like it?
[WIP] tea organizations list commandto tea organizations list commandas 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 ;)
@ -0,0 +21,4 @@
Aliases: []string{"list"},
Usage: "List Organizations",
Description: "List users organizations",
Action: RunOrganizationList,
paggination options missing
example:
Changes as suggested. Thanks for the hints.
@khmarbaise thanks