feat: [CODE-3546] update allowed states on LFS APIs for migrating repos (#3707)

This commit is contained in:
Atefeh Mohseni Ejiyeh 2025-04-21 19:08:54 +00:00 committed by Harness
parent 0db23cc023
commit af75e56eb6
2 changed files with 6 additions and 2 deletions

View File

@ -37,7 +37,9 @@ func (c *Controller) LFSTransfer(ctx context.Context,
reqPermission = enum.PermissionRepoPush
}
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef, reqPermission)
var additionalAllowedRepoStates = []enum.RepoState{enum.RepoStateMigrateGitPush}
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef,
reqPermission, additionalAllowedRepoStates...)
if err != nil {
return nil, err
}

View File

@ -39,7 +39,9 @@ func (c *Controller) Upload(ctx context.Context,
pointer Pointer,
file io.Reader,
) (*UploadOut, error) {
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef, enum.PermissionRepoPush)
var additionalAllowedRepoStates = []enum.RepoState{enum.RepoStateMigrateGitPush}
repo, err := c.getRepoCheckAccessAndSetting(ctx, session, repoRef,
enum.PermissionRepoPush, additionalAllowedRepoStates...)
if err != nil {
return nil, fmt.Errorf("failed to acquire access to repo: %w", err)
}