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

the-other-tim-brown pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-xtable.git


The following commit(s) were added to refs/heads/main by this push:
     new 1833d3f9 fix: validate that every shade include exists in the runtime 
dependency tree (#971)
1833d3f9 is described below

commit 1833d3f933366220c5b8a82fe41b6708fd86eec5
Author: Shreehitha Arushan <[email protected]>
AuthorDate: Tue Oct 27 05:28:12 2026 +0530

    fix: validate that every shade include exists in the runtime dependency 
tree (#971)
    
    Co-authored-by: Tim Brown <[email protected]>
---
 release/scripts/validate_bundled_license_texts.py | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/release/scripts/validate_bundled_license_texts.py 
b/release/scripts/validate_bundled_license_texts.py
index 905d7528..02b17955 100644
--- a/release/scripts/validate_bundled_license_texts.py
+++ b/release/scripts/validate_bundled_license_texts.py
@@ -247,7 +247,13 @@ def check(module: pathlib.Path, jar_path: pathlib.Path) -> 
dict[str, list]:
     texts = {entry.split("/")[-1] for entry in names if 
entry.startswith("META-INF/licenses/LICENSE-")}
     includes = shade_includes(module / "pom.xml")
 
-    result: dict[str, list] = {"missing": [], "mismatched": [], "unresolved": 
[], "partial": []}
+    result: dict[str, list] = {
+        "missing": [],
+        "mismatched": [],
+        "unresolved": [],
+        "partial": [],
+        "stale_includes": [],
+    }
     bundled = []
     for group, artifact, version, classifier in tree_coords(tree):
         if group == "org.apache.xtable" or f"{group}:{artifact}" not in 
includes:
@@ -285,6 +291,16 @@ def check(module: pathlib.Path, jar_path: pathlib.Path) -> 
dict[str, list]:
         if reason and artifact not in KNOWN_TEXT_MISMATCHES:
             result["mismatched"].append(f"{coord}  ({reason})")
 
+    # Reverse check: every shade <include> must still exist in the runtime 
tree.
+    # This catches stale includes that silently shrink the bundle.
+    tree_artifacts = {f"{g}:{a}" for g, a, v, c in tree_coords(tree)}
+    stale = sorted(includes - tree_artifacts)
+    if stale:
+        result["stale_includes"] = [
+            f"{inc}  (present in shade <includes> but missing from runtime 
dependency tree)"
+            for inc in stale
+        ]
+
     result["orphaned"] = sorted(texts - {f"LICENSE-{artifact}" for artifact in 
bundled})
     result["count"] = len(bundled)
     return result
@@ -296,6 +312,7 @@ REPORTS = [
     ("orphaned", "license texts with no bundled non-Apache-2.0 dependency"),
     ("partial", "dependencies only partly present, so they cannot be 
classified"),
     ("unresolved", "dependencies that could not be resolved or have no 
license"),
+    ("stale_includes", "shade <include> entries that no longer exist in the 
runtime dependency tree"),
 ]
 
 

Reply via email to