Skip to content

Commit

Permalink
Artefact ids are located by the corresponding digest; therefore `Arte…
Browse files Browse the repository at this point in the history
…factKey:id` is no longer required
  • Loading branch information
jonathanj-square committed Oct 2, 2024
1 parent e9a629f commit d323ff6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion backend/controller/artefacts/artefact.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type Artefact struct {

type ArtefactKey struct {
Digest sha256.SHA256
id int64
}

type ReleaseArtefact struct {
Expand Down
4 changes: 2 additions & 2 deletions backend/controller/artefacts/dal_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit d323ff6

Please sign in to comment.