Skip to content
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
1 change: 1 addition & 0 deletions framework/.changeset/v0.15.22.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Use RANE SOT 'version_tag' field in compat testing
6 changes: 1 addition & 5 deletions framework/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,7 @@ Be aware that any TODO requires your attention before your run the final test!
}

if product != "" {
// TODO: Stub, until versions are mapped properly and not skipped this is just an example
// Both Git, ECR and "versions" from SOT data do not match
// so we fetch the data but do not use it for now
// test refs are populated from --refs, see docs and CI in core
_, err := framework.FindNOPsVersionsByProduct(sotURL, product, exclude)
refs, err = framework.FindNOPsVersionsByProduct(sotURL, product, exclude)
if err != nil {
return err
}
Expand Down
15 changes: 9 additions & 6 deletions framework/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ type RaneSOTResponseBody struct {
Jobs []struct {
Product string `json:"product"`
} `json:"jobs"`
Version string `json:"version"`
DockerTag string `json:"docker_tag"`
VersionTag string `json:"version_tag"`
} `json:"nodes"`
}

Expand Down Expand Up @@ -401,22 +402,24 @@ func FindNOPsVersionsByProduct(url string, product string, exclude []string) ([]
if err != nil {
return nil, fmt.Errorf("failed to fetch SOT data: %w", err)
}
refs := make([]string, 0)
versions := make([]string, 0)
products := make(map[string]bool)
seenRefs := make(map[string]bool, 0)
for _, n := range src.Nodes {
for _, j := range n.Jobs {
products[j.Product] = true
if j.Product == product {
if _, ok := seenRefs[n.Version]; !ok {
refs = append(refs, n.Version)
seenRefs[n.Version] = true
if _, ok := seenRefs[n.VersionTag]; !ok {
versions = append(versions, n.VersionTag)
seenRefs[n.VersionTag] = true
}
}
}
}
semverTags := FilterSemverTags(refs, []string{}, exclude, "")
L.Info().Any("Tags", versions).Msg("Found Version tags")
semverTags := FilterSemverTags(versions, []string{}, exclude, "")
slices.Reverse(semverTags)
L.Info().Any("SemVerTags", semverTags).Msg("Found SemVer tags")
L.Info().Any("Products", slices.Collect(maps.Keys(products))).Msg("Found products")
return semverTags, nil
}
Expand Down
Loading