Skip to content

Commit

Permalink
Fix preview index source
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Mar 13, 2024
1 parent 1a1fafa commit 1ed6481
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 45 deletions.
6 changes: 3 additions & 3 deletions src/ARCExpect/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/ARCValidationPackages/ARCValidationPackages.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

<ItemGroup>
<PackageReference Include="Fake.DotNet.Cli" Version="[6.0.0]" />
<PackageReference Include="FsHttp" Version="[11.0.0]" />
<PackageReference Include="AVPRClient" Version="[0.0.2]" />
<PackageReference Include="AVPRIndex" Version="[0.0.2]" />
<PackageReference Include="FsHttp" Version="[14.5.0]" />
<PackageReference Include="AVPRClient" Version="[0.0.4]" />
<PackageReference Include="AVPRIndex" Version="[0.0.6]" />
</ItemGroup>

</Project>
17 changes: 3 additions & 14 deletions src/ARCValidationPackages/GitHubAPI.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ open System
open System.IO
open System.Text
open System.Text.Json
open AVPRIndex
open AVPRIndex.Domain

module GitHubAPI =
Expand Down Expand Up @@ -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<ValidationPackageIndex[]>(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 =
Expand Down
44 changes: 35 additions & 9 deletions src/ARCValidationPackages/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand All @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -625,6 +646,11 @@
"dependencies": {
"System.Drawing.Common": "4.7.0"
}
},
"YamlDotNet": {
"type": "Transitive",
"resolved": "15.1.2",
"contentHash": "qeX0XhzOIcQEvnI5JxnPaIwcINwyY4Qy/LXhSfsdHkFrl9F41AT52UFfy2nIE7kgrhMg+cP7xuS+GtPJhmHmTA=="
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/arc-validate/arc-validate.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<PackageReference Include="Expecto" Version="[9.0.4]" />
<PackageReference Include="Spectre.Console" Version="0.48.0" />
<PackageReference Include="Spectre.Console.CLI" Version="0.48.0" />
<PackageReference Include="AVPRIndex" Version="[0.0.2]" />
</ItemGroup>

<ItemGroup>
Expand Down
48 changes: 37 additions & 11 deletions src/arc-validate/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1263,14 +1282,19 @@
"Newtonsoft.Json": "11.0.2"
}
},
"YamlDotNet": {
"type": "Transitive",
"resolved": "15.1.2",
"contentHash": "qeX0XhzOIcQEvnI5JxnPaIwcINwyY4Qy/LXhSfsdHkFrl9F41AT52UFfy2nIE7kgrhMg+cP7xuS+GtPJhmHmTA=="
},
"arcexpect": {
"type": "Project",
"dependencies": {
"ARCTokenization": "[3.0.0, 3.0.0]",
"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]",
Expand All @@ -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]"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Update="FSharp.Core" Version="8.*" />
<PackageReference Include="AVPRIndex" Version="[0.0.2]" />
<ProjectReference Include="..\..\src\ARCValidationPackages\ARCValidationPackages.fsproj" />
<ProjectReference Include="..\Common\Common.fsproj" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions tests/ARCValidationPackages.Tests/GitHubAPITests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 1ed6481

Please sign in to comment.