Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions result_server/routes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,54 +39,54 @@ <h3>Export</h3>
<table class="evidence-snapshot-table">
<thead>
<tr>
<th>Application</th>
<th>System</th>
<th>Configured</th>
<th>Result / Quality</th>
<th>Exp</th>
<th>Profiled</th>
<th>Estimated</th>
<th>Source Status</th>
<th>Input Status</th>
<th>Build Cache</th>
<th>Public Result</th>
<th>Target</th>
<th>Configuration</th>
<th>Result Evidence</th>
<th>Profile / Estimate</th>
<th>Provenance</th>
<th>Next Action</th>
<th>Maturity Gaps</th>
</tr>
</thead>
<tbody>
{% for row in evidence_snapshot.rows %}
<tr>
<td>{{ row.code }}</td>
<td>{{ row.system }}</td>
<td title="{{ row.configured_status }}">{{ row.configured }}</td>
<td>
<span class="profile-usage-mono">{{ row.code }}</span>
<span class="profile-usage-subline">{{ row.system }}</span>
</td>
<td title="{{ row.configured_status }}">
<span class="evidence-snapshot-value">{{ row.configured }}</span>
<span class="profile-usage-subline">{{ row.configured_status }}</span>
</td>
<td>
{% if row.latest_result_file %}
<a href="{{ url_for('results.result_detail', filename=row.latest_result_file) }}">{{ row.latest_result_time }}</a>
{% else %}
-
{% endif %}
<span class="profile-usage-subline">{{ row.latest_result_status }}</span>
</td>
<td>{{ row.latest_result_exp }}</td>
<td>
{{ row.profiled }}
<span class="profile-usage-subline">{{ row.latest_profile_time }}</span>
<span class="profile-usage-subline">Quality: {{ row.latest_result_status }}</span>
<span class="profile-usage-subline">Exp: {{ row.latest_result_exp }} / Public: {{ row.public_result_available }}</span>
</td>
<td>
<span class="evidence-snapshot-label">Profiled</span> {{ row.profiled }}
<span class="profile-usage-subline">Latest: {{ row.latest_profile_time }}</span>
<span class="evidence-snapshot-label">Estimated</span>
{% if row.latest_estimate_file %}
<a href="{{ url_for('estimated.estimated_detail', filename=row.latest_estimate_file) }}">{{ row.estimated }}</a>
{% else %}
{{ row.estimated }}
{% endif %}
<span class="profile-usage-subline">{{ row.estimate_applicability }}</span>
<span class="profile-usage-subline">Applicability: {{ row.estimate_applicability }}</span>
</td>
<td>
<span class="evidence-snapshot-label">Source</span> {{ row.source_status }}
<span class="profile-usage-subline"><span class="evidence-snapshot-label">Input</span> {{ row.input_status }}</span>
<span class="profile-usage-subline"><span class="evidence-snapshot-label">Build Cache</span> {{ row.build_cache_status }}</span>
</td>
<td>
<span class="evidence-snapshot-value">{{ row.next_action }}</span>
<span class="profile-usage-subline">Maturity Gaps: {{ row.missing_reason }}</span>
</td>
<td>{{ row.source_status }}</td>
<td>{{ row.input_status }}</td>
<td>{{ row.build_cache_status }}</td>
<td>{{ row.public_result_available }}</td>
<td>{{ row.next_action }}</td>
<td>{{ row.missing_reason }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
28 changes: 15 additions & 13 deletions result_server/templates/usage_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
26 changes: 26 additions & 0 deletions result_server/tests/test_execution_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion result_server/tests/test_portal_list_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:</strong> the roll-up and CSV export source" in html
Expand Down
9 changes: 6 additions & 3 deletions result_server/tests/test_usage_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"])
Expand Down
16 changes: 14 additions & 2 deletions scripts/result_server/send_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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=()
Expand All @@ -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"

Expand Down
12 changes: 11 additions & 1 deletion scripts/tests/test_process_and_send_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Loading