Skip to content

Commit 4b11fe1

Browse files
committed
Add git operation info logs
1 parent 75b4daf commit 4b11fe1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/externalrepo/git/git.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ func (r *gitRepository) fetchRemoteRepository(ctx context.Context) error {
10681068
ctx, span := tracer.Start(ctx, "gitRepository::fetchRemoteRepository", trace.WithAttributes())
10691069
defer span.End()
10701070
start := time.Now()
1071-
defer func() { klog.V(4).Infof("Fetching repository %q took %s", r.key.Name, time.Since(start)) }()
1071+
defer func() { klog.V(2).Infof("Fetching repository %q took %s", r.key.Name, time.Since(start)) }()
10721072

10731073
if ctx.Err() != nil {
10741074
return ctx.Err()
@@ -1227,7 +1227,8 @@ func (r *gitRepository) pushAndCleanup(ctx context.Context, ph *pushRefSpecBuild
12271227
return err
12281228
}
12291229

1230-
klog.Infof("pushing refs: %v", specs)
1230+
pushStart := time.Now()
1231+
klog.Infof("git push: repository=%q remote=%s refs=%v", r.key.Name, OriginName, specs)
12311232

12321233
if err := r.doGitWithAuth(ctx, func(auth transport.AuthMethod) error {
12331234
return r.repo.Push(&git.PushOptions{
@@ -1247,6 +1248,7 @@ func (r *gitRepository) pushAndCleanup(ctx context.Context, ph *pushRefSpecBuild
12471248
}
12481249
return err
12491250
}
1251+
klog.Infof("git push completed: repository=%q refs=%v duration=%s", r.key.Name, specs, time.Since(pushStart))
12501252
return nil
12511253
}
12521254

0 commit comments

Comments
 (0)