From 8049651963dcd83d8f39c969c0e93c6f6181fbcd Mon Sep 17 00:00:00 2001 From: Darko Draskovic Date: Wed, 15 May 2024 16:26:10 +0000 Subject: [PATCH] Temporarily comment out file size check (#2040) --- app/api/controller/githook/pre_receive.go | 19 ++++++++++++------- .../githook/pre_receive_file_size_limit.go | 1 + app/api/controller/githook/print.go | 1 + 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/api/controller/githook/pre_receive.go b/app/api/controller/githook/pre_receive.go index 95100d64c..c82e21312 100644 --- a/app/api/controller/githook/pre_receive.go +++ b/app/api/controller/githook/pre_receive.go @@ -93,13 +93,18 @@ func (c *Controller) PreReceive( return hook.Output{}, fmt.Errorf("failed to extend pre-receive hook: %w", err) } - err = c.checkFileSizeLimit(ctx, rgit, repo, in, &output) - if output.Error != nil { - return output, nil - } - if err != nil { - return hook.Output{}, err - } + // File size check currently checks all the blobs in alternate as well in the original repo dirs. + // We want to check file size only in alternate dirs. + // Temporarily comment out file size check until the solution is found. + // TODO: find the way to check the blob size only in alternate dirs. + + // err = c.checkFileSizeLimit(ctx, rgit, repo, in, &output) + // if output.Error != nil { + // return output, nil + // } + // if err != nil { + // return hook.Output{}, err + // } return output, nil } diff --git a/app/api/controller/githook/pre_receive_file_size_limit.go b/app/api/controller/githook/pre_receive_file_size_limit.go index aae1dbd65..19cbfbf70 100644 --- a/app/api/controller/githook/pre_receive_file_size_limit.go +++ b/app/api/controller/githook/pre_receive_file_size_limit.go @@ -26,6 +26,7 @@ import ( "github.com/gotidy/ptr" ) +// nolint:unused func (c *Controller) checkFileSizeLimit( ctx context.Context, rgit RestrictedGIT, diff --git a/app/api/controller/githook/print.go b/app/api/controller/githook/print.go index af6689fc4..f68fb737f 100644 --- a/app/api/controller/githook/print.go +++ b/app/api/controller/githook/print.go @@ -104,6 +104,7 @@ func FMTDuration(d time.Duration) string { return d.String() } +// nolint:unused func printOversizeFiles( output *hook.Output, oversizeFiles []git.FileInfo,