From 65beeec249623c8ccf176d13f8ca5bff121d5804 Mon Sep 17 00:00:00 2001 From: yoshifuminakamura Date: Wed, 9 Sep 2026 17:09:57 +0900 Subject: [PATCH 1/2] Normalize trigger result upload URLs Signed-off-by: yoshifuminakamura --- result_server/routes/admin.py | 2 ++ .../tests/test_execution_profiles.py | 26 +++++++++++++++++++ scripts/result_server/send_results.sh | 16 ++++++++++-- .../tests/test_process_and_send_results.sh | 12 ++++++++- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/result_server/routes/admin.py b/result_server/routes/admin.py index 5e71d38c..d216703d 100644 --- a/result_server/routes/admin.py +++ b/result_server/routes/admin.py @@ -285,6 +285,8 @@ def _portal_result_server_url(): return configured.rstrip("/") path = request.path or "" prefix = path.split("/admin/", 1)[0] if "/admin/" in path else "" + if prefix.endswith("/console"): + prefix = prefix[: -len("/console")] if prefix == "/admin": prefix = "" return f"{request.url_root.rstrip('/')}{prefix}" diff --git a/result_server/tests/test_execution_profiles.py b/result_server/tests/test_execution_profiles.py index 99f4f1a0..d97b9f09 100644 --- a/result_server/tests/test_execution_profiles.py +++ b/result_server/tests/test_execution_profiles.py @@ -2654,6 +2654,32 @@ def test_admin_execution_profiles_dry_run_uses_portal_prefix_for_result_server( _cleanup(temp_dirs) +def test_admin_execution_profiles_dry_run_strips_console_prefix_for_result_server( + tmp_path, + monkeypatch, +): + db_path = tmp_path / "cx_portal.sqlite3" + app, temp_dirs = _admin_app(db_path) + try: + with app.test_request_context( + "/dev2/console/admin/execution-profiles/dry-run-submit", + base_url="https://portal.example.org", + ): + assert _portal_result_server_url() == "https://portal.example.org/dev2" + with app.test_request_context( + "/dev/console/admin/execution-profiles/dry-run-submit", + base_url="https://portal.example.org", + ): + assert _portal_result_server_url() == "https://portal.example.org/dev" + with app.test_request_context( + "/console/admin/execution-profiles/dry-run-submit", + base_url="https://portal.example.org", + ): + assert _portal_result_server_url() == "https://portal.example.org" + finally: + _cleanup(temp_dirs) + + def test_admin_execution_profiles_dry_run_uses_configured_result_server_url( tmp_path, monkeypatch, diff --git a/scripts/result_server/send_results.sh b/scripts/result_server/send_results.sh index 4b89b344..23597e0b 100644 --- a/scripts/result_server/send_results.sh +++ b/scripts/result_server/send_results.sh @@ -107,6 +107,18 @@ build_profile_data_summary_for_archives() { rm -f "$summaries_file" } +log_result_summary() { + local json_file="$1" + + if ! jq -r ' + def field_value: + if . == null or . == "" then "-" else tostring end; + "Result summary: code=\(.code | field_value) system=\(.system | field_value) mode=\(.execution_mode | field_value) exp=\(.exp | field_value) fom=\(.fom | field_value) pipeline=\(.pipeline_id | field_value)" + ' "$json_file" 2>/dev/null; then + echo "Result summary: unavailable" + fi +} + is_safe_local_padata_path() { local artifact_path="$1" @@ -198,7 +210,7 @@ for json_file in results/result*.json; do tgz_file="results/${tgz_base}.tgz" fi - echo tgz_file $tgz_file + echo tgz_file "$tgz_file" padata_archive_paths=() padata_archive_specs=() @@ -219,7 +231,7 @@ for json_file in results/result*.json; do fi echo "Processing $json_file" - cat "$json_file" + log_result_summary "$json_file" echo "Posting $json_file to ${RESULT_SERVER}/api/ingest/result" diff --git a/scripts/tests/test_process_and_send_results.sh b/scripts/tests/test_process_and_send_results.sh index 4833baa6..992b65e4 100644 --- a/scripts/tests/test_process_and_send_results.sh +++ b/scripts/tests/test_process_and_send_results.sh @@ -108,7 +108,7 @@ export BK_TRIGGER_REASON="cron:0 14 * * *@2026-08-07T14:00+09:00" export PARENT_PIPELINE_ID="54321" pushd "${TMP_DIR}/project" >/dev/null -bash scripts/result_server/process_and_send_results.sh qws Fugaku cross qws_Fugaku_build qws_Fugaku_N1_P2_T3_run 12345 +bash scripts/result_server/process_and_send_results.sh qws Fugaku cross qws_Fugaku_build qws_Fugaku_N1_P2_T3_run 12345 > "${TMP_DIR}/process.log" popd >/dev/null test ! -f "${TMP_DIR}/project/results/result0.json" @@ -172,5 +172,15 @@ jq -e ' ' "${TMP_DIR}/project/send_results_workspace/results/result0.json" >/dev/null jq -e '."result0.json".uuid == "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"' \ "${TMP_DIR}/project/send_results_workspace/results/server_result_meta.json" >/dev/null +grep -q "Result summary: code=qws system=Fugaku mode=cross" "${TMP_DIR}/process.log" +grep -q "pipeline=12345" "${TMP_DIR}/process.log" +if grep -q '"environment_snapshot"' "${TMP_DIR}/process.log"; then + echo "process log should not include full result JSON" >&2 + exit 1 +fi +if grep -q "should-not-leak" "${TMP_DIR}/process.log"; then + echo "process log should not include cache-local paths" >&2 + exit 1 +fi echo "process_and_send_results read-only artifact test passed" From 0f22e96fce39e3bd241e4ad7402519f7102868bd Mon Sep 17 00:00:00 2001 From: yoshifuminakamura Date: Wed, 9 Sep 2026 17:30:18 +0900 Subject: [PATCH 2/2] Polish usage evidence snapshot table Signed-off-by: yoshifuminakamura --- ...sage_report_evidence_snapshot_section.html | 56 +++++++++---------- result_server/templates/usage_report.html | 28 +++++----- .../tests/test_portal_list_templates.py | 4 +- result_server/tests/test_usage_route.py | 9 ++- 4 files changed, 52 insertions(+), 45 deletions(-) diff --git a/result_server/templates/_usage_report_evidence_snapshot_section.html b/result_server/templates/_usage_report_evidence_snapshot_section.html index 2021ac31..ae19c08b 100644 --- a/result_server/templates/_usage_report_evidence_snapshot_section.html +++ b/result_server/templates/_usage_report_evidence_snapshot_section.html @@ -39,54 +39,54 @@

Export

- - - - - - - - - - - + + + + + - {% for row in evidence_snapshot.rows %} - - - + + - - + + - - - - - - {% endfor %} diff --git a/result_server/templates/usage_report.html b/result_server/templates/usage_report.html index 16d442d3..ca7d5f90 100644 --- a/result_server/templates/usage_report.html +++ b/result_server/templates/usage_report.html @@ -178,26 +178,28 @@ overflow-wrap: anywhere; } .evidence-snapshot-table { - min-width: 1240px; + min-width: 1160px; table-layout: fixed; } - .evidence-snapshot-table th:nth-child(1) { width: 150px; } - .evidence-snapshot-table th:nth-child(2) { width: 150px; } - .evidence-snapshot-table th:nth-child(3) { width: 120px; } - .evidence-snapshot-table th:nth-child(4) { width: 180px; } - .evidence-snapshot-table th:nth-child(5) { width: 110px; } - .evidence-snapshot-table th:nth-child(6) { width: 140px; } - .evidence-snapshot-table th:nth-child(7) { width: 140px; } - .evidence-snapshot-table th:nth-child(8) { width: 130px; } - .evidence-snapshot-table th:nth-child(9) { width: 120px; } - .evidence-snapshot-table th:nth-child(10) { width: 130px; } - .evidence-snapshot-table th:nth-child(11) { width: 130px; } - .evidence-snapshot-table th:nth-child(12) { width: 260px; } + .evidence-snapshot-table th:nth-child(1) { width: 170px; } + .evidence-snapshot-table th:nth-child(2) { width: 160px; } + .evidence-snapshot-table th:nth-child(3) { width: 220px; } + .evidence-snapshot-table th:nth-child(4) { width: 210px; } + .evidence-snapshot-table th:nth-child(5) { width: 200px; } + .evidence-snapshot-table th:nth-child(6) { width: 260px; } .evidence-snapshot-table td { vertical-align: top; white-space: normal; overflow-wrap: anywhere; } + .evidence-snapshot-value { + font-weight: 700; + color: #243b53; + } + .evidence-snapshot-label { + color: #52606d; + font-weight: 700; + } .profile-usage-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; diff --git a/result_server/tests/test_portal_list_templates.py b/result_server/tests/test_portal_list_templates.py index 1d6f2deb..2162c49b 100644 --- a/result_server/tests/test_portal_list_templates.py +++ b/result_server/tests/test_portal_list_templates.py @@ -777,7 +777,9 @@ def test_usage_report_evidence_snapshot_consolidates_coverage_and_quality(): assert "needs matching profiled run" in html assert "1 with timing / 1 estimates; avg 42s" in html assert "1 hit / 0 miss" in html - assert "Result / Quality" in html + assert "Result Evidence" in html + assert "Profile / Estimate" in html + assert "Provenance" in html assert "Application/System Coverage" not in html assert "Latest Result Quality Details" not in html assert "Evidence Snapshot: the roll-up and CSV export source" in html diff --git a/result_server/tests/test_usage_route.py b/result_server/tests/test_usage_route.py index f28e4590..5575d618 100644 --- a/result_server/tests/test_usage_route.py +++ b/result_server/tests/test_usage_route.py @@ -109,7 +109,9 @@ def test_usage_page_shows_consolidated_evidence_snapshot(self, client, tmp_dirs) text = resp.get_data(as_text=True) assert "Configuration Checks" in text assert "Evidence Snapshot" in text - assert "Result / Quality" in text + assert "Result Evidence" in text + assert "Profile / Estimate" in text + assert "Provenance" in text assert "Application/System Coverage" not in text assert "Latest Result Quality Details" not in text assert "Maturity Gaps" in text @@ -138,9 +140,10 @@ def test_usage_page_shows_source_tracking_columns_when_rollup_exists(self, clien resp = client.get("/results/usage") text = resp.get_data(as_text=True) assert resp.status_code == 200 - assert "Source Status" in text + assert "Provenance" in text + assert "Source" in text assert "tracked" in text - assert "Input Status" in text + assert "Input" in text def test_usage_route_uses_default_parameters(self, app, client, monkeypatch): _login_session(client, "admin@example.com", ["admin"])
ApplicationSystemConfiguredResult / QualityExpProfiledEstimatedSource StatusInput StatusBuild CachePublic ResultTargetConfigurationResult EvidenceProfile / EstimateProvenance Next ActionMaturity Gaps
{{ row.code }}{{ row.system }}{{ row.configured }} + {{ row.code }} + {{ row.system }} + + {{ row.configured }} + {{ row.configured_status }} + {% if row.latest_result_file %} {{ row.latest_result_time }} {% else %} - {% endif %} - {{ row.latest_result_status }} - {{ row.latest_result_exp }} - {{ row.profiled }} - {{ row.latest_profile_time }} + Quality: {{ row.latest_result_status }} + Exp: {{ row.latest_result_exp }} / Public: {{ row.public_result_available }} + Profiled {{ row.profiled }} + Latest: {{ row.latest_profile_time }} + Estimated {% if row.latest_estimate_file %} {{ row.estimated }} {% else %} {{ row.estimated }} {% endif %} - {{ row.estimate_applicability }} + Applicability: {{ row.estimate_applicability }} + + Source {{ row.source_status }} + Input {{ row.input_status }} + Build Cache {{ row.build_cache_status }} + + {{ row.next_action }} + Maturity Gaps: {{ row.missing_reason }} {{ row.source_status }}{{ row.input_status }}{{ row.build_cache_status }}{{ row.public_result_available }}{{ row.next_action }}{{ row.missing_reason }}