This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new 74350f1  Add a table of ignored checks
74350f1 is described below

commit 74350f14a20eb74c91168baac90a2fbea6440b42
Author: Sean B. Palmer <s...@miscoranda.com>
AuthorDate: Wed Jul 30 14:44:38 2025 +0100

    Add a table of ignored checks
---
 atr/routes/report.py                    |  9 ++++-----
 atr/storage/readers/checks.py           |  7 +++----
 atr/storage/types.py                    |  7 +++++++
 atr/templates/report-selected-path.html | 21 +++++++++++++++++++++
 4 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/atr/routes/report.py b/atr/routes/report.py
index fe16682..5a00607 100644
--- a/atr/routes/report.py
+++ b/atr/routes/report.py
@@ -59,9 +59,7 @@ async def selected_path(session: routes.CommitterSession, 
project_name: str, ver
     # Get all check results for this file
     async with storage.read() as read:
         ragp = read.as_general_public()
-        primary_results_list, member_results_list, _ignored_checks = await 
ragp.checks.by_release_path(
-            release, pathlib.Path(rel_path)
-        )
+        check_results = await ragp.checks.by_release_path(release, 
pathlib.Path(rel_path))
 
     file_data = {
         "filename": pathlib.Path(rel_path).name,
@@ -76,8 +74,9 @@ async def selected_path(session: routes.CommitterSession, 
project_name: str, ver
         rel_path=rel_path,
         package=file_data,
         release=release,
-        primary_results=primary_results_list,
-        member_results=member_results_list,
+        primary_results=check_results.primary_results_list,
+        member_results=check_results.member_results_list,
+        ignored_results=check_results.ignored_checks,
         format_file_size=util.format_file_size,
         empty_form=await util.EmptyForm.create_form(),
     )
diff --git a/atr/storage/readers/checks.py b/atr/storage/readers/checks.py
index 2f517b5..3a158d9 100644
--- a/atr/storage/readers/checks.py
+++ b/atr/storage/readers/checks.py
@@ -24,6 +24,7 @@ from typing import TYPE_CHECKING
 import atr.db as db
 import atr.models.sql as sql
 import atr.storage as storage
+import atr.storage.types as types
 
 if TYPE_CHECKING:
     import pathlib
@@ -43,9 +44,7 @@ class GeneralPublic:
         self.__data = data
         self.__asf_uid = asf_uid
 
-    async def by_release_path(
-        self, release: sql.Release, rel_path: pathlib.Path
-    ) -> tuple[list[sql.CheckResult], dict[str, list[sql.CheckResult]], 
list[sql.CheckResult]]:
+    async def by_release_path(self, release: sql.Release, rel_path: 
pathlib.Path) -> types.CheckResults:
         if release.committee is None:
             raise ValueError("Release has no committee")
         if release.latest_revision_number is None:
@@ -86,7 +85,7 @@ class GeneralPublic:
         # Order member results by relative path and then by checker name
         for member_rel_path in sorted(member_results_list.keys()):
             member_results_list[member_rel_path].sort(key=lambda r: r.checker)
-        return primary_results_list, member_results_list, ignored_checks
+        return types.CheckResults(primary_results_list, member_results_list, 
ignored_checks)
 
     def __check_ignore_match(self, cr: sql.CheckResult, cri: 
sql.CheckResultIgnore) -> bool:
         # Does not check that the committee name matches
diff --git a/atr/storage/types.py b/atr/storage/types.py
index ca643e9..c250671 100644
--- a/atr/storage/types.py
+++ b/atr/storage/types.py
@@ -225,6 +225,13 @@ class Outcomes[T, E: Exception = Exception]:
                     self.__outcomes[i] = OutcomeResult[T](result, outcome.name)
 
 
+@dataclasses.dataclass
+class CheckResults:
+    primary_results_list: list[sql.CheckResult]
+    member_results_list: dict[str, list[sql.CheckResult]]
+    ignored_checks: list[sql.CheckResult]
+
+
 class KeyStatus(enum.Flag):
     PARSED = 0
     INSERTED = enum.auto()
diff --git a/atr/templates/report-selected-path.html 
b/atr/templates/report-selected-path.html
index edcc12e..53d4c11 100644
--- a/atr/templates/report-selected-path.html
+++ b/atr/templates/report-selected-path.html
@@ -299,6 +299,27 @@
       </table>
     {% endif %}
 
+    <h2>Ignored checks</h2>
+    <p>These checks were ignored by policy.</p>
+    <table class="table table-bordered border mb-3">
+      <thead class="table-light">
+        <tr>
+          <th scope="col">Check</th>
+          <th scope="col">Message</th>
+          <th scope="col">Status</th>
+        </tr>
+      </thead>
+      <tbody>
+        {% for ignored_result in ignored_results %}
+          <tr>
+            <td>{{ ignored_result.checker }}</td>
+            <td>{{ ignored_result.message }}</td>
+            <td>{{ ignored_result.status.value|title }}</td>
+          </tr>
+        {% endfor %}
+      </tbody>
+    </table>
+
     <h2>Metadata</h2>
     <div class="p-3 mb-4 bg-light border rounded">
       <p>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@tooling.apache.org
For additional commands, e-mail: commits-h...@tooling.apache.org

Reply via email to