Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Oct 10, 2023
1 parent a502143 commit 366da88
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions oci/artefact.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (c *Client) PushArtefact(ctx context.Context, destinationRef, sourceDir str
return "", fmt.Errorf("adding alias tagging failed: %w", err)
}
}

// TODO: reteurn tag and all of its aliases
return tagAliases[0].String() + "@" + digest.String(), err
}

Expand All @@ -372,22 +372,22 @@ func SemVerTagsFromAttestations(ctx context.Context, tag name.Tag, sourceAttesta
if len(entries.EntryGroups[0]) == 0 {
return []name.Tag{}
}
groupSummary, ok := entries.EntryGroups[0][0].Full().(*git.GitSummary)

// TODO: try to use generics for this?
groupSummary, ok := entries.EntryGroups[0][0].Full().(*git.Summary)
if !ok {
return []name.Tag{}
}
if len(groupSummary.Reference.Tags) == 0 {
ref := groupSummary.Git.Reference
if len(ref.Tags) == 0 {
return []name.Tag{}
}

tags := make([]name.Tag, 0, len(groupSummary.Reference.Tags))

// TODO: detect tags with groupSummary.Path+"/" as prefix and priorities them
for i := range groupSummary.Reference.Tags {
t := groupSummary.Reference.Tags[i].Name
fmt.Println(t)
if semver.IsValid(t) {
tags = append(tags, tag.Context().Tag(t))
tags := make([]name.Tag, 0, len(ref.Tags))
for i := range ref.Tags {
t := ref.Tags[i].Name
if semver.IsValid(t) || semver.IsValid("v"+t) {
tags = append(tags, tag.Context().Tag(ref.Tags[i].Name))
}
}
if len(tags) == 0 {
Expand Down

0 comments on commit 366da88

Please sign in to comment.