build: add script to refresh licenses.yaml versions #20736
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 553 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.378
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20736"
general
weight: 0.35
amaechler
Part of #20732.
Description
licenses.yamlrecords an exact version for every bundled dependency, so every dependency bump needs a hand edit beforecheck-licenses.pypasses. This PR addsdistribution/bin/refresh-license-versions.py, which makes that edit from the same Maven dependency reportscheck-licenses.pyreads. It is the firstlicenses.yamlitem in #20732. It can be run on a Dependabot branch today, and the release-time step builds on it.What it changes
For each entry with
libraries, it looks up each library in the report of the entry's own module, or in the other modules' reports when its own module does not ship that library (thejava-core"AWS SDK for Java 2" entry, for example, listskinesis, which onlydruid-kinesis-indexing-serviceships). When all libraries of the entry moved to the same new version, it rewrites that entry'sversion:line. Nothing else in the file changes, so comments, ordering andnoticeblocks stay byte-identical. The new value keeps the old quotes, and gets quotes when YAML would otherwise read it as a number (2.22).A version that another entry of the same module registers is never taken, so a stale entry such as
jakarta.activation-api1.2.2 injava-corestays as it is instead of moving onto the 2.1.4 that the current entry registers. When that library is bumped, both entries would move to the new version, so both are listed for a manual edit until the stale one is removed. The same library in different modules (for example PostgreSQL in three extensions) is updated in each.Entries with
skip_dependency_report_check,web-consoleentries andextensions-contrib/entries are skipped, since no report covers them.What it leaves for a person
It prints these entries instead of guessing, and exits non-zero:
Shared report reading
The loop that reads the dependency reports moves out of
check_licenses()intoread_dependency_reports()incheck-licenses.py, so both scripts use it.check-licenses.pybehaves as before.How it was checked
test_check_licenses.py, which theapache-releasebuild already runs.- Replay of recent Dependabot PRs: I took
licenses.yamlas it was at three earlier commits and compared the script's output with the version edits that were made by hand since.- From #20707's version: the same 3 edits (#20699, #20703).
- From #20673's version: the same 8 edits.
- From #20671's version: the same 16 edits, including the Google entries realigned in #20673.
- Each replay also fixes the 6 entries of existing drift described below. The #20673 and #20671 replays list the "Jetbrains jdk7 jdk 8" entry for a manual edit, because three of its libraries are in no report.
- On the #20707 version,
check-licenses.pygoes from 15 missing licenses to passing after the refresh.- Current master: it updates 6 entries and lists 4. These are existing per-module drift that
check-licenses.pydoes not catch, since it matches versions across all modules (for exampleProtocol Buffersinjava-coreregistered at 4.36.0 whilejava-coreships 4.36.2). This PR does not changelicenses.yaml; #20737 fixes that drift.<hr>
This PR has: