Skip to content

ANALYZERS-74 - License packaging standard#104

Open
rombirli wants to merge 8 commits intomasterfrom
rombirli/license-packaging-standard
Open

ANALYZERS-74 - License packaging standard#104
rombirli wants to merge 8 commits intomasterfrom
rombirli/license-packaging-standard

Conversation

@rombirli
Copy link
Contributor

@rombirli rombirli commented Mar 3, 2026

No description provided.

@hashicorp-vault-sonar-prod
Copy link

hashicorp-vault-sonar-prod bot commented Mar 3, 2026

ANALYZERS-74

@rombirli rombirli marked this pull request as ready for review March 3, 2026 13:40
@rombirli rombirli marked this pull request as draft March 3, 2026 14:21
@rombirli
Copy link
Contributor Author

rombirli commented Mar 3, 2026

Need to fix spotless (license header in kotlin files)
DONE✅

@rombirli rombirli marked this pull request as ready for review March 3, 2026 14:46
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
package org.sonarsource.ruby.gradle

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package is correctly named org.sonarsource.ruby.gradle, however the files are located in a folder named org/sonarsource/scala/gradle.

@rombirli rombirli marked this pull request as draft March 5, 2026 07:17
@rombirli rombirli force-pushed the rombirli/license-packaging-standard branch from 013274c to 87f02cf Compare March 6, 2026 08:02
@sonarqube-next
Copy link

sonarqube-next bot commented Mar 6, 2026

@rombirli rombirli force-pushed the rombirli/license-packaging-standard branch from fc4e7dd to 91564bd Compare March 16, 2026 13:59
@rombirli rombirli marked this pull request as ready for review March 19, 2026 15:51
@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 19, 2026

Summary

Implements SONAR license packaging standard by integrating a cloud-native license file generator plugin. Renames the root LICENSE file to LICENSE.txt, adds a new build-logic/common submodule containing shared Gradle plugins, and automatically generates/packages license files (main + third-party) into the plugin distribution. Workflow improvements make submodule initialization explicit and conditional based on test suite.

What reviewers should know

Start with sonar-ruby-plugin/build.gradle to see the new license file generator plugin integration and configuration. The root LICENSE.txt rename is straightforward. The build-logic/common submodule is a new dependency that provides the license generation capability. Third-party license files in resources/licenses/THIRD_PARTY_LICENSES/ are generated automatically by the plugin—they're not manually added. Workflow changes in build.yml are infrastructure only: switching from conditional submodule cloning to explicit initialization steps.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@rombirli rombirli marked this pull request as draft March 19, 2026 15:51
@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 19, 2026

Summary

Implements SonarSource license packaging standard by restructuring license files and improving submodule management. Renames LICENSE to LICENSE.txt, adds LICENSE_HEADER template for copyright notices, and includes third-party license documentation. Updates GitHub workflows to explicitly initialize required git submodules—build-logic/common (shared build logic) for all jobs and its/sources (test sources) only for ruling tests.

What reviewers should know

Start with .gitmodules to see the new build-logic/common submodule configuration. Then review the .github/workflows/build.yml changes to understand the new explicit submodule initialization strategy (replacing the previous conditional approach). The LICENSE restructuring is straightforward: LICENSE → LICENSE.txt, plus new license header and third-party license files in sonar-ruby-plugin/src/main/resources/licenses/. Non-obvious: build-logic/common is required for all jobs (build and QA), while its/sources is conditionally initialized only for ruling tests. This is a large bulk commit but most files are new; watch for whether the submodule initialization pattern is consistent across all workflow files.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 19, 2026

Summary

Implements license packaging standard (ANALYZERS-74) by adding automated license file generation. Adds a new shared Gradle plugin (build-logic/common) to handle license packaging, updates CI/CD to explicitly initialize submodules, and renames the root LICENSE file to LICENSE.txt. License files (main + third-party) are now generated and packaged with the plugin.

What reviewers should know

Start by reviewing settings.gradle to understand how the new plugin is included. Then check sonar-ruby-plugin/build.gradle to see the license-file-generator plugin configuration and how licenseGenerationConfig points to the LICENSE.txt file. The .github/workflows/build.yml changes replace dynamic submodule initialization with explicit git commands for better control. The license files in sonar-ruby-plugin/src/main/resources/licenses/ are auto-generated by the plugin. Key consideration: this adds a new external dependency (build-logic/common submodule) - verify the integration doesn't break local builds.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion

Clean mechanical PR with one content issue worth verifying before merge.

🗣️ Give feedback

@@ -0,0 +1,7 @@
Copyright <YEAR> <COPYRIGHT HOLDER>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright line contains unfilled template placeholders (<YEAR> and <COPYRIGHT HOLDER>). If this was generated automatically from the upstream library's own LICENSE file, then that upstream file has the same problem and this should be corrected manually — a license file with unfilled placeholders does not constitute valid attribution. The actual copyright holder is EclipseSource and the year should be filled in (check the library's repository or Maven POM for the correct values).

  • Mark as noise

@rombirli rombirli marked this pull request as ready for review March 20, 2026 07:33
@sonar-review-alpha
Copy link

sonar-review-alpha bot commented Mar 20, 2026

Summary

Adopt standardized license packaging by integrating SonarSource's cloud-native-gradle-modules for consistent license metadata handling. Adds override for jsr305 dependency to correctly declare its BSD-3 license, and updates CI/CD workflows to properly initialize shared build logic.

What reviewers should know

Key changes to review:

  1. Submodule addition (.gitmodules): New build-logic/common submodule referencing SonarSource's shared gradle modules repo. The CI/CD workflows (build.yml) explicitly initialize this submodule instead of relying on the deprecated submodules: true checkout option.

  2. License configuration (sonar-ruby-plugin/build.gradle): Uses the org.sonarsource.cloud-native.license-file-generator plugin. The critical line is dependencyLicenseOverrides.put("com.google.code.findbugs:jsr305", ...) which corrects the license metadata for jsr305 from its default (incorrect) declaration to BSD-3.

  3. File rename: LICENSE → LICENSE.txt is referenced in the licenseGenerationConfig as projectLicenseFile.

  4. CI/CD modernization: Workflows now use explicit git submodule update --init commands with conditional logic for ruling tests (only initializes its/sources when needed) rather than the old submodules: true approach. This is more explicit and avoids unnecessary clone operations.

Start here: Review the license override logic in sonar-ruby-plugin/build.gradle around line 8-11 to understand the intent. Then check the build.yml workflow changes to confirm submodule initialization is correct for your CI environment.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

@rombirli
Copy link
Contributor Author

LICENSE FOR com.google.code.findbugs:jsr305

Similar to https://github.com/SonarSource/slang-enterprise/pull/597#issuecomment-4066470277

@sonarqube-next
Copy link

Copy link

@sonar-review-alpha sonar-review-alpha bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion: The CI and Gradle changes are clean, but the generated license file for jsr305 was committed with unfilled placeholders — that's the core deliverable of this PR and it needs to be corrected before merge.

🗣️ Give feedback

@@ -0,0 +1,11 @@
Copyright <YEAR> <COPYRIGHT HOLDER>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BSD-3 license text here has literal <YEAR> and <COPYRIGHT HOLDER> placeholders that were never substituted. The whole point of this PR is to ship the correct license attribution for jsr305, so this file needs the actual copyright year and holder filled in. For jsr305 / JSR-305 annotations, the copyright holder is Google Inc. and the relevant year is 2007 (the original release). If this file is auto-generated by the license-file-generator plugin from the BSD-3.txt template in build-logic/common, that template itself contains the unfilled placeholders — verify whether the plugin is expected to substitute them at build time, or whether the override file needs to be provided with the values already filled in.

  • Mark as noise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants