From 8d936778ce29555a820724f508d79457022934c3 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Mon, 8 Apr 2024 21:08:27 -0700 Subject: [PATCH 1/6] Adding unit tests --- CreateMatrix/CreateMatrix.csproj | 4 + CreateMatrix/ProductInfo.cs | 9 +- CreateMatrix/ReleaseVersionForward.cs | 22 +-- CreateMatrix/ReleasesJsonSchema.cs | 11 +- CreateMatrixTests/CreateMatrixTests.csproj | 33 ++++ CreateMatrixTests/ReleasesTests.cs | 178 +++++++++++++++++++++ CreateMatrixTests/VersionForwardTests.cs | 130 +++++++++++++++ NxWitness.code-workspace | 10 +- NxWitness.sln | 20 +++ README.md | 2 + version.json | 2 +- 11 files changed, 395 insertions(+), 26 deletions(-) create mode 100644 CreateMatrixTests/CreateMatrixTests.csproj create mode 100644 CreateMatrixTests/ReleasesTests.cs create mode 100644 CreateMatrixTests/VersionForwardTests.cs diff --git a/CreateMatrix/CreateMatrix.csproj b/CreateMatrix/CreateMatrix.csproj index be34107..56b5450 100644 --- a/CreateMatrix/CreateMatrix.csproj +++ b/CreateMatrix/CreateMatrix.csproj @@ -15,4 +15,8 @@ + + + + diff --git a/CreateMatrix/ProductInfo.cs b/CreateMatrix/ProductInfo.cs index 88bc2e3..4c73659 100644 --- a/CreateMatrix/ProductInfo.cs +++ b/CreateMatrix/ProductInfo.cs @@ -55,6 +55,9 @@ public static List GetProducts() public void GetVersions() { + // Match the logic with ReleasesTests.CreateProductInfo() + // TODO: Refactor to reduce duplication and chance of divergence + // Get version information using releases.json and package.json Log.Logger.Information("{Product}: Getting online release information...", Product); try @@ -67,7 +70,7 @@ public void GetVersions() foreach (var release in releasesList) { // We expect only "vms" products - Debug.Assert(release.Product.Equals("vms", StringComparison.OrdinalIgnoreCase)); + Debug.Assert(release.Product.Equals(ReleasesJsonSchema.Release.VmsProduct, StringComparison.OrdinalIgnoreCase)); // Set version VersionInfo versionInfo = new(); @@ -123,7 +126,7 @@ private bool VerifyVersion(VersionInfo versionInfo) return false; } - private void AddLabel(VersionInfo versionInfo, VersionInfo.LabelType label) + internal void AddLabel(VersionInfo versionInfo, VersionInfo.LabelType label) { // Ignore if label is None if (label == VersionInfo.LabelType.None) @@ -164,7 +167,7 @@ private void AddLabel(VersionInfo versionInfo, VersionInfo.LabelType label) return default; } - private void VerifyLabels() + internal void VerifyLabels() { // Sort by version number Versions.Sort(new VersionInfoComparer()); diff --git a/CreateMatrix/ReleaseVersionForward.cs b/CreateMatrix/ReleaseVersionForward.cs index 7acbafd..0b9fb83 100644 --- a/CreateMatrix/ReleaseVersionForward.cs +++ b/CreateMatrix/ReleaseVersionForward.cs @@ -8,24 +8,26 @@ internal static void Verify(List oldProductList, List { // newProductList will be updated in-place - // Verify all products - foreach (var product in ProductInfo.GetProductTypes()) + // Verify against all products in the old list + foreach (var oldProduct in oldProductList) { - // Find matching products - var oldProduct = oldProductList.First(item => item.Product == product); - var newProduct = newProductList.First(item => item.Product == product); + // Find matching new product, must be present + var newProduct = newProductList.First(item => item.Product == oldProduct.Product); - // Verify only Stable and Latest, other labels are optional - List< VersionInfo.LabelType> labels = [ VersionInfo.LabelType.Stable, VersionInfo.LabelType.Latest ]; - foreach (var label in labels) + // Verify all labels + foreach (var label in VersionInfo.GetLabelTypes()) Verify(oldProduct, newProduct, label); } } private static void Verify(ProductInfo oldProduct, ProductInfo newProduct, VersionInfo.LabelType label) { - // Find matching versions - var oldVersion = oldProduct.Versions.First(item => item.Labels.Contains(label)); + // Find label in old product, skip if not present + var oldVersion = oldProduct.Versions.FirstOrDefault(item => item.Labels.Contains(label)); + if (oldVersion == default(VersionInfo)) + return; + + // New product must have the same label var newVersion = newProduct.Versions.First(item => item.Labels.Contains(label)); // New version must be >= old version diff --git a/CreateMatrix/ReleasesJsonSchema.cs b/CreateMatrix/ReleasesJsonSchema.cs index 8908030..6a36d23 100644 --- a/CreateMatrix/ReleasesJsonSchema.cs +++ b/CreateMatrix/ReleasesJsonSchema.cs @@ -40,12 +40,17 @@ internal VersionInfo.LabelType GetLabel() return PublicationType switch { // Use Stable or Latest based on if published or not - "release" => IsPublished() ? VersionInfo.LabelType.Stable : VersionInfo.LabelType.Latest, - "rc" => VersionInfo.LabelType.RC, - "beta" => VersionInfo.LabelType.Beta, + ReleasePublication => IsPublished() ? VersionInfo.LabelType.Stable : VersionInfo.LabelType.Latest, + RcPublication => VersionInfo.LabelType.RC, + BetaPublication => VersionInfo.LabelType.Beta, _ => throw new InvalidEnumArgumentException($"Unknown PublicationType: {PublicationType}") }; } + internal const string ReleasePublication = "release"; + internal const string RcPublication = "rc"; + internal const string BetaPublication = "beta"; + internal const string VmsProduct = "vms"; + private bool IsPublished() { // Logic follows similar patterns as used in C++ Desktop Client diff --git a/CreateMatrixTests/CreateMatrixTests.csproj b/CreateMatrixTests/CreateMatrixTests.csproj new file mode 100644 index 0000000..1b29a0a --- /dev/null +++ b/CreateMatrixTests/CreateMatrixTests.csproj @@ -0,0 +1,33 @@ + + + + net8.0 + enable + enable + + false + true + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/CreateMatrixTests/ReleasesTests.cs b/CreateMatrixTests/ReleasesTests.cs new file mode 100644 index 0000000..b3d30bc --- /dev/null +++ b/CreateMatrixTests/ReleasesTests.cs @@ -0,0 +1,178 @@ +using CreateMatrix; + +namespace CreateMatrixTests; + +public class ReleasesTests +{ + [Fact] + public void MatchLabels() + { + // Create test releases + var releasesSchema = new ReleasesJsonSchema + { + Releases = [ + // Stable, published and released + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, ReleaseDate = 1, ReleaseDeliveryDays = 1, Version = "1.0" }, + // Latest, published not released + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "2.0" }, + // RC + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.RcPublication, Version = "3.0" }, + // Beta + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.BetaPublication, Version = "4.0" } + ] + }; + + // Create ProductInfo from schema + var productInfo = CreateProductInfo(releasesSchema); + + // 4 versions + Assert.Equal(4, productInfo.Versions.Count); + // 1 Latest + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Latest))); + // 1 Stable + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Stable))); + // 1 RC + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.RC))); + // 1 Beta + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Beta))); + // 1 label per version + Assert.Equal(4, productInfo.Versions.Count(item => item.Labels.Count == 1)); + } + + [Fact] + public void MissingLatest() + { + // Similar to MissingStable() + + // Create test releases + var releasesSchema = new ReleasesJsonSchema + { + Releases = [ + // Stable, published and released + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, ReleaseDate = 1, ReleaseDeliveryDays = 1, Version = "1.0" }, + // RC + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.RcPublication, Version = "3.0" }, + // Beta + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.BetaPublication, Version = "4.0" } + ] + }; + + // Create ProductInfo from schema + var productInfo = CreateProductInfo(releasesSchema); + + // 3 versions + Assert.Equal(3, productInfo.Versions.Count); + // 1 Latest + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Latest))); + // 1 Stable + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Stable))); + // 1 RC + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.RC))); + // 1 Beta + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Beta))); + + // Select all Latest or Stable labels + var latestVersions = productInfo.Versions.Where(item => (item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable))); + // Should just be 1 entry + Assert.Single(latestVersions); + // Should have Latest and Stable labels + var version = latestVersions.First(); + Assert.Equal(2, version.Labels.Count); + } + + [Fact] + public void MissingStable() + { + // Similar to MissingLatest() + + // Create test releases + var releasesSchema = new ReleasesJsonSchema + { + Releases = [ + // Latest, published not released + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "1.0" }, + // RC + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.RcPublication, Version = "3.0" }, + // Beta + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.BetaPublication, Version = "4.0" } + ] + }; + + // Create ProductInfo from schema + var productInfo = CreateProductInfo(releasesSchema); + + // 3 versions + Assert.Equal(3, productInfo.Versions.Count); + // 1 Latest + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Latest))); + // 1 Stable + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Stable))); + // 1 RC + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.RC))); + // 1 Beta + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Beta))); + + // Select all Latest or Stable labels + var latestVersions = productInfo.Versions.Where(item => (item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable))); + // Should just be 1 entry + Assert.Single(latestVersions); + // Should have Latest and Stable labels + var version = latestVersions.First(); + Assert.Equal(2, version.Labels.Count); + } + + [Fact] + public void MultipleReleases() + { + // Create test releases + var releasesSchema = new ReleasesJsonSchema + { + Releases = [ + // Published not released + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "2.0" }, + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "3.0" }, + new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "4.0" }, + ] + }; + + // Create ProductInfo from schema + var productInfo = CreateProductInfo(releasesSchema); + + // 1 version + Assert.Single(productInfo.Versions); + // 2 labels per version + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Count == 2)); + // 1 Latest + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Latest))); + // 1 Stable + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Stable))); + + // Select all Latest or Stable labels + var latestVersions = productInfo.Versions.Where(item => (item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable))); + // Should just be 1 entry + Assert.Single(latestVersions); + // Should have Latest and Stable labels + var version = latestVersions.First(); + Assert.Equal(2, version.Labels.Count); + + // Should be the v4.0 version + Assert.Equal("4.0", version.Version); + } + + private static ProductInfo CreateProductInfo(ReleasesJsonSchema releasesSchema) + { + // Match the logic with ProductInfo.GetVersions() + // TODO: Refactor to reduce duplication and chance of divergence + ProductInfo productInfo = new(); + foreach (var release in releasesSchema.Releases) + { + VersionInfo versionInfo = new(); + versionInfo.SetVersion(release.Version); + productInfo.AddLabel(versionInfo, release.GetLabel()); + productInfo.Versions.Add(versionInfo); + } + productInfo.VerifyLabels(); + + return productInfo; + } +} \ No newline at end of file diff --git a/CreateMatrixTests/VersionForwardTests.cs b/CreateMatrixTests/VersionForwardTests.cs new file mode 100644 index 0000000..22c6a2a --- /dev/null +++ b/CreateMatrixTests/VersionForwardTests.cs @@ -0,0 +1,130 @@ +using CreateMatrix; + +namespace CreateMatrixTests; + +public class VersionForwardTests +{ + [Fact] + public void VersionForward() + { + // Create test releases + var oldProductList = new List() + { + new ProductInfo() + { + Product = ProductInfo.ProductType.NxMeta, + Versions = new List() + { + new VersionInfo { Version = "1.0", Labels = [ VersionInfo.LabelType.Stable ] }, + new VersionInfo { Version = "2.0", Labels = [ VersionInfo.LabelType.Latest ] }, + new VersionInfo { Version = "3.0", Labels = [ VersionInfo.LabelType.RC ] }, + new VersionInfo { Version = "4.0", Labels = [ VersionInfo.LabelType.Beta ] } + } + } + }; + var newProductList = new List() + { + new ProductInfo() + { + Product = ProductInfo.ProductType.NxMeta, + Versions = new List() + { + new VersionInfo { Version = "1.1", Labels = [ VersionInfo.LabelType.Stable ] }, + new VersionInfo { Version = "2.1", Labels = [ VersionInfo.LabelType.Latest ] }, + new VersionInfo { Version = "3.1", Labels = [ VersionInfo.LabelType.RC ] }, + new VersionInfo { Version = "4.1", Labels = [ VersionInfo.LabelType.Beta ] } + } + } + }; + + // newProductList will be updated in-place + // Only Stable and Latest is tested + // Versions with multiple labels will update the version not the individual labels + ReleaseVersionForward.Verify(oldProductList, newProductList); + var productInfo = newProductList.First(); + + // 4 versions + Assert.Equal(4, productInfo.Versions.Count); + // 1 Latest + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Latest))); + // 1 Stable + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Stable))); + // 1 RC + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.RC))); + // 1 Beta + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Beta))); + // 1 label per version + Assert.Equal(4, productInfo.Versions.Count(item => item.Labels.Count == 1)); + + // Stable 1.1 + Assert.Equal("1.1", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.Stable))?.Version); + // Latest 2.1 + Assert.Equal("2.1", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.Latest))?.Version); + // RC 3.1 + Assert.Equal("3.1", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.RC))?.Version); + // Beta 4.1 + Assert.Equal("4.1", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.Beta))?.Version); + } + + [Fact] + public void VersionRegress() + { + // Create test releases + var oldProductList = new List() + { + new ProductInfo() + { + Product = ProductInfo.ProductType.NxMeta, + Versions = new List() + { + new VersionInfo { Version = "1.0", Labels = [ VersionInfo.LabelType.Stable ] }, + new VersionInfo { Version = "2.0", Labels = [ VersionInfo.LabelType.Latest ] }, + new VersionInfo { Version = "3.0", Labels = [ VersionInfo.LabelType.RC ] }, + new VersionInfo { Version = "4.0", Labels = [ VersionInfo.LabelType.Beta ] } + } + } + }; + var newProductList = new List() + { + new ProductInfo() + { + Product = ProductInfo.ProductType.NxMeta, + Versions = new List() + { + new VersionInfo { Version = "0.9", Labels = [ VersionInfo.LabelType.Stable ] }, + new VersionInfo { Version = "1.9", Labels = [ VersionInfo.LabelType.Latest ] }, + new VersionInfo { Version = "2.9", Labels = [ VersionInfo.LabelType.RC ] }, + new VersionInfo { Version = "3.9", Labels = [ VersionInfo.LabelType.Beta ] } + } + } + }; + + // newProductList will be updated in-place + // Only Stable and Latest is tested + // Versions with multiple labels will update the version not the individual labels + ReleaseVersionForward.Verify(oldProductList, newProductList); + var productInfo = newProductList.First(); + + // 4 versions + Assert.Equal(4, productInfo.Versions.Count); + // 1 Latest + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Latest))); + // 1 Stable + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Stable))); + // 1 RC + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.RC))); + // 1 Beta + Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Beta))); + // 1 label per version + Assert.Equal(4, productInfo.Versions.Count(item => item.Labels.Count == 1)); + + // Stable 1.0 + Assert.Equal("1.0", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.Stable))?.Version); + // Latest 2.0 + Assert.Equal("2.0", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.Latest))?.Version); + // RC 3.0 + Assert.Equal("3.0", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.RC))?.Version); + // Beta 4.0 + Assert.Equal("4.0", productInfo.Versions.Find(item => item.Labels.Contains(VersionInfo.LabelType.Beta))?.Version); + } +} \ No newline at end of file diff --git a/NxWitness.code-workspace b/NxWitness.code-workspace index 77f8b81..a491c46 100644 --- a/NxWitness.code-workspace +++ b/NxWitness.code-workspace @@ -4,9 +4,7 @@ "path": "." } ], - "remoteAuthority": "wsl+ubuntu-20.04", "settings": { - "makefile.extensionOutputFolder": "./.vscode", "cSpell.words": [ "adduser", "appdata", @@ -60,12 +58,6 @@ "Viljoen", "WORKDIR", "xattr" - ], - "cSpell.ignoreWords": [ - "Repot" - ], - "yaml.schemas": { - "https://json.schemastore.org/github-issue-config.json": "file:///home/pieter/NxWitness/.github/ISSUE_TEMPLATE/config.yml" - } + ] } } \ No newline at end of file diff --git a/NxWitness.sln b/NxWitness.sln index 78abefd..9064adb 100644 --- a/NxWitness.sln +++ b/NxWitness.sln @@ -9,8 +9,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .dockerignore = .dockerignore .gitignore = .gitignore + HubREADME.md = HubREADME.md LICENSE = LICENSE README.md = README.md + version.json = version.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Make", "Make", "{486D3D04-33A6-4311-9E86-A8FFD8610330}" @@ -55,6 +57,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Actions", "Actions", "{7616 .github\workflows\DockerHubDescription.yml = .github\workflows\DockerHubDescription.yml EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docker", "Docker", "{7D1EA36A-E59A-4144-9014-D5ABFE44C432}" + ProjectSection(SolutionItems) = preProject + Docker\download.sh = Docker\download.sh + Docker\DWSpectrum-LSIO.Dockerfile = Docker\DWSpectrum-LSIO.Dockerfile + Docker\DWSpectrum.Dockerfile = Docker\DWSpectrum.Dockerfile + Docker\entrypoint.sh = Docker\entrypoint.sh + Docker\NxMeta-LSIO.Dockerfile = Docker\NxMeta-LSIO.Dockerfile + Docker\NxMeta.Dockerfile = Docker\NxMeta.Dockerfile + Docker\NxWitness-LSIO.Dockerfile = Docker\NxWitness-LSIO.Dockerfile + Docker\NxWitness.Dockerfile = Docker\NxWitness.Dockerfile + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CreateMatrixTests", "CreateMatrixTests\CreateMatrixTests.csproj", "{2524A282-16D8-44FD-8704-40548C96A5C3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -65,6 +81,10 @@ Global {71CFB3CE-153B-4B61-975D-9FDE9ECD4136}.Debug|Any CPU.Build.0 = Debug|Any CPU {71CFB3CE-153B-4B61-975D-9FDE9ECD4136}.Release|Any CPU.ActiveCfg = Release|Any CPU {71CFB3CE-153B-4B61-975D-9FDE9ECD4136}.Release|Any CPU.Build.0 = Release|Any CPU + {2524A282-16D8-44FD-8704-40548C96A5C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2524A282-16D8-44FD-8704-40548C96A5C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2524A282-16D8-44FD-8704-40548C96A5C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2524A282-16D8-44FD-8704-40548C96A5C3}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index db5dc23..1402f9b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Licensed under the [MIT License][license]. ## Release Notes +- Version 2.3: + - Added unit test project, testing release and upgrade control logic. - Version 2.2: - Simplified `Dockerfile` creation by using shell scripts instead of a `Makefile` (that I found too difficult to maintain and debug). - Version 2.1: diff --git a/version.json b/version.json index cffd46d..c0eecec 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "2.2", + "version": "2.3", "publicReleaseRefSpec": [ "^refs/heads/main$" ], From b5a2beefa202e649c355f661523865e3fe00d7d3 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 10 Apr 2024 09:17:52 -0700 Subject: [PATCH 2/6] Switch to Text.Json --- CreateMatrix/CreateMatrix.csproj | 3 +- CreateMatrix/MatrixJsonSchema.cs | 91 ++++++++++++-------- CreateMatrix/PackagesJsonSchema.cs | 104 +++++++++++++---------- CreateMatrix/ProductInfo.cs | 23 ++--- CreateMatrix/Program.cs | 2 +- CreateMatrix/ReleaseVersionForward.cs | 4 +- CreateMatrix/ReleasesJsonSchema.cs | 97 ++++++++++----------- CreateMatrix/VersionInfo.cs | 13 +-- CreateMatrix/VersionJsonSchema.cs | 61 ++++++------- CreateMatrixTests/ReleasesTests.cs | 32 +++---- CreateMatrixTests/VersionForwardTests.cs | 72 ++++++++-------- Make/Build.sh | 4 +- NxWitness.sln | 4 + 13 files changed, 260 insertions(+), 250 deletions(-) diff --git a/CreateMatrix/CreateMatrix.csproj b/CreateMatrix/CreateMatrix.csproj index 56b5450..980a503 100644 --- a/CreateMatrix/CreateMatrix.csproj +++ b/CreateMatrix/CreateMatrix.csproj @@ -8,8 +8,7 @@ - - + diff --git a/CreateMatrix/MatrixJsonSchema.cs b/CreateMatrix/MatrixJsonSchema.cs index ea9207e..f3ab60d 100644 --- a/CreateMatrix/MatrixJsonSchema.cs +++ b/CreateMatrix/MatrixJsonSchema.cs @@ -1,38 +1,30 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using Newtonsoft.Json; -using Newtonsoft.Json.Schema.Generation; -// ReSharper disable PropertyCanBeMadeInitOnly.Global +using Json.Schema.Generation; +using Json.Schema; +using System.Text.Json; +using System.Text.Json.Serialization; +using System.Text.Json.Serialization.Metadata; namespace CreateMatrix; public class MatrixJsonSchemaBase { - protected const string SchemaUri = "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Matrix.schema.json"; - // Schema reference - [JsonProperty(PropertyName = "$schema", Order = -3)] + [JsonPropertyName("$schema")] + [JsonPropertyOrder(-3)] public string Schema { get; } = SchemaUri; - // Default to 0 if no value specified, and always write the version first - [DefaultValue(0)] - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate, Order = -2)] + [JsonRequired] + [JsonPropertyOrder(-2)] public int SchemaVersion { get; set; } = MatrixJsonSchema.Version; + + protected const string SchemaUri = "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Matrix.schema.json"; } public class MatrixJsonSchema : MatrixJsonSchemaBase { public const int Version = 2; - private static readonly JsonSerializerSettings Settings = new() - { - Formatting = Formatting.Indented, - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - ObjectCreationHandling = ObjectCreationHandling.Replace - }; - - [Required] + [JsonRequired] public List Images { get; set; } = []; public static MatrixJsonSchema FromFile(string path) @@ -47,12 +39,12 @@ public static void ToFile(string path, MatrixJsonSchema jsonSchema) private static string ToJson(MatrixJsonSchema jsonSchema) { - return JsonConvert.SerializeObject(jsonSchema, Settings); + return JsonSerializer.Serialize(jsonSchema, JsonWriteOptions); } private static MatrixJsonSchema FromJson(string jsonString) { - var matrixJsonSchemaBase = JsonConvert.DeserializeObject(jsonString, Settings); + var matrixJsonSchemaBase = JsonSerializer.Deserialize(jsonString, JsonReadOptions); ArgumentNullException.ThrowIfNull(matrixJsonSchemaBase); // Deserialize the correct version @@ -61,29 +53,60 @@ private static MatrixJsonSchema FromJson(string jsonString) { // Current version case Version: - var schema = JsonConvert.DeserializeObject(jsonString, Settings); + var schema = JsonSerializer.Deserialize(jsonString, JsonReadOptions); ArgumentNullException.ThrowIfNull(schema); return schema; - case 1: + // case 1: // VersionInfo::Uri was replaced with UriX64 and UriArm64 was added // Breaking change, UriArm64 is required in ARM64 docker builds - throw new InvalidEnumArgumentException($"Unsupported SchemaVersion: {schemaVersion}"); // Unknown version default: - throw new InvalidEnumArgumentException($"Unknown SchemaVersion: {schemaVersion}"); + throw new NotImplementedException(); } } public static void GenerateSchema(string path) { - var generator = new JSchemaGenerator + const string schemaVersion = "https://json-schema.org/draft/2020-12/schema"; + var schemaBuilder = new JsonSchemaBuilder().FromType(new SchemaGeneratorConfiguration { PropertyOrder = PropertyOrder.ByName }) + .Title("CreateMatrix Matrix Schema") + .Id(new Uri(SchemaUri)) + .Schema(new Uri(schemaVersion)) + .Build(); + var jsonSchema = JsonSerializer.Serialize(schemaBuilder, JsonWriteOptions); + File.WriteAllText(path, jsonSchema); + } + + public static readonly JsonSerializerOptions JsonReadOptions = new() + { + AllowTrailingCommas = true, + IncludeFields = true, + NumberHandling = JsonNumberHandling.AllowReadingFromString, + PreferredObjectCreationHandling = JsonObjectCreationHandling.Replace, + ReadCommentHandling = JsonCommentHandling.Skip + }; + + public static readonly JsonSerializerOptions JsonWriteOptions = new() + { + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + IncludeFields = true, + TypeInfoResolver = new DefaultJsonTypeInfoResolver() + .WithAddedModifier(ExcludeObsoletePropertiesModifier), + WriteIndented = true + }; + + private static void ExcludeObsoletePropertiesModifier(JsonTypeInfo typeInfo) + { + // Only process objects + if (typeInfo.Kind != JsonTypeInfoKind.Object) + return; + + // Iterate over all properties + foreach (var property in typeInfo.Properties) { - DefaultRequired = Required.Default - }; - var schema = generator.Generate(typeof(MatrixJsonSchema)); - schema.Title = "CreateMatrix Matrix Schema"; - schema.SchemaVersion = new Uri("https://json-schema.org/draft-06/schema"); - schema.Id = new Uri(SchemaUri); - File.WriteAllText(path, schema.ToString()); + // Do not serialize [Obsolete] items + if (property.AttributeProvider?.IsDefined(typeof(ObsoleteAttribute), true) == true) + property.ShouldSerialize = (_, _) => false; + } } } \ No newline at end of file diff --git a/CreateMatrix/PackagesJsonSchema.cs b/CreateMatrix/PackagesJsonSchema.cs index 17c2f90..578f1df 100644 --- a/CreateMatrix/PackagesJsonSchema.cs +++ b/CreateMatrix/PackagesJsonSchema.cs @@ -1,5 +1,6 @@ using System.Diagnostics; -using Newtonsoft.Json; +using System.Text.Json; +using System.Text.Json.Serialization; using Serilog; namespace CreateMatrix; @@ -8,78 +9,87 @@ namespace CreateMatrix; // https://updates.networkoptix.com/metavms/35134/packages.json // https://updates.networkoptix.com/default/35270/packages.json // https://updates.networkoptix.com/digitalwatchdog/35271/packages.json -public class PackagesJsonSchema -{ - private static readonly JsonSerializerSettings Settings = new() - { - Formatting = Formatting.Indented, - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - ObjectCreationHandling = ObjectCreationHandling.Replace - }; - public class Variant - { - [JsonProperty("name")] public string Name { get; set; } = ""; +public class Variant +{ + [JsonPropertyName("name")] + public string Name { get; set; } = ""; - [JsonProperty("minimumVersion")] public string MinimumVersion { get; set; } = ""; - } + [JsonPropertyName("minimumVersion")] + public string MinimumVersion { get; set; } = ""; +} - public class Package - { - [JsonProperty("component")] public string Component { get; set; } = ""; +public class Package +{ + [JsonPropertyName("component")] + public string Component { get; set; } = ""; - [JsonProperty("platform")] public string PlatformName { get; set; } = ""; + [JsonPropertyName("platform")] + public string PlatformName { get; set; } = ""; - [JsonProperty("file")] public string File { get; set; } = ""; + [JsonPropertyName("file")] + public string File { get; set; } = ""; - [JsonProperty("size")] public long Size { get; set; } + [JsonPropertyName("size")] + public long Size { get; set; } - [JsonProperty("md5")] public string Md5 { get; set; } = ""; + [JsonPropertyName("md5")] + public string Md5 { get; set; } = ""; - [JsonProperty("signature")] public string Signature { get; set; } = ""; + [JsonPropertyName("signature")] + public string Signature { get; set; } = ""; - [JsonProperty("variants")] public List Variants { get; set; } = []; + [JsonPropertyName("variants")] + public List Variants { get; set; } = []; - internal bool IsX64Server() - { - // Test for Server and x64 and Ubuntu - return Component.Equals("server", StringComparison.OrdinalIgnoreCase) && - PlatformName.Equals("linux_x64", StringComparison.OrdinalIgnoreCase) && - Variants.Any(variant => variant.Name.Equals("ubuntu", StringComparison.OrdinalIgnoreCase)); - } + public bool IsX64Server() + { + // Test for Server and x64 and Ubuntu + return Component.Equals("server", StringComparison.OrdinalIgnoreCase) && + PlatformName.Equals("linux_x64", StringComparison.OrdinalIgnoreCase) && + Variants.Any(variant => variant.Name.Equals("ubuntu", StringComparison.OrdinalIgnoreCase)); + } - internal bool IsArm64Server() - { - // Test for Server and Arm64 and Ubuntu - return Component.Equals("server", StringComparison.OrdinalIgnoreCase) && - PlatformName.Equals("linux_arm64", StringComparison.OrdinalIgnoreCase) && - Variants.Any(variant => variant.Name.Equals("ubuntu", StringComparison.OrdinalIgnoreCase)); - } + public bool IsArm64Server() + { + // Test for Server and Arm64 and Ubuntu + return Component.Equals("server", StringComparison.OrdinalIgnoreCase) && + PlatformName.Equals("linux_arm64", StringComparison.OrdinalIgnoreCase) && + Variants.Any(variant => variant.Name.Equals("ubuntu", StringComparison.OrdinalIgnoreCase)); } +} - [JsonProperty("version")] public string Version { get; set; } = ""; +public class PackagesJsonSchema +{ + [JsonPropertyName("version")] + public string Version { get; set; } = ""; - [JsonProperty("cloudHost")] public string CloudHost { get; set; } = ""; + [JsonPropertyName("cloudHost")] + public string CloudHost { get; set; } = ""; - [JsonProperty("releaseNotesUrl")] public string ReleaseNotesUrl { get; set; } = ""; + [JsonPropertyName("releaseNotesUrl")] + public string ReleaseNotesUrl { get; set; } = ""; - [JsonProperty("description")] public string Description { get; set; } = ""; + [JsonPropertyName("description")] + public string Description { get; set; } = ""; - [JsonProperty("eula")] public string Eula { get; set; } = ""; + [JsonPropertyName("eula")] + public string Eula { get; set; } = ""; - [JsonProperty("eulaVersion")] public long EulaVersion { get; set; } + [JsonPropertyName("eulaVersion")] + public long EulaVersion { get; set; } - [JsonProperty("packages")] public List Packages { get; set; } = []; + [JsonPropertyName("packages")] + public List Packages { get; set; } = []; private static PackagesJsonSchema FromJson(string jsonString) { - var jsonSchema = JsonConvert.DeserializeObject(jsonString, Settings); + var jsonSchema = JsonSerializer.Deserialize(jsonString, MatrixJsonSchema.JsonReadOptions); ArgumentNullException.ThrowIfNull(jsonSchema); return jsonSchema; } - internal static List GetPackages(HttpClient httpClient, string productName, int buildNumber) + public static List GetPackages(HttpClient httpClient, string productName, int buildNumber) { // Load packages JSON // https://updates.networkoptix.com/{product}/{build}/packages.json diff --git a/CreateMatrix/ProductInfo.cs b/CreateMatrix/ProductInfo.cs index 4c73659..a1f657f 100644 --- a/CreateMatrix/ProductInfo.cs +++ b/CreateMatrix/ProductInfo.cs @@ -1,21 +1,14 @@ using System.ComponentModel; using System.Diagnostics; using System.Reflection; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using System.Text.Json.Serialization; using Serilog; -// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global -// ReSharper disable PropertyCanBeMadeInitOnly.Global namespace CreateMatrix; public class ProductInfo { - // JSON serialized must be public get and set - - // Serialize enums as strings - // Use same spelling as used in Makefile - [JsonConverter(typeof(StringEnumConverter))] + [JsonConverter(typeof(JsonStringEnumConverter))] public enum ProductType { None, @@ -41,7 +34,7 @@ private string GetProductShortName() }; } - internal static IEnumerable GetProductTypes() + public static IEnumerable GetProductTypes() { // Create list of product types return Enum.GetValues(typeof(ProductType)).Cast().Where(productType => productType != ProductType.None).ToList(); @@ -70,7 +63,7 @@ public void GetVersions() foreach (var release in releasesList) { // We expect only "vms" products - Debug.Assert(release.Product.Equals(ReleasesJsonSchema.Release.VmsProduct, StringComparison.OrdinalIgnoreCase)); + Debug.Assert(release.Product.Equals(Release.VmsProduct, StringComparison.OrdinalIgnoreCase)); // Set version VersionInfo versionInfo = new(); @@ -88,10 +81,10 @@ public void GetVersions() // Get the x64 and arm64 server ubuntu server packages var packageX64 = packageList.Find(item => item.IsX64Server()); - Debug.Assert(packageX64 != default(PackagesJsonSchema.Package)); + Debug.Assert(packageX64 != default(Package)); Debug.Assert(!string.IsNullOrEmpty(packageX64.File)); var packageArm64 = packageList.Find(item => item.IsArm64Server()); - Debug.Assert(packageArm64 != default(PackagesJsonSchema.Package)); + Debug.Assert(packageArm64 != default(Package)); Debug.Assert(!string.IsNullOrEmpty(packageArm64.File)); // Create the download URLs @@ -126,7 +119,7 @@ private bool VerifyVersion(VersionInfo versionInfo) return false; } - internal void AddLabel(VersionInfo versionInfo, VersionInfo.LabelType label) + public void AddLabel(VersionInfo versionInfo, VersionInfo.LabelType label) { // Ignore if label is None if (label == VersionInfo.LabelType.None) @@ -167,7 +160,7 @@ internal void AddLabel(VersionInfo versionInfo, VersionInfo.LabelType label) return default; } - internal void VerifyLabels() + public void VerifyLabels() { // Sort by version number Versions.Sort(new VersionInfoComparer()); diff --git a/CreateMatrix/Program.cs b/CreateMatrix/Program.cs index c9bc5e6..af73715 100644 --- a/CreateMatrix/Program.cs +++ b/CreateMatrix/Program.cs @@ -10,7 +10,7 @@ namespace CreateMatrix; -internal static class Program +public static class Program { private static async Task Main(string[] args) { diff --git a/CreateMatrix/ReleaseVersionForward.cs b/CreateMatrix/ReleaseVersionForward.cs index 0b9fb83..e0e0cbf 100644 --- a/CreateMatrix/ReleaseVersionForward.cs +++ b/CreateMatrix/ReleaseVersionForward.cs @@ -2,9 +2,9 @@ namespace CreateMatrix; -internal static class ReleaseVersionForward +public static class ReleaseVersionForward { - internal static void Verify(List oldProductList, List newProductList) + public static void Verify(List oldProductList, List newProductList) { // newProductList will be updated in-place diff --git a/CreateMatrix/ReleasesJsonSchema.cs b/CreateMatrix/ReleasesJsonSchema.cs index 6a36d23..9e4977c 100644 --- a/CreateMatrix/ReleasesJsonSchema.cs +++ b/CreateMatrix/ReleasesJsonSchema.cs @@ -1,7 +1,8 @@ -using Newtonsoft.Json; -using System.Diagnostics; -using Serilog; +using System.Diagnostics; +using System.Text.Json; +using System.Text.Json.Serialization; using System.ComponentModel; +using Serilog; namespace CreateMatrix; @@ -9,69 +10,69 @@ namespace CreateMatrix; // https://updates.vmsproxy.com/default/releases.json // https://updates.vmsproxy.com/metavms/releases.json // https://updates.vmsproxy.com/digitalwatchdog/releases.json -public class ReleasesJsonSchema + +public class Release { - private static readonly JsonSerializerSettings Settings = new() - { - Formatting = Formatting.Indented, - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - MissingMemberHandling = MissingMemberHandling.Ignore, - ObjectCreationHandling = ObjectCreationHandling.Replace - }; - - public class Release - { - [JsonProperty("product")] public string Product { get; set; } = ""; + [JsonPropertyName("product")] + public string Product { get; set; } = ""; - [JsonProperty("version")] public string Version { get; set; } = ""; + [JsonPropertyName("version")] + public string Version { get; set; } = ""; - [JsonProperty("protocol_version")] public int ProtocolVersion { get; set; } + [JsonPropertyName("protocol_version")] + public int ProtocolVersion { get; set; } - [JsonProperty("publication_type")] public string PublicationType { get; set; } = ""; + [JsonPropertyName("publication_type")] + public string PublicationType { get; set; } = ""; - [JsonProperty("release_date")] public long ReleaseDate { get; set; } + [JsonPropertyName("release_date")] + public long ReleaseDate { get; set; } - [JsonProperty("release_delivery_days")] public int ReleaseDeliveryDays { get; set; } + [JsonPropertyName("release_delivery_days")] + public int ReleaseDeliveryDays { get; set; } - internal VersionInfo.LabelType GetLabel() - { - // Determine the equivalent label - return PublicationType switch - { - // Use Stable or Latest based on if published or not - ReleasePublication => IsPublished() ? VersionInfo.LabelType.Stable : VersionInfo.LabelType.Latest, - RcPublication => VersionInfo.LabelType.RC, - BetaPublication => VersionInfo.LabelType.Beta, - _ => throw new InvalidEnumArgumentException($"Unknown PublicationType: {PublicationType}") - }; - } - internal const string ReleasePublication = "release"; - internal const string RcPublication = "rc"; - internal const string BetaPublication = "beta"; - internal const string VmsProduct = "vms"; - - private bool IsPublished() + public VersionInfo.LabelType GetLabel() + { + // Determine the equivalent label + return PublicationType switch { - // Logic follows similar patterns as used in C++ Desktop Client - // https://github.com/networkoptix/nx_open/blob/526967920636d3119c92a5220290ecc10957bf12/vms/libs/nx_vms_update/src/nx/vms/update/releases_info.cpp#L57 - // releases_info.cpp: ReleasesInfo::selectVmsRelease(), isBuildPublished(), canReceiveUnpublishedBuild() - return ReleaseDate > 0 && ReleaseDeliveryDays >= 0; - } + // Use Stable or Latest based on if published or not + ReleasePublication => IsPublished() ? VersionInfo.LabelType.Stable : VersionInfo.LabelType.Latest, + RcPublication => VersionInfo.LabelType.RC, + BetaPublication => VersionInfo.LabelType.Beta, + _ => throw new InvalidEnumArgumentException($"Unknown PublicationType: {PublicationType}") + }; + } + public const string ReleasePublication = "release"; + public const string RcPublication = "rc"; + public const string BetaPublication = "beta"; + public const string VmsProduct = "vms"; + + private bool IsPublished() + { + // Logic follows similar patterns as used in C++ Desktop Client + // https://github.com/networkoptix/nx_open/blob/526967920636d3119c92a5220290ecc10957bf12/vms/libs/nx_vms_update/src/nx/vms/update/releases_info.cpp#L57 + // releases_info.cpp: ReleasesInfo::selectVmsRelease(), isBuildPublished(), canReceiveUnpublishedBuild() + return ReleaseDate > 0 && ReleaseDeliveryDays >= 0; } +} - [JsonProperty("packages_urls")] public List PackagesUrls { get; set; } = []; +public class ReleasesJsonSchema +{ + [JsonPropertyName("packages_urls")] + public List PackagesUrls { get; set; } = []; - [JsonProperty("releases")] public List Releases { get; set; } = []; + [JsonPropertyName("releases")] + public List Releases { get; set; } = []; private static ReleasesJsonSchema FromJson(string jsonString) { - var jsonSchema = JsonConvert.DeserializeObject(jsonString, Settings); + var jsonSchema = JsonSerializer.Deserialize(jsonString, MatrixJsonSchema.JsonReadOptions); ArgumentNullException.ThrowIfNull(jsonSchema); return jsonSchema; } - internal static List GetReleases(HttpClient httpClient, string productName) + public static List GetReleases(HttpClient httpClient, string productName) { // Load releases JSON // https://updates.vmsproxy.com/{product}/releases.json diff --git a/CreateMatrix/VersionInfo.cs b/CreateMatrix/VersionInfo.cs index 88113e8..b8c5c7e 100644 --- a/CreateMatrix/VersionInfo.cs +++ b/CreateMatrix/VersionInfo.cs @@ -1,17 +1,10 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global +using System.Text.Json.Serialization; namespace CreateMatrix; public class VersionInfo { - // JSON serialized must be public get and set - - // Serialize enums as strings - [JsonConverter(typeof(StringEnumConverter))] + [JsonConverter(typeof(JsonStringEnumConverter))] public enum LabelType { None, @@ -54,7 +47,7 @@ public int CompareTo(string rhs) return Compare(Version, rhs); } - internal static int Compare(string lhs, string rhs) + public static int Compare(string lhs, string rhs) { // Compare version numbers using Version class var lhsVersion = new Version(lhs); diff --git a/CreateMatrix/VersionJsonSchema.cs b/CreateMatrix/VersionJsonSchema.cs index b382264..463ff01 100644 --- a/CreateMatrix/VersionJsonSchema.cs +++ b/CreateMatrix/VersionJsonSchema.cs @@ -1,38 +1,28 @@ -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using Newtonsoft.Json; -using Newtonsoft.Json.Schema.Generation; -// ReSharper disable PropertyCanBeMadeInitOnly.Global +using Json.Schema.Generation; +using Json.Schema; +using System.Text.Json; +using System.Text.Json.Serialization; namespace CreateMatrix; public class VersionJsonSchemaBase { - protected const string SchemaUri = "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Version.schema.json"; - - // Schema reference - [JsonProperty(PropertyName = "$schema", Order = -3)] + [JsonPropertyName("$schema")] + [JsonPropertyOrder(-3)] public string Schema { get; } = SchemaUri; - // Default to 0 if no value specified, and always write the version first - [DefaultValue(0)] - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate, Order = -2)] + [JsonRequired] + [JsonPropertyOrder(-2)] public int SchemaVersion { get; set; } = VersionJsonSchema.Version; + + protected const string SchemaUri = "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Version.schema.json"; } public class VersionJsonSchema : VersionJsonSchemaBase { public const int Version = 2; - private static readonly JsonSerializerSettings Settings = new() - { - Formatting = Formatting.Indented, - StringEscapeHandling = StringEscapeHandling.EscapeNonAscii, - NullValueHandling = NullValueHandling.Ignore, - ObjectCreationHandling = ObjectCreationHandling.Replace - }; - - [Required] + [JsonRequired] public List Products { get; set; } = []; public static VersionJsonSchema FromFile(string path) @@ -48,43 +38,40 @@ public static void ToFile(string path, VersionJsonSchema jsonSchema) private static string ToJson(VersionJsonSchema jsonSchema) { - return JsonConvert.SerializeObject(jsonSchema, Settings); + return JsonSerializer.Serialize(jsonSchema, MatrixJsonSchema.JsonWriteOptions); } private static VersionJsonSchema FromJson(string jsonString) { - var versionJsonSchemaBase = JsonConvert.DeserializeObject(jsonString, Settings); + var versionJsonSchemaBase = JsonSerializer.Deserialize(jsonString, MatrixJsonSchema.JsonReadOptions); ArgumentNullException.ThrowIfNull(versionJsonSchemaBase); // Deserialize the correct version var schemaVersion = versionJsonSchemaBase.SchemaVersion; switch (schemaVersion) { - // Current version case Version: - var schema = JsonConvert.DeserializeObject(jsonString, Settings); + var schema = JsonSerializer.Deserialize(jsonString, MatrixJsonSchema.JsonReadOptions); ArgumentNullException.ThrowIfNull(schema); return schema; - case 1: + // case 1: // VersionInfo::Uri was replaced with UriX64 and UriArm64 was added // Breaking change, UriArm64 is required in ARM64 docker builds - throw new InvalidEnumArgumentException($"Unsupported SchemaVersion: {schemaVersion}"); // Unknown version default: - throw new InvalidEnumArgumentException($"Unknown SchemaVersion: {schemaVersion}"); + throw new NotImplementedException(); } } public static void GenerateSchema(string path) { - var generator = new JSchemaGenerator - { - DefaultRequired = Required.Default - }; - var schema = generator.Generate(typeof(VersionJsonSchema)); - schema.Title = "CreateMatrix Version Schema"; - schema.SchemaVersion = new Uri("https://json-schema.org/draft-06/schema"); - schema.Id = new Uri(SchemaUri); - File.WriteAllText(path, schema.ToString()); + const string schemaVersion = "https://json-schema.org/draft/2020-12/schema"; + var schemaBuilder = new JsonSchemaBuilder().FromType(new SchemaGeneratorConfiguration { PropertyOrder = PropertyOrder.ByName }) + .Title("CreateMatrix Version Schema") + .Id(new Uri(SchemaUri)) + .Schema(new Uri(schemaVersion)) + .Build(); + var jsonSchema = JsonSerializer.Serialize(schemaBuilder, MatrixJsonSchema.JsonWriteOptions); + File.WriteAllText(path, jsonSchema); } } \ No newline at end of file diff --git a/CreateMatrixTests/ReleasesTests.cs b/CreateMatrixTests/ReleasesTests.cs index b3d30bc..7f15997 100644 --- a/CreateMatrixTests/ReleasesTests.cs +++ b/CreateMatrixTests/ReleasesTests.cs @@ -12,13 +12,13 @@ public void MatchLabels() { Releases = [ // Stable, published and released - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, ReleaseDate = 1, ReleaseDeliveryDays = 1, Version = "1.0" }, + new Release { PublicationType = Release.ReleasePublication, ReleaseDate = 1, ReleaseDeliveryDays = 1, Version = "1.0" }, // Latest, published not released - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "2.0" }, + new Release { PublicationType = Release.ReleasePublication, Version = "2.0" }, // RC - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.RcPublication, Version = "3.0" }, + new Release { PublicationType = Release.RcPublication, Version = "3.0" }, // Beta - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.BetaPublication, Version = "4.0" } + new Release { PublicationType = Release.BetaPublication, Version = "4.0" } ] }; @@ -49,11 +49,11 @@ public void MissingLatest() { Releases = [ // Stable, published and released - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, ReleaseDate = 1, ReleaseDeliveryDays = 1, Version = "1.0" }, + new Release { PublicationType = Release.ReleasePublication, ReleaseDate = 1, ReleaseDeliveryDays = 1, Version = "1.0" }, // RC - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.RcPublication, Version = "3.0" }, + new Release { PublicationType = Release.RcPublication, Version = "3.0" }, // Beta - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.BetaPublication, Version = "4.0" } + new Release { PublicationType = Release.BetaPublication, Version = "4.0" } ] }; @@ -72,7 +72,7 @@ public void MissingLatest() Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Beta))); // Select all Latest or Stable labels - var latestVersions = productInfo.Versions.Where(item => (item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable))); + var latestVersions = productInfo.Versions.Where(item => item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable)); // Should just be 1 entry Assert.Single(latestVersions); // Should have Latest and Stable labels @@ -90,11 +90,11 @@ public void MissingStable() { Releases = [ // Latest, published not released - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "1.0" }, + new Release { PublicationType = Release.ReleasePublication, Version = "1.0" }, // RC - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.RcPublication, Version = "3.0" }, + new Release { PublicationType = Release.RcPublication, Version = "3.0" }, // Beta - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.BetaPublication, Version = "4.0" } + new Release { PublicationType = Release.BetaPublication, Version = "4.0" } ] }; @@ -113,7 +113,7 @@ public void MissingStable() Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Beta))); // Select all Latest or Stable labels - var latestVersions = productInfo.Versions.Where(item => (item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable))); + var latestVersions = productInfo.Versions.Where(item => item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable)); // Should just be 1 entry Assert.Single(latestVersions); // Should have Latest and Stable labels @@ -129,9 +129,9 @@ public void MultipleReleases() { Releases = [ // Published not released - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "2.0" }, - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "3.0" }, - new ReleasesJsonSchema.Release { PublicationType = ReleasesJsonSchema.Release.ReleasePublication, Version = "4.0" }, + new Release { PublicationType = Release.ReleasePublication, Version = "2.0" }, + new Release { PublicationType = Release.ReleasePublication, Version = "3.0" }, + new Release { PublicationType = Release.ReleasePublication, Version = "4.0" } ] }; @@ -148,7 +148,7 @@ public void MultipleReleases() Assert.Equal(1, productInfo.Versions.Count(item => item.Labels.Contains(VersionInfo.LabelType.Stable))); // Select all Latest or Stable labels - var latestVersions = productInfo.Versions.Where(item => (item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable))); + var latestVersions = productInfo.Versions.Where(item => item.Labels.Contains(VersionInfo.LabelType.Latest) || item.Labels.Contains(VersionInfo.LabelType.Stable)); // Should just be 1 entry Assert.Single(latestVersions); // Should have Latest and Stable labels diff --git a/CreateMatrixTests/VersionForwardTests.cs b/CreateMatrixTests/VersionForwardTests.cs index 22c6a2a..f95dc39 100644 --- a/CreateMatrixTests/VersionForwardTests.cs +++ b/CreateMatrixTests/VersionForwardTests.cs @@ -8,32 +8,32 @@ public class VersionForwardTests public void VersionForward() { // Create test releases - var oldProductList = new List() + var oldProductList = new List { - new ProductInfo() + new() { Product = ProductInfo.ProductType.NxMeta, - Versions = new List() - { - new VersionInfo { Version = "1.0", Labels = [ VersionInfo.LabelType.Stable ] }, - new VersionInfo { Version = "2.0", Labels = [ VersionInfo.LabelType.Latest ] }, - new VersionInfo { Version = "3.0", Labels = [ VersionInfo.LabelType.RC ] }, - new VersionInfo { Version = "4.0", Labels = [ VersionInfo.LabelType.Beta ] } - } + Versions = + [ + new VersionInfo { Version = "1.0", Labels = [VersionInfo.LabelType.Stable] }, + new VersionInfo { Version = "2.0", Labels = [VersionInfo.LabelType.Latest] }, + new VersionInfo { Version = "3.0", Labels = [VersionInfo.LabelType.RC] }, + new VersionInfo { Version = "4.0", Labels = [VersionInfo.LabelType.Beta] } + ] } }; - var newProductList = new List() + var newProductList = new List { - new ProductInfo() + new() { Product = ProductInfo.ProductType.NxMeta, - Versions = new List() - { - new VersionInfo { Version = "1.1", Labels = [ VersionInfo.LabelType.Stable ] }, - new VersionInfo { Version = "2.1", Labels = [ VersionInfo.LabelType.Latest ] }, - new VersionInfo { Version = "3.1", Labels = [ VersionInfo.LabelType.RC ] }, - new VersionInfo { Version = "4.1", Labels = [ VersionInfo.LabelType.Beta ] } - } + Versions = + [ + new VersionInfo { Version = "1.1", Labels = [VersionInfo.LabelType.Stable] }, + new VersionInfo { Version = "2.1", Labels = [VersionInfo.LabelType.Latest] }, + new VersionInfo { Version = "3.1", Labels = [VersionInfo.LabelType.RC] }, + new VersionInfo { Version = "4.1", Labels = [VersionInfo.LabelType.Beta] } + ] } }; @@ -70,32 +70,32 @@ public void VersionForward() public void VersionRegress() { // Create test releases - var oldProductList = new List() + var oldProductList = new List { - new ProductInfo() + new() { Product = ProductInfo.ProductType.NxMeta, - Versions = new List() - { - new VersionInfo { Version = "1.0", Labels = [ VersionInfo.LabelType.Stable ] }, - new VersionInfo { Version = "2.0", Labels = [ VersionInfo.LabelType.Latest ] }, - new VersionInfo { Version = "3.0", Labels = [ VersionInfo.LabelType.RC ] }, - new VersionInfo { Version = "4.0", Labels = [ VersionInfo.LabelType.Beta ] } - } + Versions = + [ + new VersionInfo { Version = "1.0", Labels = [VersionInfo.LabelType.Stable] }, + new VersionInfo { Version = "2.0", Labels = [VersionInfo.LabelType.Latest] }, + new VersionInfo { Version = "3.0", Labels = [VersionInfo.LabelType.RC] }, + new VersionInfo { Version = "4.0", Labels = [VersionInfo.LabelType.Beta] } + ] } }; - var newProductList = new List() + var newProductList = new List { - new ProductInfo() + new() { Product = ProductInfo.ProductType.NxMeta, - Versions = new List() - { - new VersionInfo { Version = "0.9", Labels = [ VersionInfo.LabelType.Stable ] }, - new VersionInfo { Version = "1.9", Labels = [ VersionInfo.LabelType.Latest ] }, - new VersionInfo { Version = "2.9", Labels = [ VersionInfo.LabelType.RC ] }, - new VersionInfo { Version = "3.9", Labels = [ VersionInfo.LabelType.Beta ] } - } + Versions = + [ + new VersionInfo { Version = "0.9", Labels = [VersionInfo.LabelType.Stable] }, + new VersionInfo { Version = "1.9", Labels = [VersionInfo.LabelType.Latest] }, + new VersionInfo { Version = "2.9", Labels = [VersionInfo.LabelType.RC] }, + new VersionInfo { Version = "3.9", Labels = [VersionInfo.LabelType.Beta] } + ] } }; diff --git a/Make/Build.sh b/Make/Build.sh index 4080a67..628bb08 100755 --- a/Make/Build.sh +++ b/Make/Build.sh @@ -12,8 +12,8 @@ set -e # docker run -it --rm lsiobase/ubuntu:jammy /bin/bash # export DEBIAN_FRONTEND=noninteractive # apt-get update && apt-get upgrade --yes -# apt-get install --no-install-recommends --yes mc nano strace wget gdb -# wget --no-verbose --output-document=./vms_server.zip https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip +# apt-get install --no-install-recommends --yes ca-certificates mc nano unzip wget strace gdb +# wget --output-document=./vms_server.zip https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip # unzip -d ./download_zip ./vms_server.zip # cp ./download_zip/metavms-server-5.1.2.37996-linux_x64.deb ./vms_server.deb # Install: diff --git a/NxWitness.sln b/NxWitness.sln index 9064adb..c3c82da 100644 --- a/NxWitness.sln +++ b/NxWitness.sln @@ -22,6 +22,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Make", "Make", "{486D3D04-3 Make\body-entrypoint.docker = Make\body-entrypoint.docker Make\body-lsio.docker = Make\body-lsio.docker Make\body.docker = Make\body.docker + Make\Build.sh = Make\Build.sh + Make\Clean.sh = Make\Clean.sh + Make\Create.sh = Make\Create.sh Make\Down-develop.sh = Make\Down-develop.sh Make\Down.sh = Make\Down.sh Make\DWSpectrum-LSIO.m4 = Make\DWSpectrum-LSIO.m4 @@ -36,6 +39,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Make", "Make", "{486D3D04-3 Make\nxwitness.docker = Make\nxwitness.docker Make\NxWitness.m4 = Make\NxWitness.m4 Make\Test-develop.yml = Make\Test-develop.yml + Make\Test.sh = Make\Test.sh Make\Test.yml = Make\Test.yml Make\Up-develop.sh = Make\Up-develop.sh Make\Up.sh = Make\Up.sh From 3b4eacf1c1a4bba3dc497267cf63bc9dbb78c391 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 10 Apr 2024 11:03:16 -0700 Subject: [PATCH 3/6] New schemas, support long? --- CreateMatrix/JSON/Matrix.schema.json | 99 ++++++---------- CreateMatrix/JSON/Version.schema.json | 118 ++++++++------------ CreateMatrix/MatrixJsonSchema.cs | 2 +- CreateMatrix/PackagesJsonSchema.cs | 30 ----- CreateMatrix/Properties/launchSettings.json | 2 +- CreateMatrix/ReleasesJsonSchema.cs | 10 +- 6 files changed, 86 insertions(+), 175 deletions(-) diff --git a/CreateMatrix/JSON/Matrix.schema.json b/CreateMatrix/JSON/Matrix.schema.json index deaa681..5a45991 100644 --- a/CreateMatrix/JSON/Matrix.schema.json +++ b/CreateMatrix/JSON/Matrix.schema.json @@ -1,79 +1,46 @@ { - "$schema": "https://json-schema.org/draft-06/schema", - "$id": "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Matrix.schema.json", - "title": "CreateMatrix Matrix Schema", - "definitions": { - "ImageInfo": { - "type": [ - "object", - "null" - ], - "properties": { - "Name": { - "type": [ - "string", - "null" - ] - }, - "Branch": { - "type": [ - "string", - "null" - ] - }, - "CacheScope": { - "type": [ - "string", - "null" - ] - }, - "Tags": { - "type": [ - "array", - "null" - ], - "items": { - "type": [ - "string", - "null" - ] - } - }, - "Args": { - "type": [ - "array", - "null" - ], - "items": { - "type": [ - "string", - "null" - ] + "type": "object", + "properties": { + "Images": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Args": { + "$ref": "#/$defs/listOfString" + }, + "Branch": { + "type": "string" + }, + "CacheScope": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Tags": { + "$ref": "#/$defs/listOfString" } } } - } - }, - "type": "object", - "properties": { + }, "$schema": { - "type": [ - "string", - "null" - ] + "type": "string", + "readOnly": true }, "SchemaVersion": { - "type": "integer", - "default": 0 - }, - "Images": { + "type": "integer" + } + }, + "$defs": { + "listOfString": { "type": "array", "items": { - "$ref": "#/definitions/ImageInfo" + "type": "string" } } }, - "required": [ - "Images" - ] + "title": "CreateMatrix Matrix Schema", + "$id": "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Matrix.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema" } \ No newline at end of file diff --git a/CreateMatrix/JSON/Version.schema.json b/CreateMatrix/JSON/Version.schema.json index 447ff9e..12d5c56 100644 --- a/CreateMatrix/JSON/Version.schema.json +++ b/CreateMatrix/JSON/Version.schema.json @@ -1,80 +1,60 @@ { - "$schema": "https://json-schema.org/draft-06/schema", - "$id": "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Version.schema.json", - "title": "CreateMatrix Version Schema", - "definitions": { - "ProductInfo": { - "type": [ - "object", - "null" - ], - "properties": { - "Product": {}, - "Versions": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/VersionInfo" + "type": "object", + "properties": { + "Products": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Product": { + "enum": [ + "None", + "NxMeta", + "NxWitness", + "DWSpectrum" + ] + }, + "Versions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "Labels": { + "type": "array", + "items": { + "enum": [ + "None", + "Stable", + "Latest", + "Beta", + "RC" + ] + } + }, + "UriArm64": { + "type": "string" + }, + "UriX64": { + "type": "string" + }, + "Version": { + "type": "string" + } + } + } } } } }, - "VersionInfo": { - "type": [ - "object", - "null" - ], - "properties": { - "Version": { - "type": [ - "string", - "null" - ] - }, - "UriX64": { - "type": [ - "string", - "null" - ] - }, - "UriArm64": { - "type": [ - "string", - "null" - ] - }, - "Labels": { - "type": [ - "array", - "null" - ], - "items": {} - } - } - } - }, - "type": "object", - "properties": { "$schema": { - "type": [ - "string", - "null" - ] + "type": "string", + "readOnly": true }, "SchemaVersion": { - "type": "integer", - "default": 0 - }, - "Products": { - "type": "array", - "items": { - "$ref": "#/definitions/ProductInfo" - } + "type": "integer" } }, - "required": [ - "Products" - ] + "title": "CreateMatrix Version Schema", + "$id": "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Version.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema" } \ No newline at end of file diff --git a/CreateMatrix/MatrixJsonSchema.cs b/CreateMatrix/MatrixJsonSchema.cs index f3ab60d..b5d498f 100644 --- a/CreateMatrix/MatrixJsonSchema.cs +++ b/CreateMatrix/MatrixJsonSchema.cs @@ -109,4 +109,4 @@ private static void ExcludeObsoletePropertiesModifier(JsonTypeInfo typeInfo) property.ShouldSerialize = (_, _) => false; } } -} \ No newline at end of file +} diff --git a/CreateMatrix/PackagesJsonSchema.cs b/CreateMatrix/PackagesJsonSchema.cs index 578f1df..a81c41a 100644 --- a/CreateMatrix/PackagesJsonSchema.cs +++ b/CreateMatrix/PackagesJsonSchema.cs @@ -14,9 +14,6 @@ public class Variant { [JsonPropertyName("name")] public string Name { get; set; } = ""; - - [JsonPropertyName("minimumVersion")] - public string MinimumVersion { get; set; } = ""; } public class Package @@ -30,15 +27,6 @@ public class Package [JsonPropertyName("file")] public string File { get; set; } = ""; - [JsonPropertyName("size")] - public long Size { get; set; } - - [JsonPropertyName("md5")] - public string Md5 { get; set; } = ""; - - [JsonPropertyName("signature")] - public string Signature { get; set; } = ""; - [JsonPropertyName("variants")] public List Variants { get; set; } = []; @@ -61,24 +49,6 @@ public bool IsArm64Server() public class PackagesJsonSchema { - [JsonPropertyName("version")] - public string Version { get; set; } = ""; - - [JsonPropertyName("cloudHost")] - public string CloudHost { get; set; } = ""; - - [JsonPropertyName("releaseNotesUrl")] - public string ReleaseNotesUrl { get; set; } = ""; - - [JsonPropertyName("description")] - public string Description { get; set; } = ""; - - [JsonPropertyName("eula")] - public string Eula { get; set; } = ""; - - [JsonPropertyName("eulaVersion")] - public long EulaVersion { get; set; } - [JsonPropertyName("packages")] public List Packages { get; set; } = []; diff --git a/CreateMatrix/Properties/launchSettings.json b/CreateMatrix/Properties/launchSettings.json index f9a2edf..ba72c33 100644 --- a/CreateMatrix/Properties/launchSettings.json +++ b/CreateMatrix/Properties/launchSettings.json @@ -17,7 +17,7 @@ "Schema": { "commandName": "Project", "commandLineArgs": "schema --schemaversion ./JSON/Version.schema.json --schemamatrix ./JSON/Matrix.schema.json", - "workingDirectory": "$(SolutionDir)" + "workingDirectory": "$(ProjectDir)" }, "Make": { "commandName": "Project", diff --git a/CreateMatrix/ReleasesJsonSchema.cs b/CreateMatrix/ReleasesJsonSchema.cs index 9e4977c..3323790 100644 --- a/CreateMatrix/ReleasesJsonSchema.cs +++ b/CreateMatrix/ReleasesJsonSchema.cs @@ -19,17 +19,14 @@ public class Release [JsonPropertyName("version")] public string Version { get; set; } = ""; - [JsonPropertyName("protocol_version")] - public int ProtocolVersion { get; set; } - [JsonPropertyName("publication_type")] public string PublicationType { get; set; } = ""; [JsonPropertyName("release_date")] - public long ReleaseDate { get; set; } + public long? ReleaseDate { get; set; } [JsonPropertyName("release_delivery_days")] - public int ReleaseDeliveryDays { get; set; } + public long? ReleaseDeliveryDays { get; set; } public VersionInfo.LabelType GetLabel() { @@ -59,9 +56,6 @@ private bool IsPublished() public class ReleasesJsonSchema { - [JsonPropertyName("packages_urls")] - public List PackagesUrls { get; set; } = []; - [JsonPropertyName("releases")] public List Releases { get; set; } = []; From b250b5655aa8e2727b9a85cbc32cce95c369e843 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 10 Apr 2024 11:13:10 -0700 Subject: [PATCH 4/6] Readme --- Make/Matrix.json | 224 ++++++++++++++++++++++++---------------------- Make/Version.json | 40 +++++---- README.md | 3 +- 3 files changed, 139 insertions(+), 128 deletions(-) diff --git a/Make/Matrix.json b/Make/Matrix.json index 6aaaeae..43031d8 100644 --- a/Make/Matrix.json +++ b/Make/Matrix.json @@ -2,27 +2,14 @@ "$schema": "https://raw.githubusercontent.com/ptr727/NxWitness/main/CreateMatrix/JSON/Matrix.schema.json", "SchemaVersion": 2, "Images": [ - { - "Name": "NxMeta", - "Branch": "main", - "CacheScope": "default", - "Tags": [ - "docker.io/ptr727/nxmeta:5.1.2.37996", - "docker.io/ptr727/nxmeta:stable" - ], - "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip" - ] - }, { "Name": "NxMeta", "Branch": "main", "CacheScope": "default", "Tags": [ "docker.io/ptr727/nxmeta:5.1.3.38363", - "docker.io/ptr727/nxmeta:latest" + "docker.io/ptr727/nxmeta:latest", + "docker.io/ptr727/nxmeta:stable" ], "Args": [ "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38363/metavms-server_update-5.1.3.38363-linux_arm64.zip", @@ -35,27 +22,13 @@ "Branch": "main", "CacheScope": "default", "Tags": [ - "docker.io/ptr727/nxmeta:6.0.0.38086", + "docker.io/ptr727/nxmeta:6.0.0.38488", "docker.io/ptr727/nxmeta:beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_arm64-beta.zip", - "DOWNLOAD_VERSION=6.0.0.38086", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_x64-beta.zip" - ] - }, - { - "Name": "NxMeta-LSIO", - "Branch": "main", - "CacheScope": "lsio", - "Tags": [ - "docker.io/ptr727/nxmeta-lsio:5.1.2.37996", - "docker.io/ptr727/nxmeta-lsio:stable" - ], - "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -64,7 +37,8 @@ "CacheScope": "lsio", "Tags": [ "docker.io/ptr727/nxmeta-lsio:5.1.3.38363", - "docker.io/ptr727/nxmeta-lsio:latest" + "docker.io/ptr727/nxmeta-lsio:latest", + "docker.io/ptr727/nxmeta-lsio:stable" ], "Args": [ "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38363/metavms-server_update-5.1.3.38363-linux_arm64.zip", @@ -77,13 +51,13 @@ "Branch": "main", "CacheScope": "lsio", "Tags": [ - "docker.io/ptr727/nxmeta-lsio:6.0.0.38086", + "docker.io/ptr727/nxmeta-lsio:6.0.0.38488", "docker.io/ptr727/nxmeta-lsio:beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_arm64-beta.zip", - "DOWNLOAD_VERSION=6.0.0.38086", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_x64-beta.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -91,13 +65,14 @@ "Branch": "main", "CacheScope": "default", "Tags": [ - "docker.io/ptr727/nxwitness:5.1.2.37996", + "docker.io/ptr727/nxwitness:5.1.3.38363", + "docker.io/ptr727/nxwitness:latest", "docker.io/ptr727/nxwitness:stable" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", + "DOWNLOAD_VERSION=5.1.3.38363", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" ] }, { @@ -105,13 +80,13 @@ "Branch": "main", "CacheScope": "default", "Tags": [ - "docker.io/ptr727/nxwitness:5.1.3.38363", - "docker.io/ptr727/nxwitness:latest" + "docker.io/ptr727/nxwitness:6.0.0.38488", + "docker.io/ptr727/nxwitness:beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.3.38363", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -119,13 +94,14 @@ "Branch": "main", "CacheScope": "lsio", "Tags": [ - "docker.io/ptr727/nxwitness-lsio:5.1.2.37996", + "docker.io/ptr727/nxwitness-lsio:5.1.3.38363", + "docker.io/ptr727/nxwitness-lsio:latest", "docker.io/ptr727/nxwitness-lsio:stable" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", + "DOWNLOAD_VERSION=5.1.3.38363", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" ] }, { @@ -133,13 +109,13 @@ "Branch": "main", "CacheScope": "lsio", "Tags": [ - "docker.io/ptr727/nxwitness-lsio:5.1.3.38363", - "docker.io/ptr727/nxwitness-lsio:latest" + "docker.io/ptr727/nxwitness-lsio:6.0.0.38488", + "docker.io/ptr727/nxwitness-lsio:beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.3.38363", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -170,6 +146,20 @@ "DOWNLOAD_X64_URL=https://updates.networkoptix.com/digitalwatchdog/38363/dwspectrum-server_update-5.1.3.38363-linux_x64.zip" ] }, + { + "Name": "DWSpectrum", + "Branch": "main", + "CacheScope": "default", + "Tags": [ + "docker.io/ptr727/dwspectrum:6.0.0.38488", + "docker.io/ptr727/dwspectrum:beta" + ], + "Args": [ + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_x64-beta.zip" + ] + }, { "Name": "DWSpectrum-LSIO", "Branch": "main", @@ -199,17 +189,17 @@ ] }, { - "Name": "NxMeta", - "Branch": "develop", - "CacheScope": "default", + "Name": "DWSpectrum-LSIO", + "Branch": "main", + "CacheScope": "lsio", "Tags": [ - "docker.io/ptr727/nxmeta:develop-5.1.2.37996", - "docker.io/ptr727/nxmeta:develop-stable" + "docker.io/ptr727/dwspectrum-lsio:6.0.0.38488", + "docker.io/ptr727/dwspectrum-lsio:beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -219,7 +209,8 @@ "Tags": [ "docker.io/ptr727/nxmeta:develop", "docker.io/ptr727/nxmeta:develop-5.1.3.38363", - "docker.io/ptr727/nxmeta:develop-latest" + "docker.io/ptr727/nxmeta:develop-latest", + "docker.io/ptr727/nxmeta:develop-stable" ], "Args": [ "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38363/metavms-server_update-5.1.3.38363-linux_arm64.zip", @@ -232,27 +223,13 @@ "Branch": "develop", "CacheScope": "default", "Tags": [ - "docker.io/ptr727/nxmeta:develop-6.0.0.38086", + "docker.io/ptr727/nxmeta:develop-6.0.0.38488", "docker.io/ptr727/nxmeta:develop-beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_arm64-beta.zip", - "DOWNLOAD_VERSION=6.0.0.38086", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_x64-beta.zip" - ] - }, - { - "Name": "NxMeta-LSIO", - "Branch": "develop", - "CacheScope": "lsio", - "Tags": [ - "docker.io/ptr727/nxmeta-lsio:develop-5.1.2.37996", - "docker.io/ptr727/nxmeta-lsio:develop-stable" - ], - "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -262,7 +239,8 @@ "Tags": [ "docker.io/ptr727/nxmeta-lsio:develop", "docker.io/ptr727/nxmeta-lsio:develop-5.1.3.38363", - "docker.io/ptr727/nxmeta-lsio:develop-latest" + "docker.io/ptr727/nxmeta-lsio:develop-latest", + "docker.io/ptr727/nxmeta-lsio:develop-stable" ], "Args": [ "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38363/metavms-server_update-5.1.3.38363-linux_arm64.zip", @@ -275,13 +253,13 @@ "Branch": "develop", "CacheScope": "lsio", "Tags": [ - "docker.io/ptr727/nxmeta-lsio:develop-6.0.0.38086", + "docker.io/ptr727/nxmeta-lsio:develop-6.0.0.38488", "docker.io/ptr727/nxmeta-lsio:develop-beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_arm64-beta.zip", - "DOWNLOAD_VERSION=6.0.0.38086", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_x64-beta.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -289,13 +267,15 @@ "Branch": "develop", "CacheScope": "default", "Tags": [ - "docker.io/ptr727/nxwitness:develop-5.1.2.37996", + "docker.io/ptr727/nxwitness:develop", + "docker.io/ptr727/nxwitness:develop-5.1.3.38363", + "docker.io/ptr727/nxwitness:develop-latest", "docker.io/ptr727/nxwitness:develop-stable" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", + "DOWNLOAD_VERSION=5.1.3.38363", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" ] }, { @@ -303,14 +283,13 @@ "Branch": "develop", "CacheScope": "default", "Tags": [ - "docker.io/ptr727/nxwitness:develop", - "docker.io/ptr727/nxwitness:develop-5.1.3.38363", - "docker.io/ptr727/nxwitness:develop-latest" + "docker.io/ptr727/nxwitness:develop-6.0.0.38488", + "docker.io/ptr727/nxwitness:develop-beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.3.38363", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -318,13 +297,15 @@ "Branch": "develop", "CacheScope": "lsio", "Tags": [ - "docker.io/ptr727/nxwitness-lsio:develop-5.1.2.37996", + "docker.io/ptr727/nxwitness-lsio:develop", + "docker.io/ptr727/nxwitness-lsio:develop-5.1.3.38363", + "docker.io/ptr727/nxwitness-lsio:develop-latest", "docker.io/ptr727/nxwitness-lsio:develop-stable" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.2.37996", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", + "DOWNLOAD_VERSION=5.1.3.38363", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" ] }, { @@ -332,14 +313,13 @@ "Branch": "develop", "CacheScope": "lsio", "Tags": [ - "docker.io/ptr727/nxwitness-lsio:develop", - "docker.io/ptr727/nxwitness-lsio:develop-5.1.3.38363", - "docker.io/ptr727/nxwitness-lsio:develop-latest" + "docker.io/ptr727/nxwitness-lsio:develop-6.0.0.38488", + "docker.io/ptr727/nxwitness-lsio:develop-beta" ], "Args": [ - "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", - "DOWNLOAD_VERSION=5.1.3.38363", - "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip" + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_x64-beta.zip" ] }, { @@ -371,6 +351,20 @@ "DOWNLOAD_X64_URL=https://updates.networkoptix.com/digitalwatchdog/38363/dwspectrum-server_update-5.1.3.38363-linux_x64.zip" ] }, + { + "Name": "DWSpectrum", + "Branch": "develop", + "CacheScope": "default", + "Tags": [ + "docker.io/ptr727/dwspectrum:develop-6.0.0.38488", + "docker.io/ptr727/dwspectrum:develop-beta" + ], + "Args": [ + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_x64-beta.zip" + ] + }, { "Name": "DWSpectrum-LSIO", "Branch": "develop", @@ -399,6 +393,20 @@ "DOWNLOAD_VERSION=5.1.3.38363", "DOWNLOAD_X64_URL=https://updates.networkoptix.com/digitalwatchdog/38363/dwspectrum-server_update-5.1.3.38363-linux_x64.zip" ] + }, + { + "Name": "DWSpectrum-LSIO", + "Branch": "develop", + "CacheScope": "lsio", + "Tags": [ + "docker.io/ptr727/dwspectrum-lsio:develop-6.0.0.38488", + "docker.io/ptr727/dwspectrum-lsio:develop-beta" + ], + "Args": [ + "DOWNLOAD_ARM64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_arm64-beta.zip", + "DOWNLOAD_VERSION=6.0.0.38488", + "DOWNLOAD_X64_URL=https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_x64-beta.zip" + ] } ] } \ No newline at end of file diff --git a/Make/Version.json b/Make/Version.json index 76cc7ca..fdec714 100644 --- a/Make/Version.json +++ b/Make/Version.json @@ -5,26 +5,19 @@ { "Product": "NxMeta", "Versions": [ - { - "Version": "5.1.2.37996", - "UriX64": "https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip", - "UriArm64": "https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_arm64.zip", - "Labels": [ - "Stable" - ] - }, { "Version": "5.1.3.38363", "UriX64": "https://updates.networkoptix.com/metavms/38363/metavms-server_update-5.1.3.38363-linux_x64.zip", "UriArm64": "https://updates.networkoptix.com/metavms/38363/metavms-server_update-5.1.3.38363-linux_arm64.zip", "Labels": [ + "Stable", "Latest" ] }, { - "Version": "6.0.0.38086", - "UriX64": "https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_x64-beta.zip", - "UriArm64": "https://updates.networkoptix.com/metavms/38086/metavms-server_update-6.0.0.38086-linux_arm64-beta.zip", + "Version": "6.0.0.38488", + "UriX64": "https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_x64-beta.zip", + "UriArm64": "https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_arm64-beta.zip", "Labels": [ "Beta" ] @@ -34,21 +27,22 @@ { "Product": "NxWitness", "Versions": [ - { - "Version": "5.1.2.37996", - "UriX64": "https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_x64.zip", - "UriArm64": "https://updates.networkoptix.com/default/37996/nxwitness-server_update-5.1.2.37996-linux_arm64.zip", - "Labels": [ - "Stable" - ] - }, { "Version": "5.1.3.38363", "UriX64": "https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_x64.zip", "UriArm64": "https://updates.networkoptix.com/default/38363/nxwitness-server_update-5.1.3.38363-linux_arm64.zip", "Labels": [ + "Stable", "Latest" ] + }, + { + "Version": "6.0.0.38488", + "UriX64": "https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_x64-beta.zip", + "UriArm64": "https://updates.networkoptix.com/default/38488/nxwitness-server_update-6.0.0.38488-linux_arm64-beta.zip", + "Labels": [ + "Beta" + ] } ] }, @@ -70,6 +64,14 @@ "Labels": [ "Latest" ] + }, + { + "Version": "6.0.0.38488", + "UriX64": "https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_x64-beta.zip", + "UriArm64": "https://updates.networkoptix.com/digitalwatchdog/38488/dwspectrum-server_update-6.0.0.38488-linux_arm64-beta.zip", + "Labels": [ + "Beta" + ] } ] } diff --git a/README.md b/README.md index 1402f9b..e4bce0e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Licensed under the [MIT License][license]. ## Release Notes - Version 2.3: - - Added unit test project, testing release and upgrade control logic. + - Added unit test project to verify the release and upgrade control logic. + - Switched from `Newtonsoft.Json` to .NET native `Text.Json`. - Version 2.2: - Simplified `Dockerfile` creation by using shell scripts instead of a `Makefile` (that I found too difficult to maintain and debug). - Version 2.1: From f250b89954bbfe882f692a085eea10b88d780111 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 10 Apr 2024 11:23:37 -0700 Subject: [PATCH 5/6] fail-fast: false --- .github/workflows/BuildPublishPipeline.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/BuildPublishPipeline.yml b/.github/workflows/BuildPublishPipeline.yml index ab94c3e..72d732f 100644 --- a/.github/workflows/BuildPublishPipeline.yml +++ b/.github/workflows/BuildPublishPipeline.yml @@ -108,6 +108,8 @@ jobs: runs-on: ubuntu-latest strategy: + # Keep building even if a job fails, helps with troubleshooting + fail-fast: false # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs matrix: images: ${{ fromJson(needs.setmatrix.outputs.matrix).images }} From 34d64cb6d2dc143379338f07ebba4410f3ca5c44 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Thu, 11 Apr 2024 07:45:49 -0700 Subject: [PATCH 6/6] Add `file` dependency --- Docker/DWSpectrum-LSIO.Dockerfile | 1 + Docker/DWSpectrum.Dockerfile | 1 + Docker/NxMeta-LSIO.Dockerfile | 1 + Docker/NxMeta.Dockerfile | 1 + Docker/NxWitness-LSIO.Dockerfile | 1 + Docker/NxWitness.Dockerfile | 1 + Make/Build.sh | 6 +++--- Make/body-entrypoint.docker | 1 + Make/body-lsio.docker | 1 + 9 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Docker/DWSpectrum-LSIO.Dockerfile b/Docker/DWSpectrum-LSIO.Dockerfile index 37653f2..35be5d5 100644 --- a/Docker/DWSpectrum-LSIO.Dockerfile +++ b/Docker/DWSpectrum-LSIO.Dockerfile @@ -82,6 +82,7 @@ RUN usermod -l ${COMPANY_NAME} abc \ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ ./vms_server.deb \ # Cleanup diff --git a/Docker/DWSpectrum.Dockerfile b/Docker/DWSpectrum.Dockerfile index 18b10c5..24e1c30 100644 --- a/Docker/DWSpectrum.Dockerfile +++ b/Docker/DWSpectrum.Dockerfile @@ -69,6 +69,7 @@ RUN chmod +x download.sh \ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ sudo \ ./vms_server.deb \ diff --git a/Docker/NxMeta-LSIO.Dockerfile b/Docker/NxMeta-LSIO.Dockerfile index 70dda07..a7b7b8c 100644 --- a/Docker/NxMeta-LSIO.Dockerfile +++ b/Docker/NxMeta-LSIO.Dockerfile @@ -82,6 +82,7 @@ RUN usermod -l ${COMPANY_NAME} abc \ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ ./vms_server.deb \ # Cleanup diff --git a/Docker/NxMeta.Dockerfile b/Docker/NxMeta.Dockerfile index 7113e43..e7c57e5 100644 --- a/Docker/NxMeta.Dockerfile +++ b/Docker/NxMeta.Dockerfile @@ -69,6 +69,7 @@ RUN chmod +x download.sh \ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ sudo \ ./vms_server.deb \ diff --git a/Docker/NxWitness-LSIO.Dockerfile b/Docker/NxWitness-LSIO.Dockerfile index a67127e..d9d535e 100644 --- a/Docker/NxWitness-LSIO.Dockerfile +++ b/Docker/NxWitness-LSIO.Dockerfile @@ -82,6 +82,7 @@ RUN usermod -l ${COMPANY_NAME} abc \ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ ./vms_server.deb \ # Cleanup diff --git a/Docker/NxWitness.Dockerfile b/Docker/NxWitness.Dockerfile index 8fdc205..ed119ce 100644 --- a/Docker/NxWitness.Dockerfile +++ b/Docker/NxWitness.Dockerfile @@ -69,6 +69,7 @@ RUN chmod +x download.sh \ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ sudo \ ./vms_server.deb \ diff --git a/Make/Build.sh b/Make/Build.sh index 628bb08..282d5bc 100755 --- a/Make/Build.sh +++ b/Make/Build.sh @@ -12,10 +12,10 @@ set -e # docker run -it --rm lsiobase/ubuntu:jammy /bin/bash # export DEBIAN_FRONTEND=noninteractive # apt-get update && apt-get upgrade --yes -# apt-get install --no-install-recommends --yes ca-certificates mc nano unzip wget strace gdb -# wget --output-document=./vms_server.zip https://updates.networkoptix.com/metavms/37996/metavms-server_update-5.1.2.37996-linux_x64.zip +# apt-get install --no-install-recommends --yes ca-certificates unzip wget mc nano strace gdb +# wget --output-document=./vms_server.zip https://updates.networkoptix.com/metavms/38488/metavms-server_update-6.0.0.38488-linux_x64-beta.zip # unzip -d ./download_zip ./vms_server.zip -# cp ./download_zip/metavms-server-5.1.2.37996-linux_x64.deb ./vms_server.deb +# cp ./download_zip/metavms-server-6.0.0.38488-linux_x64-beta.deb ./vms_server.deb # Install: # apt-get install --no-install-recommends --yes ./vms_server.deb # Extract DEB package: diff --git a/Make/body-entrypoint.docker b/Make/body-entrypoint.docker index ae9da67..a00671c 100644 --- a/Make/body-entrypoint.docker +++ b/Make/body-entrypoint.docker @@ -1,6 +1,7 @@ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ sudo \ ./vms_server.deb \ diff --git a/Make/body-lsio.docker b/Make/body-lsio.docker index 1f95205..8f525a2 100644 --- a/Make/body-lsio.docker +++ b/Make/body-lsio.docker @@ -14,6 +14,7 @@ RUN usermod -l ${COMPANY_NAME} abc \ # Install the mediaserver and dependencies RUN apt-get update \ && apt-get install --no-install-recommends --yes \ + file \ gdb \ ./vms_server.deb \ # Cleanup