This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/sbp by this push:
new 0b184a6 Link check result names to the corresponding JSON data
0b184a6 is described below
commit 0b184a6c71364df0c9d596859a906d0afe4d2bc7
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Feb 6 16:27:07 2026 +0000
Link check result names to the corresponding JSON data
---
atr/get/__init__.py | 2 ++
atr/get/result.py | 61 +++++++++++++++++++++++++++++++++
atr/static/css/atr.css | 14 ++++++++
atr/templates/report-selected-path.html | 14 ++++++--
playwright/test.py | 2 +-
5 files changed, 90 insertions(+), 3 deletions(-)
diff --git a/atr/get/__init__.py b/atr/get/__init__.py
index 7366bf1..d9a9ac6 100644
--- a/atr/get/__init__.py
+++ b/atr/get/__init__.py
@@ -41,6 +41,7 @@ import atr.get.ref as ref
import atr.get.release as release
import atr.get.report as report
import atr.get.resolve as resolve
+import atr.get.result as result
import atr.get.revisions as revisions
import atr.get.root as root
import atr.get.sbom as sbom
@@ -77,6 +78,7 @@ __all__ = [
"release",
"report",
"resolve",
+ "result",
"revisions",
"root",
"sbom",
diff --git a/atr/get/result.py b/atr/get/result.py
new file mode 100644
index 0000000..eaf4142
--- /dev/null
+++ b/atr/get/result.py
@@ -0,0 +1,61 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import json
+
+import asfquart.base as base
+
+import atr.blueprints.get as get
+import atr.db as db
+import atr.models.sql as sql
+import atr.web as web
+
+
[email protected]("/result/data/<project_name>/<version_name>/<int:check_id>")
+async def data(
+ session: web.Committer,
+ project_name: str,
+ version_name: str,
+ check_id: int,
+) -> web.TextResponse:
+ """Show a check result as formatted JSON."""
+ async with db.session() as data:
+ release = await data.release(
+ project_name=project_name,
+ version=version_name,
+ phase=sql.ReleasePhase.RELEASE_CANDIDATE,
+ _committee=True,
+ ).get()
+
+ if release is None:
+ await session.check_access(project_name)
+ release = await session.release(project_name, version_name,
with_committee=True)
+
+ if release.committee is None:
+ raise base.ASFQuartException("Release has no committee",
errorcode=500)
+ if release.latest_revision_number is None:
+ raise base.ASFQuartException("Release has no revision",
errorcode=500)
+
+ check_result = await data.check_result(
+ id=check_id,
+ release_name=release.name,
+ revision_number=release.latest_revision_number,
+ ).demand(base.ASFQuartException("Check result not found",
errorcode=404))
+
+ payload = check_result.model_dump(mode="json", exclude={"release"})
+ body = json.dumps(payload, indent=2, sort_keys=True)
+ return web.TextResponse(f"{body}\n")
diff --git a/atr/static/css/atr.css b/atr/static/css/atr.css
index d3e121b..9fc6ee5 100644
--- a/atr/static/css/atr.css
+++ b/atr/static/css/atr.css
@@ -439,6 +439,20 @@ span.warning {
text-decoration: underline;
}
+a.atr-link-plain,
+a.atr-link-plain:link,
+a.atr-link-plain:visited {
+ color: inherit !important;
+ text-decoration: none !important;
+ font-weight: inherit;
+}
+
+a.atr-link-plain:hover,
+a.atr-link-plain:focus-visible {
+ color: inherit !important;
+ text-decoration: underline;
+}
+
.atr-border-dashed {
border-style: dashed !important;
}
diff --git a/atr/templates/report-selected-path.html
b/atr/templates/report-selected-path.html
index b0f7a8b..94ad614 100644
--- a/atr/templates/report-selected-path.html
+++ b/atr/templates/report-selected-path.html
@@ -109,7 +109,12 @@
<tbody>
{% for primary_result in primary_results %}
<tr class="atr-result-primary atr-result-status-{{
primary_result.status.value }} {% if primary_result.status.value == 'success'
and not all_primary_are_success %}atr-hide{% endif %}">
- <th scope="row" class="align-middle fw-bold">{{
function_name_from_key(primary_result.checker) }}</th>
+ <th scope="row" class="align-middle fw-bold">
+ <a class="atr-link-plain"
+ href="{{ as_url(get.result.data, project_name=project_name,
version_name=version_name, check_id=primary_result.id) }}">
+ {{ function_name_from_key(primary_result.checker) }}
+ </a>
+ </th>
<td class="align-middle text-break">
{% if primary_result.data is mapping and
primary_result.data.keys()|length > 0 %}
<details class="bg-light rounded">
@@ -291,7 +296,12 @@
{# But we leave it here for clean initial page rendering #}
<tr class="atr-result-member atr-result-status-{{
member_result.status.value }} {% if member_result.status.value == 'success' and
not all_member_are_success %}atr-hide{% endif %} {% if loop.index is odd
%}page-member-visible-odd{% endif %} ">
<td class="align-middle">{{ member_rel_path }}</td>
- <th scope="row" class="align-middle fw-bold">{{
function_name_from_key(member_result.checker) }}</th>
+ <th scope="row" class="align-middle fw-bold">
+ <a class="atr-link-plain"
+ href="{{ as_url(get.result.data,
project_name=project_name, version_name=version_name,
check_id=member_result.id) }}">
+ {{ function_name_from_key(member_result.checker) }}
+ </a>
+ </th>
<td class="align-middle text-break">
{% if member_result.message %}{{ member_result.message }}{%
endif %}
</td>
diff --git a/playwright/test.py b/playwright/test.py
index 210b797..792776b 100755
--- a/playwright/test.py
+++ b/playwright/test.py
@@ -631,7 +631,7 @@ def test_checks_02_license_files(page: Page, credentials:
Credentials) -> None:
ensure_success_results_are_visible(page, "primary")
logging.info("Verifying License Files check status")
- check_row_locator =
page.locator("tr.atr-result-primary:has(th:text-is('License Files'))")
+ check_row_locator =
page.locator("tr.atr-result-primary:has(th:has-text('License Files'))")
expect(check_row_locator).to_have_count(2)
logging.info("Located 2 License Files check rows")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]