You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2026/05/13 14:34:44 UTC

(tooling-trusted-releases) 04/04: Reclassify some targz check results

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

commit c5783615f6172037635178f0b32147f758283738
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Wed May 13 15:33:51 2026 +0100

    Reclassify some targz check results
---
 atr/tasks/checks/targz.py                | 16 ++++----
 tests/unit/test_archive_root_variants.py | 64 +++++++++++++++++++++++++++-----
 2 files changed, 62 insertions(+), 18 deletions(-)

diff --git a/atr/tasks/checks/targz.py b/atr/tasks/checks/targz.py
index 51d91f55..fbf50d27 100644
--- a/atr/tasks/checks/targz.py
+++ b/atr/tasks/checks/targz.py
@@ -30,7 +30,7 @@ import atr.util as util
 # Release policy fields which this check relies on - used for result caching
 INPUT_POLICY_KEYS: Final[list[str]] = []
 INPUT_EXTRA_ARGS: Final[list[str]] = []
-CHECK_VERSION_STRUCTURE: Final[str] = "4"
+CHECK_VERSION_STRUCTURE: Final[str] = "5"
 
 
 class RootDirectoryError(Exception):
@@ -83,7 +83,7 @@ async def structure(args: checks.FunctionArguments) -> results.Results | None:
 
     archive_dir = await checks.resolve_archive_dir(args)
     if archive_dir is None:
-        await recorder.concern(
+        await recorder.exception(
             "Extracted archive tree is not available",
             {"rel_path": args.primary_rel_path},
         )
@@ -119,7 +119,7 @@ async def structure(args: checks.FunctionArguments) -> results.Results | None:
                         "filename_match": npm_info.filename_match,
                     }
                     if npm_info.filename_match is False:
-                        await recorder.concern(
+                        await recorder.suggestion(
                             "npm pack layout detected but filename does not match package.json", data
                         )
                     else:
@@ -127,19 +127,19 @@ async def structure(args: checks.FunctionArguments) -> results.Results | None:
                 else:
                     if npm_error is not None:
                         data["npm_pack_error"] = npm_error
-                    await recorder.concern(
+                    await recorder.suggestion(
                         f"Root directory '{root}' does not match expected names '{expected_roots_display}'", data
                     )
             else:
-                await recorder.concern(
+                await recorder.suggestion(
                     f"Root directory '{root}' does not match expected names '{expected_roots_display}'", data
                 )
         else:
-            await recorder.concern(
+            await recorder.suggestion(
                 f"Root directory '{root}' does not match expected names '{expected_roots_display}'", data
             )
     except RootDirectoryError as e:
-        await recorder.concern("Could not get the root directory of the archive", {"error": str(e)})
+        await recorder.exception("Could not get the root directory of the archive", {"error": str(e)})
     except Exception as e:
-        await recorder.concern("Unable to verify archive structure", {"error": str(e)})
+        await recorder.exception("Unable to verify archive structure", {"error": str(e)})
     return None
diff --git a/tests/unit/test_archive_root_variants.py b/tests/unit/test_archive_root_variants.py
index 975905bf..5012f2e8 100644
--- a/tests/unit/test_archive_root_variants.py
+++ b/tests/unit/test_archive_root_variants.py
@@ -44,7 +44,15 @@ async def test_targz_structure_accepts_npm_pack_root(tmp_path: pathlib.Path) ->
         await targz.structure(args)
 
     assert any(status == sql.CheckResultStatus.NOTE.value for status, _, _ in recorder.messages)
-    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert not any(
+        status
+        in {
+            sql.CheckResultStatus.CONCERN.value,
+            sql.CheckResultStatus.SUGGESTION.value,
+            sql.CheckResultStatus.EXCEPTION.value,
+        }
+        for status, _, _ in recorder.messages
+    )
 
 
 @pytest.mark.asyncio
@@ -56,6 +64,15 @@ async def test_targz_structure_accepts_source_release_suffix_variant(tmp_path: p
         await targz.structure(args)
 
     assert any(status == sql.CheckResultStatus.NOTE.value for status, _, _ in recorder.messages)
+    assert not any(
+        status
+        in {
+            sql.CheckResultStatus.CONCERN.value,
+            sql.CheckResultStatus.SUGGESTION.value,
+            sql.CheckResultStatus.EXCEPTION.value,
+        }
+        for status, _, _ in recorder.messages
+    )
 
 
 @pytest.mark.asyncio
@@ -67,6 +84,15 @@ async def test_targz_structure_accepts_source_suffix_variant(tmp_path: pathlib.P
         await targz.structure(args)
 
     assert any(status == sql.CheckResultStatus.NOTE.value for status, _, _ in recorder.messages)
+    assert not any(
+        status
+        in {
+            sql.CheckResultStatus.CONCERN.value,
+            sql.CheckResultStatus.SUGGESTION.value,
+            sql.CheckResultStatus.EXCEPTION.value,
+        }
+        for status, _, _ in recorder.messages
+    )
 
 
 @pytest.mark.asyncio
@@ -78,6 +104,15 @@ async def test_targz_structure_accepts_src_suffix_variant(tmp_path: pathlib.Path
         await targz.structure(args)
 
     assert any(status == sql.CheckResultStatus.NOTE.value for status, _, _ in recorder.messages)
+    assert not any(
+        status
+        in {
+            sql.CheckResultStatus.CONCERN.value,
+            sql.CheckResultStatus.SUGGESTION.value,
+            sql.CheckResultStatus.EXCEPTION.value,
+        }
+        for status, _, _ in recorder.messages
+    )
 
 
 @pytest.mark.asyncio
@@ -87,7 +122,8 @@ async def test_targz_structure_fails_when_cache_unavailable(tmp_path: pathlib.Pa
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=None)):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.EXCEPTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
     assert any("extracted archive tree is not available" in message.lower() for _, message, _ in recorder.messages)
 
 
@@ -105,7 +141,8 @@ async def test_targz_structure_rejects_npm_pack_filename_mismatch(tmp_path: path
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.SUGGESTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
     assert any("npm pack layout detected" in message for _, message, _ in recorder.messages)
 
 
@@ -122,7 +159,8 @@ async def test_targz_structure_rejects_package_root_without_package_json(tmp_pat
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.SUGGESTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
 
 
 @pytest.mark.asyncio
@@ -133,7 +171,8 @@ async def test_targz_structure_rejects_source_root_when_filename_has_no_suffix(t
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.SUGGESTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
 
 
 @pytest.mark.asyncio
@@ -144,7 +183,8 @@ async def test_targz_structure_rejects_source_root_when_filename_has_src_suffix(
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.SUGGESTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
 
 
 @pytest.mark.asyncio
@@ -155,7 +195,8 @@ async def test_targz_structure_rejects_src_root_when_filename_has_no_suffix(tmp_
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.SUGGESTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
 
 
 @pytest.mark.asyncio
@@ -166,7 +207,8 @@ async def test_targz_structure_rejects_src_root_when_filename_has_source_suffix(
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.SUGGESTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
 
 
 @pytest.mark.asyncio
@@ -179,7 +221,8 @@ async def test_targz_structure_rejects_symlink_root(tmp_path: pathlib.Path) -> N
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.EXCEPTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
 
 
 @pytest.mark.asyncio
@@ -197,7 +240,8 @@ async def test_targz_structure_rejects_symlinked_package_json(tmp_path: pathlib.
     with mock.patch.object(checks, "resolve_archive_dir", new=mock.AsyncMock(return_value=safe.StatePath(cache_dir))):
         await targz.structure(args)
 
-    assert any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
+    assert any(status == sql.CheckResultStatus.EXCEPTION.value for status, _, _ in recorder.messages)
+    assert not any(status == sql.CheckResultStatus.CONCERN.value for status, _, _ in recorder.messages)
 
 
 def test_zipformat_structure_accepts_bin_suffix_variant(tmp_path: pathlib.Path) -> None:


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