Skip to content

Commit

Permalink
feat: add modules and lang to impl dashboard (#1043)
Browse files Browse the repository at this point in the history
- Add rows to the impl dashboard for submodules and columns for module and lang.
- Remove problematic "project" column.

Fixes #1037
Fixes #1038

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
  • Loading branch information
olizilla committed Aug 6, 2020
1 parent d34bd0f commit 37e290d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 41 deletions.
3 changes: 2 additions & 1 deletion content/implementations/forest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ title: Forest
weight: 3
implAudit: 0
implSpecCompliance: 0
implRepo: https://github.com/ChainSafe/forest
implRepos:
- { lang: rust, repo: https://github.com/ChainSafe/forest }
---

# Forest is an implementation of Filecoin written in Rust
Expand Down
5 changes: 3 additions & 2 deletions content/implementations/fuhon.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: Fuhon (cpp-filecoin)
title: Fuhon
weight: 4
implAudit: 0
implSpecCompliance: 0
implRepo: https://github.com/filecoin-project/cpp-filecoin
implRepos:
- { lang: c++, repo: https://github.com/filecoin-project/cpp-filecoin }
---

# Fuhon (cpp-filecoin)
Expand Down
5 changes: 3 additions & 2 deletions content/implementations/go-filecoin.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: Filecoin (go-filecoin)
title: go-filecoin
weight: 2
implAudit: 0
implSpecCompliance: 0
implRepo: https://github.com/filecoin-project/go-filecoin
implRepos:
- { lang: go, repo: https://github.com/filecoin-project/go-filecoin }
---

# Filecoin (go-filecoin)
Expand Down
9 changes: 8 additions & 1 deletion content/implementations/lotus.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ weight: 1

implAudit: 0
implSpecCompliance: 0
implRepo: https://github.com/filecoin-project/lotus
implRepos:
- { lang: go, repo: https://github.com/filecoin-project/lotus }
- { lang: go, repo: https://github.com/filecoin-project/storage-fsm }
- { lang: go, repo: https://github.com/filecoin-project/sector-storage }
- { lang: go, repo: https://github.com/filecoin-project/specs-storage }
- { lang: go, repo: https://github.com/filecoin-project/go-fil-markets }
- { lang: go, repo: https://github.com/filecoin-project/specs-actors }
- { lang: rust, repo: https://github.com/filecoin-project/rust-fil-proofs }
---

# Lotus
Expand Down
77 changes: 42 additions & 35 deletions layouts/shortcodes/dashboard-impl.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<table id="dashboard-impls" class="sort Dashboard">
<thead>
<tr>
<th>Implementation</th>
<th style="width:20%">Repo</th>
<th>Language</th>
<th>CI</th>
<th>Test Coverage</th>
<th>Security Audit</th>
Expand All @@ -15,40 +16,46 @@
<!-- Children Template -->
{{ define "dashboard-impls-children" }}
{{- $pages := where .Section.Pages "Params.bookhidden" "ne" true -}}
{{- range sort $pages "Weight" "asc" -}}
{{ $parts := split .Params.implRepo "/" }}
{{ $size := len $parts }}
{{ $path := delimit (slice (index $parts (sub $size 2)) (index $parts (sub $size 1))) "/" }}
{{ $url := printf "https://codecov.io/api/gh/%s" $path }}
{{ $data := getJSON $url }}
{{ $cov := $data.commit.totals.c }}
{{ $color := "bg-na"}}
{{ if gt $cov 0 }}
{{ $color = "bg-incorrect"}}
{{- range $impl := (sort $pages "Weight" "asc") -}}
{{- range $repoUrlIndex, $repoItem := .Params.implRepos -}}
{{ $repoUrl := $repoItem.repo }}
{{ $repoLang := $repoItem.lang }}
{{ $parts := split $repoUrl "/" }}
{{ $size := len $parts }}
{{ $repoName := (index $parts (sub $size 1)) }}
{{ $repoOrg := (index $parts (sub $size 2)) }}
{{ $path := delimit (slice $repoOrg $repoName) "/" }}
{{ $url := printf "https://codecov.io/api/gh/%s" $path }}
{{ $data := getJSON $url }}
{{ $cov := $data.commit.totals.c }}
{{ $color := "bg-na"}}
{{ if gt $cov 0 }}
{{ $color = "bg-incorrect"}}
{{ end }}
{{ if gt $cov 20 }}
{{ $color = "bg-wip"}}
{{ end }}
{{ if gt $cov 45 }}
{{ $color = "bg-incomplete"}}
{{ end }}
{{ if gt $cov 70 }}
{{ $color = "bg-stable"}}
{{ end }}
<tr>
<td style="text-align:left"><a title="{{ $repoName }}" href="{{ $repoUrl }}">{{ $repoName }}</a></td>
<td>{{ $repoLang }}</td>
<td class="text-black {{ if eq $data.commit.ci_passed true }}bg-stable{{ else if eq $data.commit.ci_passed false }}bg-incorrect {{ else }}bg-na{{end}}">
{{ if eq $data.commit.ci_passed true }}Passed{{ else if eq $data.commit.ci_passed false }}Failed{{ else }}Unknown{{ end }}
</td>
<td class="text-black {{ $color }}">
<a class="text-black" href="https://codecov.io/gh/{{ $path }}" title="Open on codecov.io">
{{ if $data.commit.totals.c }}{{ math.Round $data.commit.totals.c }}%{{ else }}Unknown{{end}}
</a>
</td>
<td class="text-transparent {{ if gt $impl.Params.implAudit 0 }}bg-stable{{ else }}bg-incorrect{{end}}">
{{ $impl.Params.implAudit }}
</td>
</tr>
{{ end }}
{{ if gt $cov 20 }}
{{ $color = "bg-wip"}}
{{ end }}
{{ if gt $cov 45 }}
{{ $color = "bg-incomplete"}}
{{ end }}
{{ if gt $cov 70 }}
{{ $color = "bg-stable"}}
{{ end }}
<tr>
<td><a title="{{.Title}}" href="{{.Permalink}}">{{.Title}}</a></td>
<td class="text-black {{ if eq $data.commit.ci_passed true }}bg-stable{{ else if eq $data.commit.ci_passed false }}bg-incorrect {{ else }}bg-na{{end}}">
{{ if eq $data.commit.ci_passed true }}Passed{{ else if eq $data.commit.ci_passed false }}Failed{{ else }}Unknown{{ end }}
</td>
<td class="text-black {{ $color }}">
<a class="text-black" href="https://codecov.io/gh/{{ $path }}" title="Open on codecov.io">
{{ if $data.commit.totals.c }}{{ math.Round $data.commit.totals.c }}%{{ else }}N/A{{end}}
</a>
</td>
<td class="text-transparent {{ if gt .Page.Params.implAudit 0 }}bg-stable{{ else }}bg-incorrect{{end}}">
{{ .Page.Params.implAudit }}
</td>
</tr>

{{ end }}
{{ end }}

0 comments on commit 37e290d

Please sign in to comment.