From 8c6ef6010d12f2b11775ff8aaafe7bf77aba7bca Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 19 Dec 2023 02:24:01 +0100 Subject: [PATCH 1/3] Gitea driver: ignore GetOrg error if we get a valid user. --- server/forge/gitea/gitea.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/forge/gitea/gitea.go b/server/forge/gitea/gitea.go index 13ba41693e..bf6a813448 100644 --- a/server/forge/gitea/gitea.go +++ b/server/forge/gitea/gitea.go @@ -21,6 +21,7 @@ package gitea import ( "context" "crypto/tls" + "errors" "fmt" "net" "net/http" @@ -548,10 +549,7 @@ func (c *Gitea) Org(ctx context.Context, u *model.User, owner string) (*model.Or return nil, err } - org, _, err := client.GetOrg(owner) - if err != nil { - return nil, err - } + org, _, orgErr := client.GetOrg(owner) if org != nil { return &model.Org{ Name: org.UserName, @@ -561,6 +559,9 @@ func (c *Gitea) Org(ctx context.Context, u *model.User, owner string) (*model.Or user, _, err := client.GetUserInfo(owner) if err != nil { + if orgErr != nil { + err = errors.Join(orgErr, err) + } return nil, err } return &model.Org{ From f5a8b09fd94bbf2d352aa13b02242d9ff1d00fbe Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 19 Dec 2023 02:27:48 +0100 Subject: [PATCH 2/3] CI.restart() From 23298702dd8d7a846eb3a6050bfc303781bc4480 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 19 Dec 2023 07:15:36 +0100 Subject: [PATCH 3/3] also respect error --- server/forge/gitea/gitea.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/forge/gitea/gitea.go b/server/forge/gitea/gitea.go index bf6a813448..501de15727 100644 --- a/server/forge/gitea/gitea.go +++ b/server/forge/gitea/gitea.go @@ -550,7 +550,7 @@ func (c *Gitea) Org(ctx context.Context, u *model.User, owner string) (*model.Or } org, _, orgErr := client.GetOrg(owner) - if org != nil { + if orgErr == nil && org != nil { return &model.Org{ Name: org.UserName, Private: gitea.VisibleType(org.Visibility) != gitea.VisibleTypePublic,