feat: auto-generate distribution LICENSE files and normalize license names to SPDX identifiers - #8194
Open
xuxiaowei-com-cn wants to merge 22 commits into
Open
feat: auto-generate distribution LICENSE files and normalize license names to SPDX identifiers#8194xuxiaowei-com-cn wants to merge 22 commits into
xuxiaowei-com-cn wants to merge 22 commits into
Conversation
- Fix typo: '(properties)' → '(i)' in section 1 definition of 'control' - Add trailing newline at end of file https://www.apache.org/licenses/LICENSE-2.0.txt
- Add generate-license.py script that uses license-eye to resolve Maven/npm dependencies and generate ASF-compliant LICENSE files - Add generate-license.sh as a shell wrapper for the Python script - Add .licenserc-namingserver.yaml and .licenserc-server.yaml for module-specific license header checks and dependency resolution - Add make targets: generate-license-all, generate-license-namingserver, generate-license-server - Regenerate LICENSE-namingserver and LICENSE-server with updated dependency versions and sorted license groups - Fix typo in Apache License 2.0 text (properties -> i)
…ides - Add license overrides for newly introduced dependencies in generate-license.py (jackson-dataformat-yaml, jackson-module-jsonSchema, victools:jsonschema-generator, jraft-core, zookeeper, ant, xstream, dexx-collections, antlr-runtime) - Add BSD license category to LICENSE_ORDER - Regenerate distribution LICENSE-namingserver and LICENSE-server - Remove platform-specific libc fields in console-fe package-lock.json
…py and regenerate LICENSE files - Add comprehensive LICENSE_NORMALIZE mapping for URL/text variants to SPDX identifiers - Regenerate distribution/LICENSE-namingserver and LICENSE-server with proper grouping - Move dependencies from raw URL sections into correct SPDX-identified categories - Add new license sections: Apache-1.1, MPL-1.1, WTFPL to LICENSE_ORDER
…to SPDX identifiers - Add .licenserc-distribution.yaml for distribution module license checks - Add generate-license-distribution Makefile target and shell script support - Regenerate distribution/LICENSE and distribution/LICENSE-server with updated dependencies (Spring Boot 4.0.6, Netty 4.2.12, Tomcat 11.x, etc.) - Normalize all license names to SPDX standard identifiers - Add new license categories: 0BSD, CC0-1.0, CC-BY-4.0, LGPL-2.1
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #8194 +/- ##
============================================
- Coverage 73.30% 73.20% -0.11%
- Complexity 1142 1146 +4
============================================
Files 1153 1153
Lines 42340 42340
Branches 5058 5058
============================================
- Hits 31037 30994 -43
- Misses 8821 8863 +42
- Partials 2482 2483 +1 🚀 New features to boost your workflow:
|
- Add Maven build step to generate license-related files - Add license file generation step (generate-license.sh) - Add check for uncommitted changes after Maven build - Add license diff artifact upload for debugging - Add check for outdated distribution LICENSE files - Improve step comments for clarity
…fication - Split single job into check-license-header and check-license-files - Add Go and Java JDK 25 setup for license file generation - Add Maven repository cache (restore + save) to speed up builds - Rename diff artifact from .patch to .diff for consistency - Add helpful guidance in error message for fixing license issues locally
Add install-only and install Makefile targets. Set install-only as a prerequisite for generate-license-* targets so the project is installed to the local Maven repository before the LICENSE generation script runs. Also update .PHONY declarations to include all targets.
2 tasks
Add --strict option to generate-license.py that treats unknown licenses as errors (exit 1) instead of just printing a warning. Expose it via the Makefile as LICENSE_STRICT=1 for use in CI pipelines. Changes: - generate-license.py: add --strict CLI flag and strict parameter to generate_license_file(), exit 1 when unknown licenses found in strict mode - generate-license.sh: pass all arguments through to Python script via "$@" - Makefile: add LICENSE_STRICT variable with usage comments, pass --strict flag to generate-license.sh when enabled Usage: make generate-license-namingserver LICENSE_STRICT=1
This reverts commit 17e81a6.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
This PR introduces auto-generation of
distribution/LICENSE files using Apache SkyWalking Eyes (license-eye), replacing the previous manually-maintained approach. It also normalizes license names to SPDX identifiers and corrects the rootLICENSEfile.Problems solved:
Unverifiable / unreproducible — Previously, LICENSE files were manually edited with no way to verify correctness against actual build dependencies. Now they are generated by
license-eyefrom the project's Maven/npm dependency graph, making them fully reproducible.Unsorted entries — Dependencies within each license section were not alphabetically sorted, making review and maintenance difficult. The auto-generation enforces consistent alphabetical ordering.
Inconsistent across files — The three LICENSE files had different section orders and formatting styles. Now all three follow the same consistent format.
Changes:
.licenserc-distribution.yaml.licenserc-namingserver.yaml.licenserc-server.yaml.github/workflows/license-checker.yamlcheck-license-header(existing license header + dependency check) andcheck-license-files(new — builds, generates LICENSE files, verifies they are up to date, and uploads a diff artifact on failure).gitignore__pycache__/to prevent Python bytecode cache from being committedscript/license/generate-license.pyscript/license/generate-license.shMakefilegenerate-license-all,generate-license-namingserver,generate-license-server,generate-license-distributiontargetsLICENSEchanges/en-us/2.x.mdchanges/zh-cn/2.x.mddistribution/console/src/main/resources/static/console-fe/package-lock.jsondistribution/LICENSEdistribution/LICENSE-namingserverdistribution/LICENSE-serverKey features of the generation tooling:
LICENSE_OVERRIDES) for 17 dependencies whose licenses cannot be auto-resolvedLICENSE_NORMALIZE) covering 20+ URL/text variantsDISTRIBUTION_EXTRA_ENTRIESthat license-eye cannot resolvecheck-license-filesCI job that:generate-license.sh alllicense-diff.diffartifact on failure for easy patchingⅡ. Does this pull request fix one issue?
Fixes #8193
Ⅲ. Why don't you add test cases (unit test/integration test)?
This change primarily introduces build/generation tooling and static LICENSE files. The verification mechanism is built into the tooling itself:
make generate-license-all(or./script/license/generate-license.sh all) on the same source should produce identical output; any diff indicates drift.Ⅳ. Describe how to verify it
Prerequisites:
Verify LICENSE files are correctly generated:
Manual inspection:
distribution/LICENSE,distribution/LICENSE-namingserver,distribution/LICENSE-serverLICENSEmatches the official Apache License 2.0 textⅤ. Special notes for reviews
__pycache__cleanup: Thescript/license/__pycache__/generate-license.cpython-314.pycfile was accidentally included in an earlier commit and has been removed..gitignorehas been updated with__pycache__/to prevent future recurrence.package-lock.json: Thedistribution/console/src/main/resources/static/console-fe/package-lock.jsonfile was added — this contains the resolved npm dependency tree for the console frontend. It is checked in intentionally to ensure reproducible builds and is required by license-eye for npm dependency resolution.License name normalization: License names have been changed to SPDX identifiers throughout. For example:
This aligns with ASF best practices and makes the files machine-readable.
License overrides:
generate-license.pyincludes a manual override map.Future work: