From 65f5e4c6a1fb3266a3b04bb461914a74c8faca91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 1 Nov 2023 08:04:54 +0000 Subject: [PATCH] frontend: output description can be optional --- backend/seed_db.py | 124 +++++++++++++++++- frontend/src/Flakestry/FlakeSchema.elm | 4 +- .../Flake/Github/Org_/Repo_/Version_.elm | 2 +- 3 files changed, 126 insertions(+), 4 deletions(-) diff --git a/backend/seed_db.py b/backend/seed_db.py index 5e16b93..71661ac 100644 --- a/backend/seed_db.py +++ b/backend/seed_db.py @@ -230,7 +230,129 @@ def main() -> None: commit="123", meta_data={}, meta_data_errors="", - outputs={}, + outputs={ + "checks": { + "x86_64-linux": { + "pre-commit-check": { + "name": "pre-commit-run", + "type": "derivation", + } + } + }, + "overlay": {"type": "nixpkgs-overlay"}, + "packages": { + "x86_64-linux": { + "mlir": {"name": "mlir-6d43651", "type": "derivation"}, + "jless": {"name": "jless-v0.7.1", "type": "derivation"}, + "qprez": {"name": "r-qprez", "type": "derivation"}, + "daphne": {"name": "daphne-0.1", "type": "derivation"}, + "pajeng": {"name": "pajeng", "type": "derivation"}, + "starpu": {"name": "starpu", "type": "derivation"}, + "topo5k": {"name": "topo5k", "type": "derivation"}, + "vanidl": {"name": "python3.10-vanidl", "type": "derivation"}, + "ondes3d": {"name": "ondes3d", "type": "derivation"}, + "pajengr": {"name": "r-pajengr", "type": "derivation"}, + "recorder": {"name": "Recorder", "type": "derivation"}, + "snakefmt": { + "name": "python3.10-snakefmt-v0.8.0", + "type": "derivation", + }, + "antlr-cpp": {"name": "antlr-cpp-master", "type": "derivation"}, + "freetype2": {"name": "freetype2", "type": "derivation"}, + "ggpattern": {"name": "r-ggpattern", "type": "derivation"}, + "madbench2": {"name": "MADbench2", "type": "derivation"}, + "pydarshan": { + "name": "python3.10-pydarshan", + "type": "derivation", + }, + "globus-cli": { + "name": "python3.10-globus-cli", + "type": "derivation", + }, + "globus-sdk": { + "name": "python3.10-globus-sdk", + "type": "derivation", + }, + "httpimport": { + "name": "python3.10-httpimport", + "type": "derivation", + }, + "facetscales": {"name": "r-facetscales", "type": "derivation"}, + "ior-simgrid": { + "name": "ior-simgrid-3.3.0", + "type": "derivation", + "description": "Parallel file system I/O performance test", + }, + "smpi_replay": {"name": "smpi_replay", "type": "derivation"}, + "darshan-perl": { + "name": "perl-5.36.0-env", + "type": "derivation", + "description": "The standard implementation of the Perl 5 programmming language", + }, + "darshan-util": {"name": "darshan-util", "type": "derivation"}, + "geomtextpath": { + "name": "r-geomtextpath", + "type": "derivation", + }, + "recorder-viz": { + "name": "python3.10-recorder-viz", + "type": "derivation", + }, + "hackernewsTUI": { + "name": "hackernews-TUI-v0.7.1", + "type": "derivation", + }, + "myTextshaping": { + "name": "r-textshaping", + "type": "derivation", + }, + "python-control": { + "name": "python3.10-python-control-0.9.2", + "type": "derivation", + }, + "uga_thesis_rmd": { + "name": "r-uga_thesis_rmd", + "type": "derivation", + }, + "darshan-runtime": { + "name": "darshan-runtime", + "type": "derivation", + }, + "madbench2-darshan": { + "name": "MADbench2", + "type": "derivation", + }, + "globus-connect-personal": { + "name": "globus-connect-personal", + "type": "derivation", + }, + } + }, + "devShells": { + "x86_64-linux": { + "check": {"name": "nix-shell", "type": "derivation"}, + "shell-R": {"name": "R", "type": "derivation"}, + "shell-lua": {"name": "lua", "type": "derivation"}, + "shell-julia": {"name": "julia", "type": "derivation"}, + "shell-python": {"name": "python", "type": "derivation"}, + } + }, + "templates": { + "C": {"type": "template", "description": "a simple C template"}, + "R": {"type": "template", "description": "R and friends"}, + "md": { + "type": "template", + "description": "a Markdown + Pandoc template", + }, + "Rmd": {"type": "template", "description": "a RMarkdown template"}, + "QPrez": {"type": "template", "description": "a QPrez template"}, + "python": { + "type": "template", + "description": "a Python3.8 template", + }, + "default": {"type": "template", "description": "basic shell"}, + }, + }, outputs_errors="", ) diff --git a/frontend/src/Flakestry/FlakeSchema.elm b/frontend/src/Flakestry/FlakeSchema.elm index c675031..f7e1d0a 100644 --- a/frontend/src/Flakestry/FlakeSchema.elm +++ b/frontend/src/Flakestry/FlakeSchema.elm @@ -9,7 +9,7 @@ import Json.Decode as Decode exposing (Decoder, dict, field, maybe, string) type alias Derivation = - { description : String + { description : Maybe String , name : String , type_ : String } @@ -44,7 +44,7 @@ type alias Root = derivationDecoder : Decoder Derivation derivationDecoder = Decode.map3 Derivation - (field "description" string) + (maybe (field "description" string)) (field "name" string) (field "type" string) diff --git a/frontend/src/Pages/Flake/Github/Org_/Repo_/Version_.elm b/frontend/src/Pages/Flake/Github/Org_/Repo_/Version_.elm index 422b314..4c16cd7 100644 --- a/frontend/src/Pages/Flake/Github/Org_/Repo_/Version_.elm +++ b/frontend/src/Pages/Flake/Github/Org_/Repo_/Version_.elm @@ -507,7 +507,7 @@ viewOutput model = , mkSection "name" , span [ class "m-4" ] [ text output.drv.name ] , mkSection "description" - , span [ class "m-4" ] [ text output.drv.description ] + , span [ class "m-4" ] [ text (Maybe.withDefault "" output.drv.description) ] , mkSection "type" , span [ class "m-4" ] [ text output.drv.type_ ] ]