From 0c09757557ff60e154e1ec66d8eb9f33b62c4a47 Mon Sep 17 00:00:00 2001 From: Scott Bommarito Date: Fri, 17 May 2019 14:58:26 -0700 Subject: [PATCH] Add deprecation information to the catalog if provided (#522) --- .../NuGet.Services.Metadata.Catalog.csproj | 1 + src/Catalog/PackageCatalogItem.cs | 64 +++++++++++++++- src/Catalog/PackageDeprecationItem.cs | 61 ++++++++++++++++ src/Catalog/Schema.cs | 6 ++ src/Catalog/context/PackageDetails.json | 3 +- tests/CatalogTests/CatalogTests.csproj | 1 + .../CatalogTests/Helpers/FeedHelpersTests.cs | 73 +++++++++++++++++-- tests/CatalogTests/PackageCatalogItemTests.cs | 41 +++++++++++ .../PackageDeprecationItemTests.cs | 54 ++++++++++++++ .../CatalogTests/TestData/CatalogTestData.cs | 62 +++++++++++++++- .../TestData/DependencyMissingId.0.1.0.json | 3 + .../EmptyDependenciesElement.0.1.0.json | 3 + .../TestData/EmptyDependencyId.0.1.0.json | 3 + .../EmptyDependencyIdWithGroups.0.1.0.json | 3 + .../EmptyDependencyVersionRange.0.1.0.json | 3 + .../InvalidDependencyVersionRange.0.1.0.json | 3 + .../MissingDependencyVersionRange.0.1.0.json | 3 + .../TestData/Newtonsoft.Json.9.0.2-beta1.json | 3 + .../OneValidDependencyOneEmptyId.0.1.0.json | 3 + ...dDependencyOneEmptyIdWithGroups.0.1.0.json | 3 + .../TestPackage.SemVer2.1.0.0-alpha.1.json | 3 + .../WhitespaceDependencyId.0.1.0.json | 3 + ...hitespaceDependencyVersionRange.0.1.0.json | 3 + 23 files changed, 392 insertions(+), 13 deletions(-) create mode 100644 src/Catalog/PackageDeprecationItem.cs create mode 100644 tests/CatalogTests/PackageDeprecationItemTests.cs diff --git a/src/Catalog/NuGet.Services.Metadata.Catalog.csproj b/src/Catalog/NuGet.Services.Metadata.Catalog.csproj index a54df06e2..78170008a 100644 --- a/src/Catalog/NuGet.Services.Metadata.Catalog.csproj +++ b/src/Catalog/NuGet.Services.Metadata.Catalog.csproj @@ -108,6 +108,7 @@ + diff --git a/src/Catalog/PackageCatalogItem.cs b/src/Catalog/PackageCatalogItem.cs index 2385c37a1..101b9cc4e 100644 --- a/src/Catalog/PackageCatalogItem.cs +++ b/src/Catalog/PackageCatalogItem.cs @@ -21,13 +21,22 @@ public class PackageCatalogItem : AppendOnlyCatalogItem public DateTime? CreatedDate { get; } public DateTime? LastEditedDate { get; } public DateTime? PublishedDate { get; } - - public PackageCatalogItem(NupkgMetadata nupkgMetadata, DateTime? createdDate = null, DateTime? lastEditedDate = null, DateTime? publishedDate = null, string licenseNames = null, string licenseReportUrl = null) + public PackageDeprecationItem Deprecation { get; } + + public PackageCatalogItem( + NupkgMetadata nupkgMetadata, + DateTime? createdDate = null, + DateTime? lastEditedDate = null, + DateTime? publishedDate = null, + string licenseNames = null, + string licenseReportUrl = null, + PackageDeprecationItem deprecation = null) { NupkgMetadata = nupkgMetadata; CreatedDate = createdDate; LastEditedDate = lastEditedDate; PublishedDate = publishedDate; + Deprecation = deprecation; } public override IGraph CreateContentGraph(CatalogContext context) @@ -94,6 +103,52 @@ public override IGraph CreateContentGraph(CatalogContext context) // identity and version SetIdVersionFromGraph(graph); + // deprecation + if (Deprecation != null) + { + // assert deprecation root node to subject + var deprecationPredicate = graph.CreateUriNode(Schema.Predicates.Deprecation); + var deprecationRootNode = graph.CreateUriNode(new Uri(resource.Subject.ToString() + "#deprecation")); + graph.Assert(resource.Subject, deprecationPredicate, deprecationRootNode); + + // assert reasons to deprecation root node + var deprecationReasonRootNode = graph.CreateUriNode(Schema.Predicates.Reasons); + foreach (var reason in Deprecation.Reasons) + { + var reasonNode = graph.CreateLiteralNode(reason); + graph.Assert(deprecationRootNode, deprecationReasonRootNode, reasonNode); + } + + // assert message to deprecation root node + if (Deprecation.Message != null) + { + graph.Assert( + deprecationRootNode, + graph.CreateUriNode(Schema.Predicates.Message), + graph.CreateLiteralNode(Deprecation.Message)); + } + + if (Deprecation.AlternatePackageId != null) + { + // assert alternate package root node to deprecation root node + var deprecationAlternatePackagePredicate = graph.CreateUriNode(Schema.Predicates.AlternatePackage); + var deprecationAlternatePackageRootNode = graph.CreateUriNode(new Uri(resource.Subject.ToString() + "#deprecation/alternatePackage")); + graph.Assert(deprecationRootNode, deprecationAlternatePackagePredicate, deprecationAlternatePackageRootNode); + + // assert id to alternate package root node + graph.Assert( + deprecationAlternatePackageRootNode, + graph.CreateUriNode(Schema.Predicates.Id), + graph.CreateLiteralNode(Deprecation.AlternatePackageId)); + + // assert version range to alternate package root node + graph.Assert( + deprecationAlternatePackageRootNode, + graph.CreateUriNode(Schema.Predicates.Range), + graph.CreateLiteralNode(Deprecation.AlternatePackageRange)); + } + } + return graph; } @@ -143,6 +198,11 @@ public override StorageContent CreateContent(CatalogContext context) graph.Assert(resource.Subject, timeStampPredicate, graph.CreateLiteralNode(TimeStamp.ToString("O"), Schema.DataTypes.DateTime)); graph.Assert(resource.Subject, commitIdPredicate, graph.CreateLiteralNode(CommitId.ToString())); + if (graph.GetTriples(Schema.Predicates.Deprecation).Count() > 1) + { + throw new ArgumentException("Package catalog items can only have a single deprecation."); + } + // create JSON content JObject frame = context.GetJsonLdContext("context.PackageDetails.json", GetItemType()); diff --git a/src/Catalog/PackageDeprecationItem.cs b/src/Catalog/PackageDeprecationItem.cs new file mode 100644 index 000000000..f3d611d27 --- /dev/null +++ b/src/Catalog/PackageDeprecationItem.cs @@ -0,0 +1,61 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace NuGet.Services.Metadata.Catalog +{ + public class PackageDeprecationItem + { + /// The list of reasons a package was deprecated. + /// An additional message associated with a package, if one exists. + /// + /// The ID of a package that can be used alternatively. Must be specified if is specified. + /// + /// + /// A string representing the version range of a package that can be used alternatively. Must be specified if is specified. + /// + public PackageDeprecationItem( + IReadOnlyList reasons, + string message, + string alternatePackageId, + string alternatePackageRange) + { + if (reasons == null) + { + throw new ArgumentNullException(nameof(reasons)); + } + + if (!reasons.Any()) + { + throw new ArgumentException(nameof(reasons)); + } + + Reasons = reasons; + Message = message; + AlternatePackageId = alternatePackageId; + AlternatePackageRange = alternatePackageRange; + + if (AlternatePackageId == null && AlternatePackageRange != null) + { + throw new ArgumentException( + "Cannot specify an alternate package version range if an alternate package ID is not provided.", + nameof(AlternatePackageRange)); + } + + if (AlternatePackageId != null && AlternatePackageRange == null) + { + throw new ArgumentException( + "Cannot specify an alternate package ID if an alternate package version range is not provided.", + nameof(AlternatePackageId)); + } + } + + public IReadOnlyList Reasons { get; } + public string Message { get; } + public string AlternatePackageId { get; } + public string AlternatePackageRange { get; } + } +} diff --git a/src/Catalog/Schema.cs b/src/Catalog/Schema.cs index 7c63925cb..0a090f1f2 100644 --- a/src/Catalog/Schema.cs +++ b/src/Catalog/Schema.cs @@ -153,6 +153,12 @@ public static class Predicates public static readonly Uri LicenseFile = new Uri(Prefixes.NuGet + "licenseFile"); public static readonly Uri IconFile = new Uri(Prefixes.NuGet + "iconFile"); + + public static readonly Uri Deprecation = new Uri(Prefixes.NuGet + "deprecation"); + + public static readonly Uri Reasons = new Uri(Prefixes.NuGet + "reasons"); + public static readonly Uri Message = new Uri(Prefixes.NuGet + "message"); + public static readonly Uri AlternatePackage = new Uri(Prefixes.NuGet + "alternatePackage"); } } } diff --git a/src/Catalog/context/PackageDetails.json b/src/Catalog/context/PackageDetails.json index 21a141303..921f17e59 100644 --- a/src/Catalog/context/PackageDetails.json +++ b/src/Catalog/context/PackageDetails.json @@ -11,6 +11,7 @@ "published": { "@type": "xsd:dateTime" }, "created": { "@type": "xsd:dateTime" }, "lastEdited" : { "@type" : "xsd:dateTime" }, - "catalog:commitTimeStamp" : { "@type" : "xsd:dateTime" } + "catalog:commitTimeStamp" : { "@type" : "xsd:dateTime" }, + "reasons" : { "@container" : "@set" } } } diff --git a/tests/CatalogTests/CatalogTests.csproj b/tests/CatalogTests/CatalogTests.csproj index ea6579b88..7dc828779 100644 --- a/tests/CatalogTests/CatalogTests.csproj +++ b/tests/CatalogTests/CatalogTests.csproj @@ -104,6 +104,7 @@ + diff --git a/tests/CatalogTests/Helpers/FeedHelpersTests.cs b/tests/CatalogTests/Helpers/FeedHelpersTests.cs index cd62e64ef..1c7030ce9 100644 --- a/tests/CatalogTests/Helpers/FeedHelpersTests.cs +++ b/tests/CatalogTests/Helpers/FeedHelpersTests.cs @@ -303,13 +303,36 @@ public async Task DownloadMetadata2CatalogAsync_WhenCreatedPackagesIsTrue_WithNo } } + public enum PackageDeprecationItemState + { + NotDeprecated, + DeprecatedWithSingleReason, + DeprecatedWithMessage, + DeprecatedWithAlternate + } + + public static IEnumerable DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage_Data + { + get + { + foreach (var createdPackages in new[] { false, true }) + { + foreach (var updateCreatedFromEdited in new[] { false, true }) + { + foreach (var deprecationState in Enum.GetValues(typeof(PackageDeprecationItemState)).Cast()) + { + yield return new object[] { createdPackages, updateCreatedFromEdited, deprecationState }; + } + } + } + } + } + [Theory] - [InlineData(true, true)] - [InlineData(false, true)] - [InlineData(true, false)] - [InlineData(false, false)] - public async Task DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage(bool createdPackages, bool updateCreatedFromEdited) + [MemberData(nameof(DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage_Data))] + public async Task DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage(bool createdPackages, bool updateCreatedFromEdited, PackageDeprecationItemState deprecationState) { + // Arrange using (var test = new DownloadMetadata2CatalogAsyncTest()) { test.CreatedPackages = createdPackages; @@ -321,11 +344,13 @@ public async Task DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage(bo NupkgMetadata nupkgMetadata = GetNupkgMetadata("Newtonsoft.Json.9.0.2-beta1.nupkg"); + var deprecationItem = GetPackageDeprecationItemFromState(deprecationState); var packageCatalogItem = new PackageCatalogItem( nupkgMetadata, test.FeedPackageDetails.CreatedDate, test.FeedPackageDetails.LastEditedDate, - test.FeedPackageDetails.PublishedDate); + test.FeedPackageDetails.PublishedDate, + deprecation: deprecationItem); test.PackageCatalogItemCreator.Setup(x => x.CreateAsync( It.Is(details => details == test.FeedPackageDetails), @@ -357,8 +382,10 @@ public async Task DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage(bo It.Is(duration => duration > TimeSpan.Zero), It.Is(uri => uri == test.CatalogIndexUri))); + // Act var result = await test.DownloadMetadata2CatalogAsync(); + // Assert Assert.Equal(test.UtcNow, result); Assert.Equal(3, blobs.Count); @@ -381,7 +408,9 @@ public async Task DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage(bo packageCatalogItem.TimeStamp, packageCatalogItem.CreatedDate.Value, packageCatalogItem.LastEditedDate.Value, - packageCatalogItem.PublishedDate.Value); + packageCatalogItem.PublishedDate.Value, + deprecationItem); + var actualContent = JObject.Parse(stringContent.Content); Assert.Equal(expectedContent.ToString(), actualContent.ToString()); @@ -427,6 +456,36 @@ public async Task DownloadMetadata2CatalogAsync_WithOnePackage_UpdatesStorage(bo } } + private static PackageDeprecationItem GetPackageDeprecationItemFromState(PackageDeprecationItemState deprecationState) + { + if (deprecationState == PackageDeprecationItemState.NotDeprecated) + { + return null; + } + + var reasons = new[] { "first", "second" }; + string message = null; + string altId = null; + string altVersion = null; + if (deprecationState == PackageDeprecationItemState.DeprecatedWithSingleReason) + { + reasons = reasons.Take(1).ToArray(); + } + + if (deprecationState == PackageDeprecationItemState.DeprecatedWithMessage) + { + message = "this is the message"; + } + + if (deprecationState == PackageDeprecationItemState.DeprecatedWithAlternate) + { + altId = "theId"; + altVersion = "[2.4.5, 2.4.5]"; + } + + return new PackageDeprecationItem(reasons, message, altId, altVersion); + } + private Task> TestGetPackagesAsync(IEnumerable oDataPackages) { return FeedHelpers.GetPackages( diff --git a/tests/CatalogTests/PackageCatalogItemTests.cs b/tests/CatalogTests/PackageCatalogItemTests.cs index 19903fff3..a167edaa7 100644 --- a/tests/CatalogTests/PackageCatalogItemTests.cs +++ b/tests/CatalogTests/PackageCatalogItemTests.cs @@ -4,6 +4,7 @@ using System; using System.IO; using System.Linq; +using Moq; using NuGet.Services.Metadata.Catalog; using VDS.RDF; using Xunit; @@ -109,6 +110,46 @@ public void CreateContent_HasExpectedPageContent(string packageName, string id, Assert.Equal(version, triples[1].Object.ToString()); } + [Fact] + public void CreateContent_ThrowsIfMultipleDeprecationTriples() + { + var packageDetails = Schema.DataTypes.PackageDetails; + var catalogItemMock = new Mock(null, null, null, null, null, null, null) + { + CallBase = true + }; + + var context = new CatalogContext(); + + catalogItemMock + .Setup(x => x.GetItemType()) + .Returns(packageDetails); + + var graph = new Graph(); + var subject = graph.CreateBlankNode(); + graph.Assert( + subject, + graph.CreateUriNode(Schema.Predicates.Type), + graph.CreateUriNode(packageDetails)); + + graph.Assert( + subject, + graph.CreateUriNode(Schema.Predicates.Deprecation), + graph.CreateLiteralNode("deprecation1")); + + graph.Assert( + subject, + graph.CreateUriNode(Schema.Predicates.Deprecation), + graph.CreateLiteralNode("deprecation2")); + + catalogItemMock + .Setup(x => x.CreateContentGraph(context)) + .Returns(graph); + + Assert.Throws( + () => catalogItemMock.Object.CreateContent(context)); + } + private static CatalogItem CreateCatalogItem(string packageName) { var path = Path.GetFullPath(Path.Combine("TestData", $"{packageName}.nupkg")); diff --git a/tests/CatalogTests/PackageDeprecationItemTests.cs b/tests/CatalogTests/PackageDeprecationItemTests.cs new file mode 100644 index 000000000..36c071858 --- /dev/null +++ b/tests/CatalogTests/PackageDeprecationItemTests.cs @@ -0,0 +1,54 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using NuGet.Services.Metadata.Catalog; +using Xunit; + +namespace CatalogTests +{ + public class PackageDeprecationItemTests + { + public class TheConstructor + { + [Fact] + public void ThrowsIfNullReasons() + { + Assert.Throws(() => new PackageDeprecationItem(null, null, null, null)); + } + + [Fact] + public void ThrowsIfEmptyReasons() + { + Assert.Throws(() => new PackageDeprecationItem(new string[0], null, null, null)); + } + + [Fact] + public void ThrowsIfVersionRangeProvidedWithoutId() + { + Assert.Throws(() => new PackageDeprecationItem(new[] { "first", "second" }, null, null, "howdy")); + } + + [Fact] + public void ThrowsIfIdProvidedWithoutVersionRange() + { + Assert.Throws(() => new PackageDeprecationItem(new[] { "first", "second" }, null, "howdy", null)); + } + + [Fact] + public void SetsExpectedValues() + { + var reasons = new[] { "first", "second" }; + var message = "message"; + var id = "theId"; + var versionRange = "homeOnTheRange"; + + var deprecation = new PackageDeprecationItem(reasons, message, id, versionRange); + Assert.Equal(reasons, deprecation.Reasons); + Assert.Equal(message, deprecation.Message); + Assert.Equal(id, deprecation.AlternatePackageId); + Assert.Equal(versionRange, deprecation.AlternatePackageRange); + } + } + } +} diff --git a/tests/CatalogTests/TestData/CatalogTestData.cs b/tests/CatalogTests/TestData/CatalogTestData.cs index c52863418..3a44cea38 100644 --- a/tests/CatalogTests/TestData/CatalogTestData.cs +++ b/tests/CatalogTests/TestData/CatalogTestData.cs @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Linq; using Newtonsoft.Json.Linq; +using NuGet.Services.Metadata.Catalog; namespace CatalogTests { @@ -132,7 +134,7 @@ internal static class CatalogTestData ""authors"": ""James Newton-King"", ""catalog:commitId"": ""{1}"", ""catalog:commitTimeStamp"": ""{2}"", - ""created"": ""{3}"", + ""created"": ""{3}"",{6} ""description"": ""Json.NET is a popular high-performance JSON framework for .NET"", ""iconUrl"": ""http://www.newtonsoft.com/content/images/nugeticon.png"", ""id"": ""Newtonsoft.Json"", @@ -650,9 +652,29 @@ internal static class CatalogTestData }}, ""catalog:commitTimeStamp"": {{ ""@type"": ""xsd:dateTime"" + }}, + ""reasons"": {{ + ""@container"": ""@set"" }} }} }}"; + + private const string _packageDeprecationDetails = @" + ""deprecation"": {{ + ""@id"": ""{0}#deprecation"",{1}{2} + ""reasons"": [{3}] + }},"; + + private const string _packageDeprecationAlternatePackageDetails = @" + ""alternatePackage"": {{ + ""@id"": ""{0}#deprecation/alternatePackage"", + ""id"": ""theId"", + ""range"": ""{1}"" + }},"; + + private const string _packageDeprecationMessageDetails = @" + ""message"": ""this is the message"","; + internal static JObject GetBeforeIndex(Uri indexUri) { return JObject.Parse(string.Format(_beforeIndex, indexUri)); @@ -702,7 +724,8 @@ internal static JObject GetPackageDetails( DateTime commitTimestamp, DateTime created, DateTime lastEdited, - DateTime published) + DateTime published, + PackageDeprecationItem deprecation) { return JObject.Parse( string.Format( @@ -712,7 +735,40 @@ internal static JObject GetPackageDetails( commitTimestamp.ToString("O"), created.ToString("O"), lastEdited.ToString("O"), - published.ToString("O"))); + published.ToString("O"), + GetPackageDeprecationDetails(packageDetailsUri, deprecation))); + } + + private static string GetPackageDeprecationDetails( + Uri packageDetailsUri, + PackageDeprecationItem deprecation) + { + if (deprecation == null) + { + return string.Empty; + } + + return string.Format( + _packageDeprecationDetails, + packageDetailsUri, + GetPackageDeprecationAlternatePackageDetails(packageDetailsUri, deprecation), + deprecation.Message == null ? string.Empty : _packageDeprecationMessageDetails, + string.Join(",", deprecation.Reasons.Select(r => $"\r\n \"{r}\"")) + "\r\n "); + } + + private static string GetPackageDeprecationAlternatePackageDetails( + Uri packageDetailsUri, + PackageDeprecationItem deprecation) + { + if (deprecation.AlternatePackageId == null) + { + return string.Empty; + } + + return string.Format( + _packageDeprecationAlternatePackageDetails, + packageDetailsUri, + deprecation.AlternatePackageRange); } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/DependencyMissingId.0.1.0.json b/tests/CatalogTests/TestData/DependencyMissingId.0.1.0.json index 6380b7b9d..042b9ce9e 100644 --- a/tests/CatalogTests/TestData/DependencyMissingId.0.1.0.json +++ b/tests/CatalogTests/TestData/DependencyMissingId.0.1.0.json @@ -71,6 +71,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/EmptyDependenciesElement.0.1.0.json b/tests/CatalogTests/TestData/EmptyDependenciesElement.0.1.0.json index bdc75ac23..38faa343f 100644 --- a/tests/CatalogTests/TestData/EmptyDependenciesElement.0.1.0.json +++ b/tests/CatalogTests/TestData/EmptyDependenciesElement.0.1.0.json @@ -71,6 +71,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/EmptyDependencyId.0.1.0.json b/tests/CatalogTests/TestData/EmptyDependencyId.0.1.0.json index b5d86446b..2062e633e 100644 --- a/tests/CatalogTests/TestData/EmptyDependencyId.0.1.0.json +++ b/tests/CatalogTests/TestData/EmptyDependencyId.0.1.0.json @@ -71,6 +71,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/EmptyDependencyIdWithGroups.0.1.0.json b/tests/CatalogTests/TestData/EmptyDependencyIdWithGroups.0.1.0.json index 4881906af..4a6037b55 100644 --- a/tests/CatalogTests/TestData/EmptyDependencyIdWithGroups.0.1.0.json +++ b/tests/CatalogTests/TestData/EmptyDependencyIdWithGroups.0.1.0.json @@ -85,6 +85,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/EmptyDependencyVersionRange.0.1.0.json b/tests/CatalogTests/TestData/EmptyDependencyVersionRange.0.1.0.json index b0dfaca17..b23dfc16f 100644 --- a/tests/CatalogTests/TestData/EmptyDependencyVersionRange.0.1.0.json +++ b/tests/CatalogTests/TestData/EmptyDependencyVersionRange.0.1.0.json @@ -79,6 +79,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/InvalidDependencyVersionRange.0.1.0.json b/tests/CatalogTests/TestData/InvalidDependencyVersionRange.0.1.0.json index 8becf3372..1559b5a14 100644 --- a/tests/CatalogTests/TestData/InvalidDependencyVersionRange.0.1.0.json +++ b/tests/CatalogTests/TestData/InvalidDependencyVersionRange.0.1.0.json @@ -79,6 +79,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/MissingDependencyVersionRange.0.1.0.json b/tests/CatalogTests/TestData/MissingDependencyVersionRange.0.1.0.json index 0482a483b..0b1eb9cae 100644 --- a/tests/CatalogTests/TestData/MissingDependencyVersionRange.0.1.0.json +++ b/tests/CatalogTests/TestData/MissingDependencyVersionRange.0.1.0.json @@ -79,6 +79,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/Newtonsoft.Json.9.0.2-beta1.json b/tests/CatalogTests/TestData/Newtonsoft.Json.9.0.2-beta1.json index aef7519de..eb0f01e37 100644 --- a/tests/CatalogTests/TestData/Newtonsoft.Json.9.0.2-beta1.json +++ b/tests/CatalogTests/TestData/Newtonsoft.Json.9.0.2-beta1.json @@ -525,6 +525,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/OneValidDependencyOneEmptyId.0.1.0.json b/tests/CatalogTests/TestData/OneValidDependencyOneEmptyId.0.1.0.json index cc99cefd9..950536dd0 100644 --- a/tests/CatalogTests/TestData/OneValidDependencyOneEmptyId.0.1.0.json +++ b/tests/CatalogTests/TestData/OneValidDependencyOneEmptyId.0.1.0.json @@ -79,6 +79,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/OneValidDependencyOneEmptyIdWithGroups.0.1.0.json b/tests/CatalogTests/TestData/OneValidDependencyOneEmptyIdWithGroups.0.1.0.json index eb2cc008f..6daefb000 100644 --- a/tests/CatalogTests/TestData/OneValidDependencyOneEmptyIdWithGroups.0.1.0.json +++ b/tests/CatalogTests/TestData/OneValidDependencyOneEmptyIdWithGroups.0.1.0.json @@ -93,6 +93,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/TestPackage.SemVer2.1.0.0-alpha.1.json b/tests/CatalogTests/TestData/TestPackage.SemVer2.1.0.0-alpha.1.json index be81d5f8a..0dafd3862 100644 --- a/tests/CatalogTests/TestData/TestPackage.SemVer2.1.0.0-alpha.1.json +++ b/tests/CatalogTests/TestData/TestPackage.SemVer2.1.0.0-alpha.1.json @@ -94,6 +94,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/WhitespaceDependencyId.0.1.0.json b/tests/CatalogTests/TestData/WhitespaceDependencyId.0.1.0.json index 6b139fd3d..03c40d7eb 100644 --- a/tests/CatalogTests/TestData/WhitespaceDependencyId.0.1.0.json +++ b/tests/CatalogTests/TestData/WhitespaceDependencyId.0.1.0.json @@ -71,6 +71,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file diff --git a/tests/CatalogTests/TestData/WhitespaceDependencyVersionRange.0.1.0.json b/tests/CatalogTests/TestData/WhitespaceDependencyVersionRange.0.1.0.json index f839fc8d2..63b720e95 100644 --- a/tests/CatalogTests/TestData/WhitespaceDependencyVersionRange.0.1.0.json +++ b/tests/CatalogTests/TestData/WhitespaceDependencyVersionRange.0.1.0.json @@ -79,6 +79,9 @@ }, "catalog:commitTimeStamp": { "@type": "xsd:dateTime" + }, + "reasons": { + "@container": "@set" } } } \ No newline at end of file