From b78f5fc60f510a58d58535af77c5b424a8b5a660 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 23 Feb 2024 03:52:54 +0800 Subject: [PATCH] Only log error when tag sync fails (#29295) (#29327) Backport #29295 by @lunny Fix #28843 This PR will bypass the pushUpdateTag to database failure when syncAllTags. An error log will be recorded. Co-authored-by: Lunny Xiao Co-authored-by: wxiaoguang --- modules/repository/repo.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/repository/repo.go b/modules/repository/repo.go index d06d75fa9c..1387cee66d 100644 --- a/modules/repository/repo.go +++ b/modules/repository/repo.go @@ -334,7 +334,9 @@ func SyncReleasesWithTags(ctx context.Context, repo *repo_model.Repository, gitR } if err := PushUpdateAddTag(ctx, repo, gitRepo, tagName, sha1, refname); err != nil { - return fmt.Errorf("unable to PushUpdateAddTag: %q to Repo[%d:%s/%s]: %w", tagName, repo.ID, repo.OwnerName, repo.Name, err) + // sometimes, some tags will be sync failed. i.e. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tag/?h=v2.6.11 + // this is a tree object, not a tag object which created before git + log.Error("unable to PushUpdateAddTag: %q to Repo[%d:%s/%s]: %v", tagName, repo.ID, repo.OwnerName, repo.Name, err) } return nil