Skip to content

Commit

Permalink
Merge pull request #152 from ptr727/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ptr727 authored May 6, 2024
2 parents e91c130 + eba609e commit e549fab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions CreateMatrix/ReleaseVersionForward.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@ public static void Verify(List<ProductInfo> oldProductList, List<ProductInfo> ne

private static void Verify(ProductInfo oldProduct, ProductInfo newProduct, VersionInfo.LabelType label)
{
// Find label in old product, skip if not present
// TODO: It is possible that a label is released, then pulled, then re-released with a lesser version

// Find label in old and new product, skip if not present
var oldVersion = oldProduct.Versions.FirstOrDefault(item => item.Labels.Contains(label));
if (oldVersion == default(VersionInfo))
{
Log.Logger.Warning("{Product}:{Label} : Label not found", oldProduct.Product, label);
return;
}

// New product must have the same label
var newVersion = newProduct.Versions.First(item => item.Labels.Contains(label));
// Find label in new product, skip if not present
var newVersion = newProduct.Versions.FirstOrDefault(item => item.Labels.Contains(label));
if (newVersion == default(VersionInfo))
{
Log.Logger.Warning("{Product}:{Label} : Label not found", newProduct.Product, label);
return;
}

// New version must be >= old version
if (oldVersion.CompareTo(newVersion) <= 0)
Expand Down

0 comments on commit e549fab

Please sign in to comment.