From c09da2a9e16969aeec35cf2cb4495358a59cc157 Mon Sep 17 00:00:00 2001 From: Danila Fominykh Date: Thu, 28 Sep 2023 17:13:40 -0300 Subject: [PATCH] removed functionality related to automatic source code repository connection --- routers/api/packages/arch/arch.go | 9 +-------- services/packages/arch/service.go | 14 -------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/routers/api/packages/arch/arch.go b/routers/api/packages/arch/arch.go index 6b37057311..4023c6fa1e 100644 --- a/routers/api/packages/arch/arch.go +++ b/routers/api/packages/arch/arch.go @@ -21,7 +21,6 @@ import ( // Push new package to arch package registry. func Push(ctx *context.Context) { var ( - owner = ctx.Params("username") filename = ctx.Params("filename") distro = ctx.Params("distro") sign = ctx.Params("sign") @@ -70,7 +69,7 @@ func Push(ctx *context.Context) { props[distro+"-"+filename+".sig"] = sign } - ver, _, err := pkg_service.CreatePackageOrAddFileToExisting( + _, _, err = pkg_service.CreatePackageOrAddFileToExisting( &pkg_service.PackageCreationInfo{ PackageInfo: pkg_service.PackageInfo{ Owner: ctx.Package.Owner, @@ -108,12 +107,6 @@ func Push(ctx *context.Context) { return } - err = arch_service.RepoConnect(ctx, owner, desc.Name, ver.ID) - if err != nil { - apiError(ctx, http.StatusInternalServerError, err) - return - } - ctx.Status(http.StatusOK) } diff --git a/services/packages/arch/service.go b/services/packages/arch/service.go index bddc9a78e1..d493d22128 100644 --- a/services/packages/arch/service.go +++ b/services/packages/arch/service.go @@ -13,7 +13,6 @@ import ( "strings" pkg_model "code.gitea.io/gitea/models/packages" - repository "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/context" arch_module "code.gitea.io/gitea/modules/packages/arch" pkg_service "code.gitea.io/gitea/services/packages" @@ -59,19 +58,6 @@ func GetPackageSignature(ctx *context.Context, distro, file string) (*bytes.Read return nil, errors.New("signature for requested package not found") } -// Automatically connect repository with source code to published package, if -// repository with the same name exists in user/organization scope. -func RepoConnect(ctx *context.Context, owner, repo string, pkgid int64) error { - r, err := repository.GetRepositoryByOwnerAndName(ctx, owner, repo) - if err == nil { - err = pkg_model.SetRepositoryLink(ctx, pkgid, r.ID) - if err != nil { - return err - } - } - return nil -} - // Finds all arch packages in user/organization scope, each package version // starting from latest in descending order is checked to be compatible with // requested combination of architecture and distribution. When/If the first