From 678117a7567be365289f08afe92f824efcbc038c Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 1 Jun 2023 17:58:20 -0400 Subject: [PATCH 1/3] chore: bump repo review to 0.6.1 Signed-off-by: Henry Schreiner --- docs/_includes/head_custom.html | 4 +- docs/assets/js/webapp.js | 92 +++++++++++++++++++++------------ 2 files changed, 62 insertions(+), 34 deletions(-) diff --git a/docs/_includes/head_custom.html b/docs/_includes/head_custom.html index 1d75864e..b3d52efb 100644 --- a/docs/_includes/head_custom.html +++ b/docs/_includes/head_custom.html @@ -3,7 +3,7 @@ {%- if page.interactive_repo_review %} @@ -16,7 +16,7 @@ crossorigin > diff --git a/docs/assets/js/webapp.js b/docs/assets/js/webapp.js index eecfb833..6458eb6b 100644 --- a/docs/assets/js/webapp.js +++ b/docs/assets/js/webapp.js @@ -17,7 +17,7 @@ function Heading(props) { Scikit-HEP-Repo-Review Developer Guidelines @@ -39,6 +39,12 @@ function Results(props) { for (const key in props.results) { const inner_results = props.results[key]; const results_components = inner_results.map((result) => { + const text_color = + result.state === false + ? "error.main" + : result.state === true + ? "text.primary" + : "info.main"; const details = result.state === false ? ( @@ -48,21 +54,23 @@ function Results(props) { ? "error" : result.state === true ? "success" - : "warning"; + : "info"; const icon = ( {result.state === false - ? "error" + ? "report" : result.state === true - ? "check_circle" - : "warning"} + ? "check_box" + : "info"} ); + const skipped = ( {" [skipped]"} @@ -73,11 +81,19 @@ function Results(props) { sx={{ display: "inline" }} component="span" variant="body2" - color="text.primary" + color={text_color} > {result.name + ": "} - {result.description} + + + {result.description} + + {result.state === undefined && skipped} ); @@ -92,7 +108,9 @@ function Results(props) { output.push(
    • - {key} + + {props.families[key]} + {results_components}
  • @@ -114,7 +132,7 @@ async function prepare_pyodide() { await pyodide.loadPackage("micropip"); await pyodide.runPythonAsync(` import micropip - await micropip.install(["scikit_hep_repo_review==0.5.0"]) + await micropip.install(["scikit_hep_repo_review==0.6.1"]) `); return pyodide; } @@ -177,19 +195,18 @@ class App extends React.Component { }); const state = this.state; pyodide_promise.then((pyodide) => { - var results_dict; + var families_checks; try { - results_dict = pyodide.runPython(` - from pyodide.http import open_url - from scikit_hep_repo_review.processor import process - from scikit_hep_repo_review.ghpath import GHPath + families_checks = pyodide.runPython(` + from pyodide.http import open_url + from scikit_hep_repo_review.processor import process + from scikit_hep_repo_review.ghpath import GHPath - GHPath.open_url = staticmethod(open_url) + GHPath.open_url = staticmethod(open_url) - package = GHPath(repo="${state.repo}", branch="${state.branch}") - results_dict = process(package) - results_dict - `); + package = GHPath(repo="${state.repo}", branch="${state.branch}") + process(package) + `); } catch (e) { if (e.message.includes("KeyError: 'tree'")) { this.setState({ @@ -206,27 +223,35 @@ class App extends React.Component { return; } + const families_dict = families_checks.get(0); + const results_list = families_checks.get(1); + const results = {}; - for (const res of results_dict) { - const vals = results_dict.get(res); - const inner_results = []; - for (const val of vals) { - inner_results.push({ - name: val.name.toString(), - description: val.description.toString(), - state: val.result, - err_msg: val.err_markdown().toString(), - }); - } - results[res] = inner_results; + const families = {}; + for (const val of families_dict) { + results[val] = []; + families[val] = families_dict.get(val).get("name"); + } + console.log(families); + for (const val of results_list) { + results[val.family].push({ + name: val.name.toString(), + description: val.description.toString(), + state: val.result, + err_msg: val.err_markdown().toString(), + }); } this.setState({ results: results, + families: families, msg: `Results for ${state.repo}@${state.branch}`, progress: false, err_msg: "", }); + + results_list.destroy(); + families_dict.destroy(); }); } @@ -305,7 +330,10 @@ class App extends React.Component { )} - + From 0fc2045bdd18f4770ebb780b4a4e0f17947ba556 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 1 Jun 2023 23:06:42 -0400 Subject: [PATCH 2/3] Update docs/assets/js/webapp.js --- docs/assets/js/webapp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/assets/js/webapp.js b/docs/assets/js/webapp.js index 6458eb6b..587c82f1 100644 --- a/docs/assets/js/webapp.js +++ b/docs/assets/js/webapp.js @@ -17,7 +17,7 @@ function Heading(props) { Scikit-HEP-Repo-Review Developer Guidelines From a7035bc0d1b158bf815908f530f4a0a77460cf9b Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 2 Jun 2023 09:06:37 -0400 Subject: [PATCH 3/3] Update docs/assets/js/webapp.js --- docs/assets/js/webapp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/assets/js/webapp.js b/docs/assets/js/webapp.js index 587c82f1..91b2606c 100644 --- a/docs/assets/js/webapp.js +++ b/docs/assets/js/webapp.js @@ -17,7 +17,7 @@ function Heading(props) { Scikit-HEP-Repo-Review Developer Guidelines