From d323ff6aca3ac253c1289605507ab9e0dc7cef67 Mon Sep 17 00:00:00 2001 From: Jon Johnson <113393155+jonathanj-square@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:35:55 -0700 Subject: [PATCH] Artefact ids are located by the corresponding digest; therefore `ArtefactKey:id` is no longer required --- backend/controller/artefacts/artefact.go | 1 - backend/controller/artefacts/dal_registry.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/controller/artefacts/artefact.go b/backend/controller/artefacts/artefact.go index b07237795d..51b60e378c 100644 --- a/backend/controller/artefacts/artefact.go +++ b/backend/controller/artefacts/artefact.go @@ -23,7 +23,6 @@ type Artefact struct { type ArtefactKey struct { Digest sha256.SHA256 - id int64 } type ReleaseArtefact struct { diff --git a/backend/controller/artefacts/dal_registry.go b/backend/controller/artefacts/dal_registry.go index 9d6da58f91..2c3bbcd1f0 100644 --- a/backend/controller/artefacts/dal_registry.go +++ b/backend/controller/artefacts/dal_registry.go @@ -48,7 +48,7 @@ func (s *Service) GetDigestsKeys(ctx context.Context, digests []sha256.SHA256) ( return nil, nil, libdal.TranslatePGError(err) } keys = slices.Map(have, func(in sql.GetArtefactDigestsRow) ArtefactKey { - return ArtefactKey{id: in.ID, Digest: sha256.FromBytes(in.Digest)} + return ArtefactKey{Digest: sha256.FromBytes(in.Digest)} }) haveStr := slices.Map(keys, func(in ArtefactKey) sha256.SHA256 { return in.Digest @@ -82,7 +82,7 @@ func (s *Service) GetReleaseArtefacts(ctx context.Context, releaseID int64) ([]R } return slices.Map(rows, func(row sql.GetDeploymentArtefactsRow) ReleaseArtefact { return ReleaseArtefact{ - Artefact: ArtefactKey{Digest: sha256.FromBytes(row.Digest), id: row.ID}, + Artefact: ArtefactKey{Digest: sha256.FromBytes(row.Digest)}, Path: row.Path, Executable: row.Executable, }