diff --git a/src/AVPRClient/Extensions.cs b/src/AVPRClient/Extensions.cs index 2151368..0fb5ba0 100644 --- a/src/AVPRClient/Extensions.cs +++ b/src/AVPRClient/Extensions.cs @@ -136,7 +136,8 @@ this AVPRClient.ValidationPackage validationPackage Microsoft.FSharp.Core.FSharpOption.None, validationPackage.Authors.AsIndexType(), validationPackage.Tags.AsIndexType(), - validationPackage.ReleaseNotes + validationPackage.ReleaseNotes, + Microsoft.FSharp.Core.FSharpOption.None ); } } diff --git a/src/AVPRIndex/AVPRIndex.fsproj b/src/AVPRIndex/AVPRIndex.fsproj index c0542b6..64ea858 100644 --- a/src/AVPRIndex/AVPRIndex.fsproj +++ b/src/AVPRIndex/AVPRIndex.fsproj @@ -16,7 +16,7 @@ git $([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/RELEASE_NOTES.md")) README.md - 0.1.0 + 0.1.1 diff --git a/src/AVPRIndex/Domain.fs b/src/AVPRIndex/Domain.fs index 8fa2379..b59f3cf 100644 --- a/src/AVPRIndex/Domain.fs +++ b/src/AVPRIndex/Domain.fs @@ -106,6 +106,7 @@ module Domain = member val Authors: Author [] = Array.empty with get,set member val Tags: OntologyAnnotation [] = Array.empty with get,set member val ReleaseNotes = "" with get,set + member val CQCHookEndpoint = "" with get,set override this.GetHashCode() = hash ( @@ -118,7 +119,8 @@ module Domain = this.Publish, this.Authors, this.Tags, - this.ReleaseNotes + this.ReleaseNotes, + this.CQCHookEndpoint ) override this.Equals(other) = @@ -134,7 +136,8 @@ module Domain = this.Publish, this.Authors, this.Tags, - this.ReleaseNotes + this.ReleaseNotes, + this.CQCHookEndpoint ) = ( vpm.Name, vpm.Summary, @@ -145,7 +148,8 @@ module Domain = vpm.Publish, vpm.Authors, vpm.Tags, - vpm.ReleaseNotes + vpm.ReleaseNotes, + vpm.CQCHookEndpoint ) | _ -> false @@ -159,7 +163,8 @@ module Domain = ?Publish: bool, ?Authors: Author [], ?Tags: OntologyAnnotation [], - ?ReleaseNotes + ?ReleaseNotes, + ?CQCHookEndpoint ) = let tmp = ValidationPackageMetadata( Name = name, @@ -174,6 +179,7 @@ module Domain = Authors |> Option.iter (fun x -> tmp.Authors <- x) Tags |> Option.iter (fun x -> tmp.Tags <- x) ReleaseNotes |> Option.iter (fun x -> tmp.ReleaseNotes <- x) + CQCHookEndpoint |> Option.iter (fun x -> tmp.CQCHookEndpoint <- x) tmp diff --git a/src/AVPRIndex/RELEASE_NOTES.md b/src/AVPRIndex/RELEASE_NOTES.md index 1d3c032..a0af89a 100644 --- a/src/AVPRIndex/RELEASE_NOTES.md +++ b/src/AVPRIndex/RELEASE_NOTES.md @@ -1,3 +1,7 @@ +## v0.1.1 + +Add `CQCHookEndpoint` field to `ValidationPackageMetadata` + ## v0.1.0 Add support for in-package frontmatter bindings. Enables re-use of the frontmatter inside the package code diff --git a/tests/IndexTests/DomainTests.fs b/tests/IndexTests/DomainTests.fs index dce5db8..6250ac1 100644 --- a/tests/IndexTests/DomainTests.fs +++ b/tests/IndexTests/DomainTests.fs @@ -39,3 +39,47 @@ module OntologyAnnotation = TermAccessionNumber = "TAN" ) Assert.Equivalent(OntologyAnnotation.allFields, actual) + +module ValidationPackageMetadata = + + [] + let ``create function for mandatory fields``() = + let actual = ValidationPackageMetadata.create( + name = "name", + summary = "summary" , + description = "description" , + majorVersion = 1, + minorVersion = 0, + patchVersion = 0 + ) + Assert.Equivalent(ValidationPackageMetadata.mandatoryFields, actual) + + [] + let ``create function for all fields``() = + let actual = ValidationPackageMetadata.create( + name = "name", + summary = "summary" , + description = "description" , + majorVersion = 1, + minorVersion = 0, + patchVersion = 0, + Publish = true, + Authors = [| + Author.create( + fullName = "test", + Email = "test@test.test", + Affiliation = "testaffiliation", + AffiliationLink = "test.com" + ) + |], + Tags = [| + OntologyAnnotation.create( + name = "test", + TermSourceREF = "REF", + TermAccessionNumber = "TAN" + ) + |], + ReleaseNotes = "releasenotes", + CQCHookEndpoint = "hookendpoint" + ) + Assert.Equivalent(ValidationPackageMetadata.allFields, actual) \ No newline at end of file diff --git a/tests/IndexTests/ReferenceObjects.fs b/tests/IndexTests/ReferenceObjects.fs index 5627b77..5ceca44 100644 --- a/tests/IndexTests/ReferenceObjects.fs +++ b/tests/IndexTests/ReferenceObjects.fs @@ -28,6 +28,31 @@ module OntologyAnnotation = TermAccessionNumber = "TAN" ) +module ValidationPackageMetadata = + + let mandatoryFields = ValidationPackageMetadata( + Name = "name", + Summary = "summary" , + Description = "description" , + MajorVersion = 1, + MinorVersion = 0, + PatchVersion = 0 + ) + + let allFields = ValidationPackageMetadata( + Name = "name", + Summary = "summary" , + Description = "description" , + MajorVersion = 1, + MinorVersion = 0, + PatchVersion = 0, + Publish = true, + Authors = [|Author.allFields|], + Tags = [|OntologyAnnotation.allFields|], + ReleaseNotes = "releasenotes", + CQCHookEndpoint = "hookendpoint" + ) + module Frontmatter = module Comment = @@ -89,6 +114,7 @@ ReleaseNotes: | - initial release - does the thing - does it well +CQCHookEndpoint: https://hook.com --- *)""" .ReplaceLineEndings("\n") @@ -121,6 +147,7 @@ ReleaseNotes: | - initial release - does the thing - does it well +CQCHookEndpoint: https://hook.com """ .ReplaceLineEndings("\n") let invalidStartFrontmatter = """( @@ -232,6 +259,7 @@ ReleaseNotes: | - initial release - does the thing - does it well +CQCHookEndpoint: https://hook.com --- *)\"\"\"" .ReplaceLineEndings("\n") @@ -264,6 +292,7 @@ ReleaseNotes: | - initial release - does the thing - does it well +CQCHookEndpoint: https://hook.com """ .ReplaceLineEndings("\n") let invalidStartFrontmatter = "let []PACKAGE_METADATA = \"\"\" @@ -365,7 +394,8 @@ It does it very fast, it does it very swell. ReleaseNotes = """- initial release - does the thing - does it well -""".ReplaceLineEndings("\n") +""".ReplaceLineEndings("\n"), + CQCHookEndpoint = "https://hook.com" ) let invalidMissingMandatoryFrontmatter = diff --git a/tests/IndexTests/fixtures/Frontmatter/Binding/valid@2.0.0.fsx b/tests/IndexTests/fixtures/Frontmatter/Binding/valid@2.0.0.fsx index efe937a..f6f3b01 100644 --- a/tests/IndexTests/fixtures/Frontmatter/Binding/valid@2.0.0.fsx +++ b/tests/IndexTests/fixtures/Frontmatter/Binding/valid@2.0.0.fsx @@ -28,5 +28,6 @@ ReleaseNotes: | - initial release - does the thing - does it well +CQCHookEndpoint: https://hook.com --- *)""" \ No newline at end of file diff --git a/tests/IndexTests/fixtures/Frontmatter/Comment/valid@2.0.0.fsx b/tests/IndexTests/fixtures/Frontmatter/Comment/valid@2.0.0.fsx index 0f99576..fc3c074 100644 --- a/tests/IndexTests/fixtures/Frontmatter/Comment/valid@2.0.0.fsx +++ b/tests/IndexTests/fixtures/Frontmatter/Comment/valid@2.0.0.fsx @@ -28,5 +28,6 @@ ReleaseNotes: | - initial release - does the thing - does it well +CQCHookEndpoint: https://hook.com --- *) \ No newline at end of file