xuxiaowei-com-cn opened a new issue, #8193:
URL: https://github.com/apache/incubator-seata/issues/8193

   ### Check Ahead
   
   - [x] I have searched the [issues](https://github.com/seata/seata/issues) of 
this repository and believe that this is not a duplicate.
   
   - [x] I am willing to try to fix this bug myself.
   
   
   ### Ⅰ. Issue Description
   
   
   The `distribution/` directory contains three LICENSE files:
   
   - `distribution/LICENSE`
   - `distribution/LICENSE-namingserver`
   - `distribution/LICENSE-server`
   
   These files are currently **manually maintained** without a unified 
generation standard, leading to the following problems:
   
   1. **Cannot be verified/reproduced** — Different people editing these files 
by hand results in inconsistent formats. There is no automated way to verify 
that the listed dependencies match the actual build dependencies, or that all 
transitive dependencies are included. When dependencies are upgraded or added, 
the LICENSE files may not be updated consistently.
   
   2. **Not sorted by rules (e.g., by name)** — License sections and dependency 
entries within each section are not alphabetically sorted, making it difficult 
to:
      - Find a specific dependency
      - Review changes in diffs
      - Maintain the files without introducing duplicates or missing entries
   
   3. **Inconsistent across the three files** — For example:
      - `LICENSE` — dependencies are not sorted by name, making the file 
disorganized
      - `LICENSE-namingserver` — same as above
      - `LICENSE-server` — same as above
   
   
   ### Ⅱ. Describe what happened
   
   When a developer adds or upgrades a dependency, they must manually update 
one or more of these LICENSE files. Because:
   
   - There's no documented procedure for which dependencies go in which LICENSE 
file
   - There's no tool to validate that all dependencies are covered
   - There's no enforced sorting convention
   - The relationship between build dependencies and LICENSE entries is not 
traceable
   
   ...the resulting files become inconsistent over time, and PR reviews cannot 
easily verify the correctness of LICENSE changes.
   
   
   ### Ⅲ. Describe what you expected to happen
   
   All three LICENSE files should be **auto-generated** by a standard tool, 
ensuring:
   
   1. Dependencies are automatically extracted from the build configuration 
(e.g., `pom.xml`, `package.json`)
   2. License information is resolved from SPDX or project metadata
   3. Entries are sorted consistently (e.g., alphabetically by artifact name 
within each license category)
   4. The generation is reproducible — running the same tool on the same source 
produces the same output
   5. CI can verify that the committed LICENSE files match the auto-generated 
ones (e.g., via a CI check)
   
   
   ### Ⅳ. How to reproduce it (as minimally and precisely as possible)
   
   
   1. Check out the current codebase on the `2.x` branch
   2. Look at `distribution/LICENSE`, `distribution/LICENSE-namingserver`, 
`distribution/LICENSE-server`
   3. Observe that:
      - License sections are in different orders across the three files
      - Dependencies within each section are not alphabetically sorted
      - There is no tool/script to regenerate them
   
   Example of unsorted entries in `distribution/LICENSE-server` MIT section:
   
   ```
   org.checkerframework:checker-qual 3.37.0 MIT see:licenses/checker-qual-MIT
   redis.clients:jedis 3.8.0 MIT see:licenses/jedis-MIT
   org.slf4j:jul-to-slf4j 1.7.36 MIT see:licenses/jul-to-slf4j-MIT
   org.slf4j:slf4j-api 1.7.36 MIT see:licenses/slf4j-api-MIT
   com.github.andrewoma.dexx:dexx-collections 0.2 MIT 
see:licenses/dexx-collections-MIT
   ```
   
   
   ### Ⅴ. Anything else we need to know?
   
   
   Use **[Apache SkyWalking Eyes 
(license-eye)](https://github.com/apache/skywalking-eyes/)** to auto-generate 
all LICENSE files.
   
   **Key benefits:**
   
   | Aspect          | Current (Manual)  | Proposed (license-eye)            |
   |-----------------|-------------------|-----------------------------------|
   | Generation      | Manual editing    | `license-eye` — one command       |
   | Verification    | No way to verify  | `license-eye` — CI-friendly       |
   | Sorting         | Ad-hoc            | Consistent alphabetical ordering  |
   | Reproducibility | Not reproducible  | Fully reproducible                |
   | Maintenance     | Error-prone       | Automated with dependency changes |
   
   **Suggested steps:**
   
   1. Add a `.licenserc.yaml` configuration file at the project root, defining:
      - Which dependencies to include/exclude
      - Output paths for each LICENSE file (main, namingserver, server)
      - Sorting and formatting rules
   2. Regenerate all three LICENSE files using `license-eye generate header`
   3. Add a CI check using `license-eye check` to ensure future changes stay 
consistent
   4. Document the process in the contributor guide
   
   
   ### Ⅵ. Environment
   
   
   - Seata version: 2.x branch
   - Branch: `2.x`
   - OS: macOS / Linux (any)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to