Skip to content

Commit

Permalink
Merge pull request #7 from openmls/keks/update-308
Browse files Browse the repository at this point in the history
Update Status of check 308 and display code references
  • Loading branch information
keks authored Jun 27, 2024
2 parents 85c2e1d + 1806214 commit aaca7c8
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 27 deletions.
14 changes: 11 additions & 3 deletions checksets/03-regular_commit_proposal_list.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,17 @@ let checks =
"It contains multiple GroupContextExtension proposals."
"section-12.2-3.8"
)
types.Status.Unknown
types.CodeRefs/empty
types.CodeRefs/empty
types.Status.Complete
( types.CodeRefs/new
[ types.CodeRef/new
"openmls::group::public_group::validate_group_context_extensions_proposal"
]
)
( types.CodeRefs/new
[ types.CodeRef/new
"openmls::group::mls_group::test_mls_group::group_context_extension_proposal"
]
)
types.Notes/empty
, types.Check/new
9
Expand Down
2 changes: 1 addition & 1 deletion checksets/11-update-path.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let checks =
types.CodeRefs/empty
types.CodeRefs/empty
( types.Notes/single
"reported in https://github.com/xmtp/openmls/pull/19"
"reported in https://github.com/xmtp/openmls/pull/19"
)
]

Expand Down
15 changes: 6 additions & 9 deletions checksets/12-commit.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ let checks =
Unprotect the Commit using the keys from the current epoch: If the message is
encoded as PublicMessage, verify the membership MAC using the membership_key.
''
[ "section-12.4.2-2.2.1"
, "section-12.4.2-2.2.2.1"
]
[ "section-12.4.2-2.2.1", "section-12.4.2-2.2.2.1" ]
)
types.Status.Unknown
types.CodeRefs/empty
Expand Down Expand Up @@ -128,13 +126,12 @@ let checks =
types.Status.Missing
types.CodeRefs/empty
types.CodeRefs/empty
( types.Notes/single
''
reported in https://github.com/xmtp/openmls/pull/19
''
)
( types.Notes/single
''
reported in https://github.com/xmtp/openmls/pull/19
''
)
]
: List types.Check

in types.CheckSet/new id name desc checks

49 changes: 46 additions & 3 deletions utils/html.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,29 @@ let RfcRef/links
(Types.RfcRef/urls ref)
)

let CodeRefs/asUl
: Text -> Types.CodeRefs -> XML.Type
= \(name : Text) ->
\(ref : Types.CodeRefs) ->
XML/asUl
name
( Prelude.List.map
Types.CodeRef
XML.Type
(\(codeRef : Types.CodeRef) -> XML.text codeRef.modPath)
ref.refs
)

let Check/tableRow
: Types.Check -> XML.Type
= \(check : Types.Check) ->
let br =
XML.element
{ name = "br"
, attributes = XML.emptyAttributes
, content = [] : List XML.Type
}

let idCell =
XML.element
{ name = "td"
Expand Down Expand Up @@ -89,12 +109,35 @@ let Check/tableRow
, content = [ XML.text (Types.Status/show check.status) ]
}

let notesUl =
if Prelude.List.null Text check.notes.notes
then [ XML.text "no notes.", br ]
else [ XML.text "notes:"
, XML/asUl
"notes"
( Prelude.List.map
Text
XML.Type
XML.text
check.notes.notes
)
]

let implsUl =
if Prelude.List.null Types.CodeRef check.code.refs
then [ XML.text "no refs to code." , br]
else [ XML.text "code refs:", CodeRefs/asUl "impls" check.code ]

let testsUl =
if Prelude.List.null Types.CodeRef check.test.refs
then [ XML.text "no refs to tests.", br ]
else [ XML.text "test refs:", CodeRefs/asUl "test" check.test ]

let notesCell =
XML.element
{ name = "td"
, attributes = XML.emptyAttributes
, content =
[XML/asUl "notes" (Prelude.List.map Text XML.Type XML.text check.notes.notes)]
, content = notesUl # implsUl # testsUl
}

in XML.element
Expand Down Expand Up @@ -132,7 +175,7 @@ let thead =
, XML.element
{ name = "th"
, attributes = XML.emptyAttributes
, content = [ XML.text "notes" ]
, content = [ XML.text "notes & code refs" ]
}
]
)
Expand Down
26 changes: 15 additions & 11 deletions views/dashboard.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ let XML = Prelude.XML
let checkSetHtmls =
Prelude.List.map Types.CheckSet XML.Type Html.CheckSet/table CheckSets

let footer = XML.element {
name = "footer",
attributes = XML.emptyAttributes,
content = [
XML.element {
name = "a",
attributes = [ XML.attribute "href" "bookmarklet.html" ],
content = [ XML.rawText "highlighting bookmarklet page" ]
let footer =
XML.element
{ name = "footer"
, attributes = XML.emptyAttributes
, content =
[ XML.element
{ name = "a"
, attributes = [ XML.attribute "href" "bookmarklet.html" ]
, content = [ XML.rawText "highlighting bookmarklet page" ]
}
]
}
]
}

let page = Html.outerTemplate "OpenMLS validation status" (checkSetHtmls # [footer])
let page =
Html.outerTemplate
"OpenMLS validation status"
(checkSetHtmls # [ footer ])

in "<!DOCTYPE html>" ++ XML.render page

0 comments on commit aaca7c8

Please sign in to comment.