From 1ed64818cf339a1cfd5a43a365355e58e7a408b0 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Wed, 13 Mar 2024 15:17:50 +0100 Subject: [PATCH] Fix preview index source --- src/ARCExpect/packages.lock.json | 6 +-- .../ARCValidationPackages.fsproj | 6 +-- src/ARCValidationPackages/GitHubAPI.fs | 17 ++----- src/ARCValidationPackages/packages.lock.json | 44 +++++++++++++---- src/arc-validate/arc-validate.fsproj | 1 - src/arc-validate/packages.lock.json | 48 ++++++++++++++----- .../ARCValidationPackages.Tests.fsproj | 1 - .../GitHubAPITests.fs | 6 +-- 8 files changed, 84 insertions(+), 45 deletions(-) diff --git a/src/ARCExpect/packages.lock.json b/src/ARCExpect/packages.lock.json index 4f88f95..cf2e4a3 100644 --- a/src/ARCExpect/packages.lock.json +++ b/src/ARCExpect/packages.lock.json @@ -51,9 +51,9 @@ }, "FSharp.Core": { "type": "Direct", - "requested": "[8.0.101, )", - "resolved": "8.0.101", - "contentHash": "sOLz3O4BOxnTKfd5OChdRmDUy4Id0GfoEClRG4nzIod8LY1LJZcNyygKAV0A78XOLh8yvhA5hsDYKZXGCR9blw==" + "requested": "[8.0.200, )", + "resolved": "8.0.200", + "contentHash": "qnxoF3Fu0HzfOeYdrwmQOsLP1v+OtOMSIYkNVUwf6nGqWzL03Hh4r6VFCvCb54jlsgtt3WADVYkKkrgdeY5kiQ==" }, "FSharpAux": { "type": "Direct", diff --git a/src/ARCValidationPackages/ARCValidationPackages.fsproj b/src/ARCValidationPackages/ARCValidationPackages.fsproj index 0f46b32..2916ac1 100644 --- a/src/ARCValidationPackages/ARCValidationPackages.fsproj +++ b/src/ARCValidationPackages/ARCValidationPackages.fsproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/src/ARCValidationPackages/GitHubAPI.fs b/src/ARCValidationPackages/GitHubAPI.fs index f0c67de..8850c38 100644 --- a/src/ARCValidationPackages/GitHubAPI.fs +++ b/src/ARCValidationPackages/GitHubAPI.fs @@ -5,6 +5,7 @@ open System open System.IO open System.Text open System.Text.Json +open AVPRIndex open AVPRIndex.Domain module GitHubAPI = @@ -63,22 +64,10 @@ type GitHubAPI = static member getPackageIndex (?Token: string) = - let json = - GitHubAPI.getRepositoryContent( - owner = Defaults.PACKAGE_INDEX_OWNER, - repo = Defaults.PACKAGE_INDEX_REPO, - path = Defaults.PACKAGE_INDEX_FILE_NAME, - userAgent = Defaults.GITHUB_API_USER_AGENT, - ?Token = Token - ) try - json - |> fun json -> (json?content).GetString() - |> fun content -> Convert.FromBase64String(content) - |> fun bytes -> Encoding.UTF8.GetString(bytes) - |> fun index -> JsonSerializer.Deserialize(index, Defaults.SERIALIZATION_OPTIONS) + AVPRRepo.getPreviewIndex() with e -> - raise (GitHubAPI.Errors.SerializationError($"{e.Message}{System.Environment.NewLine}{json}")) + raise (GitHubAPI.Errors.SerializationError($"{e.Message}")) static member downloadPackageScript (packagePath: string, ?Token: string) = let json = diff --git a/src/ARCValidationPackages/packages.lock.json b/src/ARCValidationPackages/packages.lock.json index 5bfafa7..1a13e30 100644 --- a/src/ARCValidationPackages/packages.lock.json +++ b/src/ARCValidationPackages/packages.lock.json @@ -2,6 +2,27 @@ "version": 1, "dependencies": { "net8.0": { + "AVPRClient": { + "type": "Direct", + "requested": "[0.0.4, 0.0.4]", + "resolved": "0.0.4", + "contentHash": "heiOkmXZjvV/qaCXoOxK9c4Ghaiv4X8ve0l2KDmQ152BGWQeRoosHVExc9FMVHVj6o192jeCMTj9xL1FcQuGdA==", + "dependencies": { + "AVPRIndex": "0.0.3", + "Newtonsoft.Json": "13.0.3" + } + }, + "AVPRIndex": { + "type": "Direct", + "requested": "[0.0.6, 0.0.6]", + "resolved": "0.0.6", + "contentHash": "sqbqKn3WhQuIglCUr8Ux8/hJ+sDsyvnqRDi2QeePOXnIHmcGAl3tamIgCOySv5F2AuG5n6FAZBecQjmwbYxVSg==", + "dependencies": { + "FSharp.Core": "8.0.200", + "FsHttp": "14.5.0", + "YamlDotNet": "15.1.2" + } + }, "Fake.DotNet.Cli": { "type": "Direct", "requested": "[6.0.0, 6.0.0]", @@ -22,17 +43,17 @@ }, "FSharp.Core": { "type": "Direct", - "requested": "[8.0.101, )", - "resolved": "8.0.101", - "contentHash": "sOLz3O4BOxnTKfd5OChdRmDUy4Id0GfoEClRG4nzIod8LY1LJZcNyygKAV0A78XOLh8yvhA5hsDYKZXGCR9blw==" + "requested": "[8.0.200, )", + "resolved": "8.0.200", + "contentHash": "qnxoF3Fu0HzfOeYdrwmQOsLP1v+OtOMSIYkNVUwf6nGqWzL03Hh4r6VFCvCb54jlsgtt3WADVYkKkrgdeY5kiQ==" }, "FsHttp": { "type": "Direct", - "requested": "[11.0.0, 11.0.0]", - "resolved": "11.0.0", - "contentHash": "9YVNdI01hQ5V0MGb8/9QY2F2dd9p4hZ8ywXaoEO/qNGeTPiPNbqTpGAtsdhIo75eAAfl1M2OM/UI76M/bhA1ag==", + "requested": "[14.5.0, 14.5.0]", + "resolved": "14.5.0", + "contentHash": "4IntP699QAP8Na16kD+7DoKES5WtIlDgKUaPAU+IcvNW2Ut/LzjTVP1XUx532TlNygvwTbGv9DHOAZVcnNDIuw==", "dependencies": { - "FSharp.Core": "5.0.0" + "FSharp.Core": "5.0.2" } }, "BlackFox.VsWhere": { @@ -292,8 +313,8 @@ }, "Newtonsoft.Json": { "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" }, "NuGet.Common": { "type": "Transitive", @@ -625,6 +646,11 @@ "dependencies": { "System.Drawing.Common": "4.7.0" } + }, + "YamlDotNet": { + "type": "Transitive", + "resolved": "15.1.2", + "contentHash": "qeX0XhzOIcQEvnI5JxnPaIwcINwyY4Qy/LXhSfsdHkFrl9F41AT52UFfy2nIE7kgrhMg+cP7xuS+GtPJhmHmTA==" } } } diff --git a/src/arc-validate/arc-validate.fsproj b/src/arc-validate/arc-validate.fsproj index a3ff0bb..285b3dd 100644 --- a/src/arc-validate/arc-validate.fsproj +++ b/src/arc-validate/arc-validate.fsproj @@ -28,7 +28,6 @@ - diff --git a/src/arc-validate/packages.lock.json b/src/arc-validate/packages.lock.json index f94d0f1..701372c 100644 --- a/src/arc-validate/packages.lock.json +++ b/src/arc-validate/packages.lock.json @@ -24,9 +24,9 @@ }, "FSharp.Core": { "type": "Direct", - "requested": "[8.0.101, )", - "resolved": "8.0.101", - "contentHash": "sOLz3O4BOxnTKfd5OChdRmDUy4Id0GfoEClRG4nzIod8LY1LJZcNyygKAV0A78XOLh8yvhA5hsDYKZXGCR9blw==" + "requested": "[8.0.200, )", + "resolved": "8.0.200", + "contentHash": "qnxoF3Fu0HzfOeYdrwmQOsLP1v+OtOMSIYkNVUwf6nGqWzL03Hh4r6VFCvCb54jlsgtt3WADVYkKkrgdeY5kiQ==" }, "Spectre.Console": { "type": "Direct", @@ -143,6 +143,25 @@ "FsSpreadsheet": "5.0.1" } }, + "AVPRClient": { + "type": "Transitive", + "resolved": "0.0.4", + "contentHash": "heiOkmXZjvV/qaCXoOxK9c4Ghaiv4X8ve0l2KDmQ152BGWQeRoosHVExc9FMVHVj6o192jeCMTj9xL1FcQuGdA==", + "dependencies": { + "AVPRIndex": "0.0.3", + "Newtonsoft.Json": "13.0.3" + } + }, + "AVPRIndex": { + "type": "Transitive", + "resolved": "0.0.6", + "contentHash": "sqbqKn3WhQuIglCUr8Ux8/hJ+sDsyvnqRDi2QeePOXnIHmcGAl3tamIgCOySv5F2AuG5n6FAZBecQjmwbYxVSg==", + "dependencies": { + "FSharp.Core": "8.0.200", + "FsHttp": "14.5.0", + "YamlDotNet": "15.1.2" + } + }, "BlackFox.VsWhere": { "type": "Transitive", "resolved": "1.1.0", @@ -550,10 +569,10 @@ }, "FsHttp": { "type": "Transitive", - "resolved": "11.0.0", - "contentHash": "9YVNdI01hQ5V0MGb8/9QY2F2dd9p4hZ8ywXaoEO/qNGeTPiPNbqTpGAtsdhIo75eAAfl1M2OM/UI76M/bhA1ag==", + "resolved": "14.5.0", + "contentHash": "4IntP699QAP8Na16kD+7DoKES5WtIlDgKUaPAU+IcvNW2Ut/LzjTVP1XUx532TlNygvwTbGv9DHOAZVcnNDIuw==", "dependencies": { - "FSharp.Core": "5.0.0" + "FSharp.Core": "5.0.2" } }, "FsSpreadsheet": { @@ -744,8 +763,8 @@ }, "Newtonsoft.Json": { "type": "Transitive", - "resolved": "13.0.1", - "contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" }, "NJsonSchema": { "type": "Transitive", @@ -1263,6 +1282,11 @@ "Newtonsoft.Json": "11.0.2" } }, + "YamlDotNet": { + "type": "Transitive", + "resolved": "15.1.2", + "contentHash": "qeX0XhzOIcQEvnI5JxnPaIwcINwyY4Qy/LXhSfsdHkFrl9F41AT52UFfy2nIE7kgrhMg+cP7xuS+GtPJhmHmTA==" + }, "arcexpect": { "type": "Project", "dependencies": { @@ -1270,7 +1294,7 @@ "AnyBadge.NET": "[2.0.0, 2.0.0]", "Cytoscape.NET": "[0.2.0, 0.2.0]", "Expecto": "[9.0.4, 9.0.4]", - "FSharp.Core": "[8.0.101, )", + "FSharp.Core": "[8.0.200, )", "FSharpAux": "[2.0.0, 2.0.0]", "FsSpreadsheet": "[5.0.2, 5.0.2]", "FsSpreadsheet.ExcelIO": "[5.0.2, 5.0.2]", @@ -1281,9 +1305,11 @@ "arcvalidationpackages": { "type": "Project", "dependencies": { - "FSharp.Core": "[8.0.101, )", + "AVPRClient": "[0.0.4, 0.0.4]", + "AVPRIndex": "[0.0.6, 0.0.6]", + "FSharp.Core": "[8.0.200, )", "Fake.DotNet.Cli": "[6.0.0, 6.0.0]", - "FsHttp": "[11.0.0, 11.0.0]" + "FsHttp": "[14.5.0, 14.5.0]" } } } diff --git a/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj b/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj index edfd1c9..a8ca740 100644 --- a/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj +++ b/tests/ARCValidationPackages.Tests/ARCValidationPackages.Tests.fsproj @@ -25,7 +25,6 @@ - diff --git a/tests/ARCValidationPackages.Tests/GitHubAPITests.fs b/tests/ARCValidationPackages.Tests/GitHubAPITests.fs index efcc33b..eff98f9 100644 --- a/tests/ARCValidationPackages.Tests/GitHubAPITests.fs +++ b/tests/ARCValidationPackages.Tests/GitHubAPITests.fs @@ -28,7 +28,7 @@ let ``GitHubAPI tests`` = GitHubAPI.getRepositoryContent( owner = "nfdi4plants", repo = "arc-validate-package-registry", - path = $"src/PackageRegistryService/StagingArea/test/test@1.0.0.fsx", + path = "StagingArea/test/test@1.0.0.fsx", userAgent = "arc-validate-test", ?Token = token ) @@ -52,7 +52,7 @@ let ``GitHubAPI tests`` = } test "getScriptContent terminates" { GitHubAPI.downloadPackageScript( - "src/PackageRegistryService/StagingArea/test/test@1.0.0.fsx", + "StagingArea/test/test@1.0.0.fsx", ?Token = token ) |> ignore @@ -61,7 +61,7 @@ let ``GitHubAPI tests`` = Expect.equal ( GitHubAPI.downloadPackageScript( - "src/PackageRegistryService/StagingArea/test/test@1.0.0.fsx", + "StagingArea/test/test@1.0.0.fsx", ?Token = token ) |> fun content -> content.ReplaceLineEndings()