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

FrankChen021 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new d2560d236e8 Flag stale libraries in current licenses.yaml entries 
(#20791)
d2560d236e8 is described below

commit d2560d236e895766600fa5449a1bfc2f659278bf
Author: Andreas Maechler <[email protected]>
AuthorDate: Tue Nov 3 20:07:20 2026 -0600

    Flag stale libraries in current licenses.yaml entries (#20791)
---
 dev/license.md                               |  3 ++-
 distribution/asf-release-process-guide.md    |  2 +-
 distribution/bin/refresh-license-versions.py |  3 +++
 distribution/bin/test_check_licenses.py      | 17 +++++++++++++++++
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/dev/license.md b/dev/license.md
index c9907d345a6..e439e14ffa2 100644
--- a/dev/license.md
+++ b/dev/license.md
@@ -128,7 +128,8 @@ When you update the version of existing dependencies, you 
need to update the ver
 also in the `licenses.yaml` file.
 
 `distribution/bin/refresh-license-versions.py` makes that edit from the Maven 
dependency reports, and lists the entries
-it cannot update on its own, such as an entry whose libraries moved to 
different versions:
+it cannot update on its own, such as an entry whose libraries moved to 
different versions. It also lists libraries that
+appear in no report while the rest of their entry ships at the entry's 
version, so you can remove them:
 
 ```
 distribution/bin/generate-license-dependency-reports.py . target 
--clean-maven-artifact-transfer --parallel 2
diff --git a/distribution/asf-release-process-guide.md 
b/distribution/asf-release-process-guide.md
index 757725925ac..3173831ff2a 100644
--- a/distribution/asf-release-process-guide.md
+++ b/distribution/asf-release-process-guide.md
@@ -329,7 +329,7 @@ These additional tools were largely used to bootstrap the 
initial `LICENSE`, `LI
 | --- | --- |
 | 
[generate-license-dependency-reports](bin/generate-license-dependency-reports.py)
 | Point this to the Druid source root, and give it the location of a temp 
scratch directory, and it will output Maven dependency reports for Druid. |
 | [check-licenses](bin/check-licenses.py) | Checks `licenses.yaml` against the 
output of `generate-license-dependency-reports.py`, used by `-Papache-release` 
when building distribution, to verify that all dependencies are present and 
match the versions in `licenses.yaml`, and that every `license_file_path` 
exists and every file in `licenses/bin` is referenced. |
-| [refresh-license-versions](bin/refresh-license-versions.py) | Updates the 
`version` of each `licenses.yaml` entry whose libraries moved to a new version 
in the output of `generate-license-dependency-reports.py`, and lists the 
entries that need a manual edit, such as an entry whose libraries moved to 
different versions. Use `--dry-run` to only print the changes. |
+| [refresh-license-versions](bin/refresh-license-versions.py) | Updates the 
`version` of each `licenses.yaml` entry whose libraries moved to a new version 
in the output of `generate-license-dependency-reports.py`, and lists the 
entries that need a manual edit, such as an entry whose libraries moved to 
different versions or a current entry that lists a library no report contains. 
Use `--dry-run` to only print the changes. |
 | [jar-notice-lister](bin/jar-notice-lister.py) | Point this to an extracted 
Druid binary distribution, and give it a temp scratch directory, and it will 
output NOTICE information for all the Druid JAR files. |
 
 
diff --git a/distribution/bin/refresh-license-versions.py 
b/distribution/bin/refresh-license-versions.py
index 46e450e16b0..145884886e4 100755
--- a/distribution/bin/refresh-license-versions.py
+++ b/distribution/bin/refresh-license-versions.py
@@ -141,6 +141,9 @@ def refresh_versions(text, reported_modules):
                 problems.append("{} are in no report; update or remove them by 
hand".format(", ".join(unreported)))
             elif claimed:
                 problems.append("{} ship only at versions other entries 
register; remove them by hand".format(", ".join(claimed)))
+        elif current and unreported:
+            # Other libraries ship at the entry's version, so these left the 
release.
+            problems.append("{} are in no report; remove them by 
hand".format(", ".join(unreported)))
         if problems:
             flagged.append((entry.name, entry.module, "; ".join(problems)))
         elif moved_to:
diff --git a/distribution/bin/test_check_licenses.py 
b/distribution/bin/test_check_licenses.py
index 1859b13acb5..7a2750b362e 100755
--- a/distribution/bin/test_check_licenses.py
+++ b/distribution/bin/test_check_licenses.py
@@ -284,6 +284,23 @@ class RefreshVersionsTest(unittest.TestCase):
         text = licenses_yaml(entry("Kotlin jdk8", "java-core", "1.8.21", 
["org.k: stdlib", "org.k: stdlib-jdk8"]))
         self.assertFlagged(1, text, reports(("org.k:stdlib:2.4.21", 
"java-core")))
 
+    def test_flags_current_entries_with_libraries_in_no_report(self):
+        text = licenses_yaml(entry("fastutil", "java-core", "8.5.19", 
["it.unimi.dsi: fastutil", "it.unimi.dsi: fastutil-core"]))
+        _, updated, flagged = self.refresh(text, 
reports(("it.unimi.dsi:fastutil:8.5.19", "java-core")))
+        self.assertEqual([], updated)
+        self.assertEqual([("fastutil", "java-core", 
"it.unimi.dsi:fastutil-core are in no report; remove them by hand")], flagged)
+
+    def test_leaves_entries_with_no_reported_library_to_check_licenses(self):
+        text = licenses_yaml(entry("Gone", "java-core", "1.0", ["org.gone: a", 
"org.gone: b"]))
+        self.assertEqual((text, [], []), self.refresh(text, 
reports(("org.other:x:1.0", "java-core"))))
+
+    def test_leaves_stale_entries_to_check_licenses(self):
+        text = licenses_yaml(
+            entry("Kerby", "java-core", "1.0.1", ["org.kerby: kerb-core", 
"org.kerby: kerb-admin"]),
+            entry("Kerby", "java-core", "2.0.3", ["org.kerby: kerb-core"]),
+        )
+        self.assertEqual((text, [], []), self.refresh(text, 
reports(("org.kerby:kerb-core:2.0.3", "java-core"))))
+
     def test_flags_moved_entries_with_libraries_another_entry_registers(self):
         text = licenses_yaml(
             entry("Family", "java-core", "1.0.0", ["org.f: a", "org.f: b"]),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to