Renovate build, dependencies and CI; emit CycloneDX SBOM - #24
Open
tonit wants to merge 1 commit into
Open
Conversation
Modernises the toolchain for CVE hygiene and makes the project usable as a DependencyTrack input. Build: - Target Java 17 via maven.compiler.release (source/target 1.8 is deprecated on current JDKs). - JUnit 4.12 -> 6.1.3 via junit-bom, resolving CVE-2020-15250. - slf4j-simple 1.6.1 -> 2.0.18. - Refresh compiler (3.15.0) and surefire (3.5.6) plugins. - Add maven-enforcer-plugin: require Maven 3.9+/JDK 17+, dependency convergence, no SNAPSHOT dependencies. - Set project.build.outputTimestamp so the jar is reproducible. SBOM: - Add cyclonedx-maven-plugin, emitting CycloneDX 1.6 to target/bom.json and target/bom.xml on every package. - includeTestScope is enabled deliberately: every dependency here is test-scope, so the default configuration would emit an empty BOM. Tests: - Migrate all 8 test classes to JUnit Jupiter. @ignore -> @disabled, @test(expected=) -> assertThrows, and assertion messages moved to the trailing argument. Two-argument assertions whose first argument is an expected hash value are left alone. Test counts are unchanged. CI: - Replace the duplicated maven.yml and maven-build.yml with a single build.yml running a JDK 17/21 matrix. - Publish the SBOM as a workflow artifact and push it to DependencyTrack when DEPENDENCYTRACK_URL and DEPENDENCYTRACK_API_KEY are configured; the step is skipped otherwise. - linter.yml now triggers on pull requests instead of being manual-only, scoped to YAML and workflow files. - Pin every action to a full commit SHA and add dependabot config to keep those pins current. - Apply least-privilege permissions to all jobs. Removals: - build.gradle: published to Bintray, shut down in 2021. - gradle/wrapper/gradle-wrapper.jar: orphaned binary, no gradlew present. - .travis.yml and .gitpod.*: both dead. - bnd.bnd: unused since the move to Maven, so the jar has not carried OSGi headers for some time. The README claims to match are removed.
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project’s Maven/CI toolchain for improved dependency hygiene, upgrades tests to JUnit Jupiter, and adds automatic CycloneDX SBOM generation + publication plumbing for DependencyTrack.
Changes:
- Upgrade build to Java 17+, modern Maven plugins, and JUnit Jupiter; migrate test sources accordingly.
- Generate CycloneDX 1.6 SBOM on every Maven
packageand upload it as a CI artifact. - Simplify/modernize GitHub Actions workflows (matrix build, SHA-pinned actions, Dependabot for pins, lint-on-PR), and remove legacy/unused build/CI files.
Reviewed changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/org/rebaze/integrity/tree/internal/operators/UnionTreeCombinerTest.java | Migrates JUnit 4 annotations/assertions to JUnit Jupiter and replaces expected= with assertThrows. |
| src/test/java/org/rebaze/integrity/tree/internal/operators/DiffTreeCombinatorTest.java | Migrates assertions to JUnit Jupiter and reorders assertion message arguments. |
| src/test/java/org/rebaze/integrity/tree/internal/operators/CombinatorIntegrityTest.java | Migrates JUnit 4 @Ignore/asserts to JUnit Jupiter equivalents. |
| src/test/java/org/rebaze/integrity/tree/internal/InMemoryTreeImplTest.java | Migrates static assertions/imports to JUnit Jupiter. |
| src/test/java/org/rebaze/integrity/tree/internal/DefaultHashTest.java | Migrates to JUnit Jupiter, converts expected= tests to assertThrows, adjusts assertion message placement. |
| src/test/java/org/rebaze/integrity/tree/core/TreeIndexTest.java | Migrates assertions/imports to JUnit Jupiter and updates assert message ordering. |
| src/test/java/org/rebaze/integrity/tree/core/SimpleHashTest.java | Migrates assertions to JUnit Jupiter and updates assert message ordering. |
| src/test/java/org/rebaze/integrity/tree/core/BranchHashTest.java | Migrates JUnit 4 @Test/assertions to JUnit Jupiter. |
| README.md | Updates badges, removes inaccurate OSGi claims, and documents JDK17+/SBOM/DependencyTrack behavior. |
| pom.xml | Moves to Java 17, upgrades plugins/deps, adds enforcer rules, and configures CycloneDX SBOM generation. |
| build.gradle | Removes legacy Gradle/Bintray build configuration. |
| bnd.bnd | Removes unused OSGi/bnd metadata file. |
| .travis.yml | Removes legacy Travis CI config. |
| .gitpod.yml | Removes legacy Gitpod config. |
| .gitpod.Dockerfile | Removes legacy Gitpod Dockerfile. |
| .gitignore | Removes Gradle-specific ignore entries now that Gradle is removed. |
| .github/workflows/maven.yml | Removes duplicate legacy Maven workflow (JDK 1.8-era). |
| .github/workflows/maven-build.yml | Removes duplicate Maven workflow (replaced by matrix build). |
| .github/workflows/linter.yml | Enables lint workflow on PRs and pins actions to SHAs with scoped validation. |
| .github/workflows/build.yml | Adds consolidated matrix build, SBOM artifact upload, and DependencyTrack upload job. |
| .github/dependabot.yml | Adds Dependabot config to keep GitHub Actions SHA pins and Maven deps updated. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+81
to
+89
| - name: Not configured | ||
| if: env.DTRACK_URL == '' | ||
| run: | | ||
| echo "::notice::DEPENDENCYTRACK_URL is not set - skipping upload." \ | ||
| "Add the DEPENDENCYTRACK_URL and DEPENDENCYTRACK_API_KEY repository secrets to enable it." | ||
|
|
||
| - name: Upload BOM | ||
| if: env.DTRACK_URL != '' | ||
| run: | |
| tb.branch( sn2 ); | ||
| tb.branch( sn3 ); | ||
| assertEquals( "Collabsed to 2 branches", 2, tb.seal().branches().length ); | ||
| assertEquals( 2, tb.seal().branches().length, "Collabsed to 2 branches" ); |
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 your changes
Modernises the toolchain for CVE hygiene and makes the project usable as a DependencyTrack input.
Dependencies
junitjunit-bom)slf4j-simplesource/target1.8 is deprecated on current JDKsproject.build.outputTimestampis now set, so the jar is reproducible — two clean builds produce byte-identical output.SBOM
cyclonedx-maven-pluginemits CycloneDX 1.6 totarget/bom.jsonandtarget/bom.xmlon everypackage.includeTestScopeis enabled deliberately. Every dependency in this project is test-scope, so the default configuration would emit a BOM with zero components. With it enabled the BOM carries 12 components with valid PURLs.CI publishes the SBOM as a workflow artifact and pushes it to DependencyTrack when
DEPENDENCYTRACK_URLandDEPENDENCYTRACK_API_KEYare set as repository secrets. Without them the step is skipped and the build still passes, so this merges safely before the secrets exist.Test migration
All 8 test classes moved to JUnit Jupiter: imports, 2×
@Ignore→@Disabled, 3×@Test(expected=)→assertThrows, and 19 assertion messages moved to the trailing argument.That last part is the only place worth a careful look. JUnit 5 moved the message from the first argument to the last, and this codebase contains both forms:
A regex would have silently inverted the second kind into a passing-but-meaningless assertion. The rewrite used an argument parser that only touches the three-argument form; the 14 two-argument hash assertions in
UnionTreeCombinerTestare untouched.Test counts are unchanged:
@Testmethods match the previous revision exactly per file (32 total), and@Ignore/@Disabledcounts both remain 2.CI
maven.ymlandmaven-build.ymlwere near-duplicates both firing on every push and PR — one still pinned to JDK 1.8 andsetup-java@v1(Node 16). Replaced by a singlebuild.ymlwith a JDK 17/21 matrix.linter.ymlwasworkflow_dispatch-only, so it never actually ran. It now triggers on PRs.dependabot.ymladded to keep those pins current — pinning without Dependabot just means actions rot silently instead of changing silently.permissions:on all jobs.Removals
build.gradle(published to Bintray, shut down 2021) ·gradle/wrapper/gradle-wrapper.jar(orphaned binary — nogradlewor wrapper properties, so an unverifiable jar was sitting in the repo) ·.travis.yml·.gitpod.*·bnd.bndTwo things worth calling out
The OSGi badge is gone.
bnd.bndwas never wired into the Maven build, so the jar has not carried OSGi headers since the Gradle→Maven switch — the README's "OSGi compatible" badge and bullet have been inaccurate since then. Both are removed rather than left standing. Two other badges were already broken and are fixed: the Maven Central badge pointed at coordinates that do not exist, and the Apache license badge pointed atnebula-plugins/nebula-publishing-plugin.super-linter is scoped to YAML and workflow files. Turning it loose on the Java sources would fail every PR on formatting unrelated to the change under review. Widening it is a separate task: pick a style, reformat once, then enforce.
Issue ticket number and link
n/a
Checklist before requesting a review
I have performed a self-review of my code
If it is a core feature, I have added thorough tests.
No behaviour changes — library sources are untouched. Verified
mvn clean verifygreen on JDK 17, 21 and 25 (32 tests, 0 failures),actionlintclean on both workflows, all 7 action SHAs verified against their tags via the API, and reproducible-build output confirmed identical across runs.Do we need to implement analytics?
Will this be part of a product update? If yes, please write one phrase about this update.