Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Remove repository visibility field #248

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/dal/dao/artifact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestArtifactServiceAssociateArtifact(t *testing.T) {
assert.NoError(t, err)

repositoryService := repositoryServiceFactory.New(tx)
repositoryObj = &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj = &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)
return nil
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestArtifactService(t *testing.T) {
assert.NoError(t, err)

repositoryService := repositoryServiceFactory.New(tx)
repositoryObj := &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)

Expand Down Expand Up @@ -275,7 +275,7 @@ func TestArtifactService(t *testing.T) {
assert.NoError(t, err)

repositoryService := repositoryServiceFactory.New(tx)
repositoryObj := &models.Repository{Name: "test1/busybox", NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: "test1/busybox", NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)

Expand Down
39 changes: 14 additions & 25 deletions pkg/dal/dao/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@
if !errors.Is(err, gorm.ErrRecordNotFound) {
return err
}
if !repositoryObj.Visibility.IsValid() {
repositoryObj.Visibility = namespaceObj.Visibility
}
err = s.tx.Repository.WithContext(ctx).Create(repositoryObj)
if err != nil {
return err
Expand Down Expand Up @@ -197,17 +194,13 @@
if namespaceID != 0 {
q = q.Where(s.tx.Repository.NamespaceID.Eq(namespaceID))
}
if userID == 0 { // find the public namespace
q = q.Where(s.tx.Repository.Visibility.Eq(enums.VisibilityPublic))
} else { // find user id authenticated namespace
userObj, err := s.tx.User.WithContext(ctx).Where(s.tx.User.ID.Eq(userID)).First()
if err != nil {
return nil, err
}
if !(userObj.Role == enums.UserRoleAdmin || userObj.Role == enums.UserRoleRoot) {
q = q.LeftJoin(s.tx.NamespaceMember, s.tx.Repository.NamespaceID.EqCol(s.tx.NamespaceMember.NamespaceID), s.tx.NamespaceMember.UserID.Eq(userID)).
Where(s.tx.NamespaceMember.ID.IsNotNull()).Or(s.tx.Repository.Visibility.Eq(enums.VisibilityPublic))
}
userObj, err := s.tx.User.WithContext(ctx).Where(s.tx.User.ID.Eq(userID)).First()
if err != nil {
return nil, err
}
if !(userObj.Role == enums.UserRoleAdmin || userObj.Role == enums.UserRoleRoot) {
q = q.LeftJoin(s.tx.NamespaceMember, s.tx.Repository.NamespaceID.EqCol(s.tx.NamespaceMember.NamespaceID), s.tx.NamespaceMember.UserID.Eq(userID)).
Where(s.tx.NamespaceMember.ID.IsNotNull())

Check warning on line 203 in pkg/dal/dao/repository.go

View check run for this annotation

Codecov / codecov/patch

pkg/dal/dao/repository.go#L197-L203

Added lines #L197 - L203 were not covered by tests
}
if name != nil {
q = q.Where(s.tx.Repository.Name.Like(fmt.Sprintf("%s%%", ptr.To(name))))
Expand All @@ -228,17 +221,13 @@
if name != nil {
q = q.Where(s.tx.Repository.Name.Like(fmt.Sprintf("%s%%", ptr.To(name))))
}
if userID == 0 { // find the public namespace
q = q.Where(s.tx.Repository.Visibility.Eq(enums.VisibilityPublic))
} else { // find user id authenticated namespace
userObj, err := s.tx.User.WithContext(ctx).Where(s.tx.User.ID.Eq(userID)).First()
if err != nil {
return nil, 0, err
}
if !(userObj.Role == enums.UserRoleAdmin || userObj.Role == enums.UserRoleRoot) {
q = q.LeftJoin(s.tx.NamespaceMember, s.tx.Repository.NamespaceID.EqCol(s.tx.NamespaceMember.NamespaceID), s.tx.NamespaceMember.UserID.Eq(userID)).
Where(s.tx.NamespaceMember.ID.IsNotNull()).Or(s.tx.Repository.Visibility.Eq(enums.VisibilityPublic))
}
userObj, err := s.tx.User.WithContext(ctx).Where(s.tx.User.ID.Eq(userID)).First()
if err != nil {
return nil, 0, err
}
if !(userObj.Role == enums.UserRoleAdmin || userObj.Role == enums.UserRoleRoot) {
q = q.LeftJoin(s.tx.NamespaceMember, s.tx.Repository.NamespaceID.EqCol(s.tx.NamespaceMember.NamespaceID), s.tx.NamespaceMember.UserID.Eq(userID)).
Where(s.tx.NamespaceMember.ID.IsNotNull())

Check warning on line 230 in pkg/dal/dao/repository.go

View check run for this annotation

Codecov / codecov/patch

pkg/dal/dao/repository.go#L224-L230

Added lines #L224 - L230 were not covered by tests
}
field, ok := s.tx.Repository.GetFieldByName(ptr.To(sort.Sort))
if ok {
Expand Down
4 changes: 2 additions & 2 deletions pkg/dal/dao/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ func TestRepositoryService(t *testing.T) {
assert.NoError(t, err)

repositoryService := repositoryServiceFactory.New(tx)
repositoryObj := &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)

namespaceObj1 := &models.Namespace{Name: "test1", Visibility: enums.VisibilityPrivate}
err = namespaceService.Create(ctx, namespaceObj1)
assert.NoError(t, err)
err = repositoryService.Create(ctx, &models.Repository{Name: "test1/busybox", Visibility: enums.VisibilityPrivate}, dao.AutoCreateNamespace{UserID: userObj.ID})
err = repositoryService.Create(ctx, &models.Repository{Name: "test1/busybox"}, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)

count1, err := repositoryService.CountRepository(ctx, namespaceObj.ID, nil)
Expand Down
2 changes: 1 addition & 1 deletion pkg/dal/dao/tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestTagService(t *testing.T) {
assert.NoError(t, err)

repositoryService := repositoryServiceFactory.New(tx)
repositoryObj := &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: "test/busybox", NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)

Expand Down
1 change: 0 additions & 1 deletion pkg/dal/migrations/mysql/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ CREATE TABLE IF NOT EXISTS `repositories` (
`name` varchar(64) NOT NULL,
`description` varchar(255),
`overview` BLOB,
`visibility` ENUM ('public', 'private') NOT NULL DEFAULT 'private',
`size_limit` bigint NOT NULL DEFAULT 0,
`size` bigint NOT NULL DEFAULT 0,
`tag_limit` bigint NOT NULL DEFAULT 0,
Expand Down
1 change: 0 additions & 1 deletion pkg/dal/migrations/postgresql/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ CREATE TABLE IF NOT EXISTS "repositories" (
"name" varchar(64) NOT NULL,
"description" varchar(255),
"overview" bytea,
"visibility" visibility NOT NULL DEFAULT 'private',
"size_limit" bigint NOT NULL DEFAULT 0,
"size" bigint NOT NULL DEFAULT 0,
"tag_limit" bigint NOT NULL DEFAULT 0,
Expand Down
1 change: 0 additions & 1 deletion pkg/dal/migrations/sqlite3/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ CREATE TABLE IF NOT EXISTS `repositories` (
`name` varchar(64) NOT NULL,
`description` varchar(255),
`overview` BLOB,
`visibility` text CHECK (`visibility` IN ('public', 'private')) NOT NULL DEFAULT 'private',
`size_limit` integer NOT NULL DEFAULT 0,
`size` integer NOT NULL DEFAULT 0,
`tag_limit` integer NOT NULL DEFAULT 0,
Expand Down
10 changes: 4 additions & 6 deletions pkg/dal/models/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"gorm.io/gorm"
"gorm.io/plugin/soft_delete"

"github.com/go-sigma/sigma/pkg/types/enums"
"github.com/go-sigma/sigma/pkg/xerrors"
)

Expand All @@ -33,11 +32,10 @@ type Repository struct {
Name string
Description *string
Overview []byte
Visibility enums.Visibility `gorm:"default:public"`
TagLimit int64 `gorm:"default:0"`
TagCount int64 `gorm:"default:0"`
SizeLimit int64 `gorm:"default:0"`
Size int64 `gorm:"default:0"`
TagLimit int64 `gorm:"default:0"`
TagCount int64 `gorm:"default:0"`
SizeLimit int64 `gorm:"default:0"`
Size int64 `gorm:"default:0"`

Namespace Namespace
Builder *Builder
Expand Down
6 changes: 1 addition & 5 deletions pkg/dal/query/repositories.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/handlers/artifacts/artifacts_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestDeleteArtifact(t *testing.T) {
log.Info().Interface("namespace", namespaceObj).Msg("namespace created")
repositoryServiceFactory := dao.NewRepositoryServiceFactory()
repositoryService := repositoryServiceFactory.New(tx)
repositoryObj := &models.Repository{Name: repositoryName, NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: repositoryName, NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)
artifactServiceFactory := dao.NewArtifactServiceFactory()
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/artifacts/artifacts_get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestGetArtifact(t *testing.T) {
log.Info().Interface("namespace", namespaceObj).Msg("namespace created")
repositoryServiceFactory := dao.NewRepositoryServiceFactory()
repositoryService := repositoryServiceFactory.New(tx)
repositoryObj := &models.Repository{Name: namespaceName + "/" + repositoryName, NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: namespaceName + "/" + repositoryName, NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)
artifactServiceFactory := dao.NewArtifactServiceFactory()
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/artifacts/artifacts_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestListArtifact(t *testing.T) {
log.Info().Interface("namespace", namespaceObj).Msg("namespace created")
repositoryServiceFactory := dao.NewRepositoryServiceFactory()
repositoryService := repositoryServiceFactory.New(tx)
repositoryObj := &models.Repository{Name: namespaceName + "/" + repositoryName, NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: namespaceName + "/" + repositoryName, NamespaceID: namespaceObj.ID}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID})
assert.NoError(t, err)
artifactServiceFactory := dao.NewArtifactServiceFactory()
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/distribution/base/repository_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestListRepositories(t *testing.T) {
assert.NoError(t, dao.NewUserServiceFactory().New().Create(ctx, userObj))
namespaceObj := &models.Namespace{Name: namespaceName, Visibility: enums.VisibilityPrivate}
assert.NoError(t, dao.NewNamespaceServiceFactory().New().Create(ctx, namespaceObj))
repositoryObj := &models.Repository{Name: repositoryName, NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: repositoryName, NamespaceID: namespaceObj.ID}
assert.NoError(t, dao.NewRepositoryServiceFactory().New().Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID}))
artifactObj := &models.Artifact{RepositoryID: repositoryObj.ID, Digest: "sha256:1234567890", Size: 1234, ContentType: "application/octet-stream", Raw: []byte("test"), PushedAt: time.Now()}
assert.NoError(t, dao.NewArtifactServiceFactory().New().Create(ctx, artifactObj))
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/distribution/base/tags_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestListTags(t *testing.T) {
assert.NoError(t, dao.NewNamespaceServiceFactory().New().Create(ctx, namespaceObj))
_, err := dao.NewNamespaceMemberServiceFactory().New().AddNamespaceMember(ctx, userObj.ID, ptr.To(namespaceObj), enums.NamespaceRoleAdmin)
assert.NoError(t, err)
repositoryObj := &models.Repository{Name: repositoryName, NamespaceID: namespaceObj.ID, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{Name: repositoryName, NamespaceID: namespaceObj.ID}
assert.NoError(t, dao.NewRepositoryServiceFactory().New().Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID}))
artifactObj := &models.Artifact{RepositoryID: repositoryObj.ID, Digest: "sha256:1234567890", Size: 1234, ContentType: "application/octet-stream", Raw: []byte("test"), PushedAt: time.Now()}
assert.NoError(t, dao.NewArtifactServiceFactory().New().Create(ctx, artifactObj))
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/distribution/manifest/manifest_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestDeleteManifest(t *testing.T) {
namespaceObj := &models.Namespace{Name: namespaceName, Visibility: enums.VisibilityPrivate}
assert.NoError(t, dao.NewNamespaceServiceFactory().New().Create(ctx, namespaceObj))

repositoryObj := &models.Repository{NamespaceID: namespaceObj.ID, Name: repositoryName, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{NamespaceID: namespaceObj.ID, Name: repositoryName}
assert.NoError(t, dao.NewRepositoryServiceFactory().New().Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID}))

artifactObj := &models.Artifact{RepositoryID: repositoryObj.ID, Digest: digestName, Size: 123, ContentType: "application/vnd.oci.image.manifest.v1+json", Raw: []byte(`{"schemaVersion":2,"config":{"mediaType":"application/vnd.cncf.helm.config.v1+json","digest":"sha256:a61fd63bebd559934a60e30d1e7b832a136ac6bae3a11ca97ade20bfb3645796","size":800},"layers":[{"mediaType":"application/vnd.cncf.helm.chart.content.v1.tar+gzip","digest":"sha256:e45dd3e880e94bdb52cc88d6b4e0fbaec6876856f39a1a89f76e64d0739c2904","size":37869}],"annotations":{"category":"Infrastructure","licenses":"Apache-2.0","org.opencontainers.image.authors":"VMware, Inc.","org.opencontainers.image.description":"NGINX Open Source is a web server that can be also used as a reverse proxy, load balancer, and HTTP cache. Recommended for high-demanding sites due to its ability to provide faster content.","org.opencontainers.image.source":"https://github.com/bitnami/charts/tree/main/bitnami/nginx","org.opencontainers.image.title":"nginx","org.opencontainers.image.url":"https://bitnami.com","org.opencontainers.image.version":"15.0.2"}}`)}
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/distribution/manifest/manifest_head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestHeadManifest(t *testing.T) {
assert.NoError(t, dao.NewUserServiceFactory().New().Create(ctx, userObj))
namespaceObj := &models.Namespace{Name: namespaceName, Visibility: enums.VisibilityPrivate}
assert.NoError(t, dao.NewNamespaceServiceFactory().New().Create(ctx, namespaceObj))
repositoryObj := &models.Repository{NamespaceID: namespaceObj.ID, Name: repositoryName, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{NamespaceID: namespaceObj.ID, Name: repositoryName}
assert.NoError(t, dao.NewRepositoryServiceFactory().New().Create(ctx, repositoryObj, dao.AutoCreateNamespace{UserID: userObj.ID}))
artifactObj := &models.Artifact{RepositoryID: repositoryObj.ID, Digest: digestName, Size: 123, ContentType: "application/vnd.oci.image.manifest.v1+json", Raw: []byte(`{"schemaVersion":2,"config":{"mediaType":"application/vnd.cncf.helm.config.v1+json","digest":"sha256:a61fd63bebd559934a60e30d1e7b832a136ac6bae3a11ca97ade20bfb3645796","size":800},"layers":[{"mediaType":"application/vnd.cncf.helm.chart.content.v1.tar+gzip","digest":"sha256:e45dd3e880e94bdb52cc88d6b4e0fbaec6876856f39a1a89f76e64d0739c2904","size":37869}],"annotations":{"category":"Infrastructure","licenses":"Apache-2.0","org.opencontainers.image.authors":"VMware, Inc.","org.opencontainers.image.description":"NGINX Open Source is a web server that can be also used as a reverse proxy, load balancer, and HTTP cache. Recommended for high-demanding sites due to its ability to provide faster content.","org.opencontainers.image.source":"https://github.com/bitnami/charts/tree/main/bitnami/nginx","org.opencontainers.image.title":"nginx","org.opencontainers.image.url":"https://bitnami.com","org.opencontainers.image.version":"15.0.2"}}`)}
assert.NoError(t, dao.NewArtifactServiceFactory().New().Create(ctx, artifactObj))
Expand Down
5 changes: 1 addition & 4 deletions pkg/handlers/distribution/manifest/manifest_put.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ func (h *handler) PutManifest(c echo.Context) error {
refs := h.parseRef(ref)

repositoryService := h.repositoryServiceFactory.New()
repositoryObj := &models.Repository{
Name: repository,
Visibility: enums.VisibilityPrivate,
}
repositoryObj := &models.Repository{Name: repository}
err = repositoryService.Create(ctx, repositoryObj, dao.AutoCreateNamespace{
AutoCreate: h.config.Namespace.AutoCreate,
Visibility: h.config.Namespace.Visibility,
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/distribution/manifest/manifest_put_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestPutManifest(t *testing.T) {
namespaceObj := &models.Namespace{Name: namespaceName, Visibility: enums.VisibilityPrivate}
assert.NoError(t, dao.NewNamespaceServiceFactory().New().Create(ctx, namespaceObj))

repositoryObj := &models.Repository{NamespaceID: namespaceObj.ID, Name: repositoryName, Visibility: enums.VisibilityPrivate}
repositoryObj := &models.Repository{NamespaceID: namespaceObj.ID, Name: repositoryName}
assert.NoError(t, dao.NewRepositoryServiceFactory().New().Create(ctx, repositoryObj, dao.AutoCreateNamespace{AutoCreate: false, Visibility: enums.VisibilityPrivate, UserID: userObj.ID}))

blobService := dao.NewBlobServiceFactory().New()
Expand Down
1 change: 0 additions & 1 deletion pkg/handlers/repositories/repositories_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func (h *handler) CreateRepository(c echo.Context) error {
Name: req.Name,
Description: req.Description,
Overview: []byte(ptr.To(req.Overview)),
Visibility: ptr.To(req.Visibility),
TagLimit: ptr.To(req.TagLimit),
SizeLimit: ptr.To(req.SizeLimit),
}
Expand Down
1 change: 0 additions & 1 deletion pkg/handlers/repositories/repositories_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func (h *handler) GetRepository(c echo.Context) error {
Name: repositoryObj.Name,
Description: repositoryObj.Description,
Overview: ptr.Of(string(repositoryObj.Overview)),
Visibility: repositoryObj.Visibility,
SizeLimit: ptr.Of(repositoryObj.SizeLimit),
Size: ptr.Of(repositoryObj.Size),
TagCount: repositoryObj.TagCount,
Expand Down
1 change: 0 additions & 1 deletion pkg/handlers/repositories/repositories_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func (h *handler) ListRepositories(c echo.Context) error {
Name: repository.Name,
Description: repository.Description,
Overview: ptr.Of(string(repository.Overview)),
Visibility: repository.Visibility,
SizeLimit: ptr.Of(repository.SizeLimit),
Size: ptr.Of(repository.Size),
TagCount: repository.TagCount,
Expand Down
3 changes: 0 additions & 3 deletions pkg/handlers/repositories/repositories_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ func (h *handler) UpdateRepository(c echo.Context) error {
if req.Overview != nil {
updates[query.Repository.Overview.ColumnName().String()] = []byte(ptr.To(req.Overview))
}
if req.Visibility != nil {
updates[query.Repository.Visibility.ColumnName().String()] = ptr.To(req.Visibility)
}

if len(updates) > 0 {
err = repositoryService.UpdateRepository(ctx, repositoryObj.ID, updates)
Expand Down
Loading