diff options
author | Stan Hu <stanhu@gmail.com> | 2021-06-25 03:12:16 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2021-06-25 03:15:31 +0300 |
commit | 9ccd5948b94b1ea5fbbe077e26aa9094d3da5bf1 (patch) | |
tree | ce53d80489216816ab8265c827e8f03e644807f8 | |
parent | 56aa9a2196f0003bc011e4152bb093b8d32be83d (diff) |
Log details about merge commit errors
Failing to create a merge commit occurs quite frequently in
production. Log more details to understand why this is happening.
Relates to https://gitlab.com/gitlab-org/gitaly/-/issues/3663
Changelog: added
-rw-r--r-- | internal/gitaly/service/operations/merge.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/gitaly/service/operations/merge.go b/internal/gitaly/service/operations/merge.go index f227f0efd..fe4a1a12a 100644 --- a/internal/gitaly/service/operations/merge.go +++ b/internal/gitaly/service/operations/merge.go @@ -8,6 +8,8 @@ import ( "time" "github.com/golang/protobuf/ptypes" + "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus" + "github.com/sirupsen/logrus" "gitlab.com/gitlab-org/gitaly/v14/internal/git" "gitlab.com/gitlab-org/gitaly/v14/internal/git2go" "gitlab.com/gitlab-org/gitaly/v14/internal/helper" @@ -298,6 +300,14 @@ func (s *Server) UserMergeToRef(ctx context.Context, request *gitalypb.UserMerge AllowConflicts: request.AllowConflicts, }.Run(ctx, s.cfg) if err != nil { + ctxlogrus.Extract(ctx).WithError(err).WithFields( + logrus.Fields{ + "source_sha": sourceOID, + "target_sha": oid, + "target_ref": request.TargetRef, + }, + ).Error("unable to create merge commit") + if errors.Is(err, git2go.ErrInvalidArgument) { return nil, helper.ErrInvalidArgument(err) } |