fix: migrate git-commit-id-plugin to maintained io.github.git-commit-id coordinates#8473
fix: migrate git-commit-id-plugin to maintained io.github.git-commit-id coordinates#8473Umesh042005 wants to merge 7 commits into
Conversation
Co-authored-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
| Downloader.getInstance().fetchFile(repoUrl, repoFile); | ||
| if(repoFile.exists() && repoFile.length() == 0) { | ||
| Files.delete(repoFile.toPath()); | ||
| throw new UpdateException("Hosted suppressions file is empty or missing - attempting to force the update"); |
There was a problem hiding this comment.
| throw new UpdateException("Hosted suppressions file is empty or missing - attempting to force the update"); | |
| throw new UpdateException("Failed to download the hosted suppressions file"); |
There was a problem hiding this comment.
Pull request overview
This PR primarily updates the build to use the maintained git-commit-id-maven-plugin coordinates, but it also includes several unrelated runtime/data changes in core and utils.
Changes:
- Migrate
git-commit-idMaven plugin coordinates toio.github.git-commit-id:git-commit-id-maven-plugin(v10.0.0). - Update built-in hint/suppression data for
zabbix-utils. - Add/update behaviors in core (hosted suppressions download handling; dependency removal semantics) and adjust utils build/test deps.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
pom.xml |
Switch git-commit-id plugin coordinates/version. |
utils/pom.xml |
Adds a TestNG test dependency (meta-version). |
utils/src/main/java/org/owasp/dependencycheck/utils/SaveToFileResponseHandler.java |
Removes the standard license header. |
core/src/main/java/org/owasp/dependencycheck/data/update/HostedSuppressionsDataSource.java |
Adds a guard for empty hosted suppressions downloads. |
core/src/main/java/org/owasp/dependencycheck/Engine.java |
Changes removeDependency behavior to instance-identity removal. |
core/src/main/resources/dependencycheck-base-hint.xml |
Adds a hint related to zabbix-utils. |
core/src/main/resources/dependencycheck-base-suppression.xml |
Adds a suppression for zabbix-utils PyPI packageUrl. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| package org.owasp.dependencycheck.utils; | ||
|
|
||
| import org.apache.hc.client5.http.impl.classic.AbstractHttpClientResponseHandler; |
| <dependency> | ||
| <groupId>org.testng</groupId> | ||
| <artifactId>testng</artifactId> | ||
| <version>RELEASE</version> | ||
| <scope>test</scope> | ||
| </dependency> |
| if(repoFile.exists() && repoFile.length() == 0) { | ||
| Files.delete(repoFile.toPath()); | ||
| throw new UpdateException("Hosted suppressions file is empty or missing - attempting to force the update"); |
| final Iterator<Dependency> it = dependencies.iterator(); | ||
| while (it.hasNext()) { | ||
| if (it.next() == dependency) { | ||
| it.remove(); | ||
| break; | ||
| } | ||
| } |
jeremylong
left a comment
There was a problem hiding this comment.
If the only thing this PR did was move to the new coordinates for the git-commit-id I'd have no problem merging it. However, there are numerous unrelated and incorrect changes.
d2499c4 to
38f1dc6
Compare
…ommit-id-maven-plugin v10.0.0
38f1dc6 to
a9e33e2
Compare
|
Hi @jeremylong , I have cleaned up the PR and removed all unrelated changes. Only the git-commit-id plugin migration from pl.project13.maven to io.github.git-commit-id (v10.0.0) remains. |
|
Perhaps @jeremylong knows how to evaluate this better than me since he implemented it originally - but personally when reviewing a standalone PR I'd generally like to see a description that gives confidence that what the plugin was doing before is verified to still be working. I have not personally looked at the purpose of the plugin; and the build working is not necessarily sufficient to validate a build-time Maven plugin is still doing its intended job (which appears to be ensuring reproducible builds by setting timestamps inside jars to a deterministic value). There are 6 semver-breaking changes between 4.x and 10.x of the plugin so it'd generally be worth reviewing what is different and commenting as to that investigation, OR ensuring that end results are identical before and after the change. |
|
Hi @chadlwilson , thank you for the thorough review. |
|
Hi @chadlwilson , I reviewed the changelog and breaking changes between 4.x and 10.x. Here are my findings:
|
I think you’ll find the actual goal is to set the timestamps of files inside jars to a deterministic value for reproducible builds based on the commit time, not really the above - which is why the build passing probably isnt sufficient on its own to ensure they are still reproducible. But as long as Maven is fine with the timestamp and able to set it inside zips/jars then it is probably OK. |
|
Hi @chadlwilson , thank you for the correction and the detailed review! I misunderstood the plugin's primary purpose earlier — you're absolutely right that the core goal is to set deterministic timestamps inside the JAR based on git commit time to ensure reproducible builds, not just to expose git metadata. <project.build.outputTimestamp>2025-11-11T12:08:34Z</project.build.outputTimestamp> ${git.commit.time} DependencyCheck is actively using ${git.commit.time} from the plugin to set JAR timestamps for reproducible builds. Since all 15 CI checks passed across JDK 11, 17, 21 and 25 — this confirms that git.commit.time was successfully resolved and timestamps were set correctly after the migration. |
|
Hi @jeremylong, I have addressed all the feedback: Removed all unrelated changes and kept only the git-commit-id plugin migration from pl.project13.maven to io.github.git-commit-id (v10.0.0) Could you also let me know what the requested change was? I want to make sure I haven't missed anything before you re-review. |
Description of Change
Migrated the
git-commit-idplugin from the deprecatedpl.project13.mavencoordinates to the actively maintained
io.github.git-commit-idcoordinates,updating the version from
4.9.0to10.0.0.The old plugin's website is no longer available and the project has moved to a
new home at https://github.com/git-commit-id/git-commit-id-maven-plugin
Related issues
pl.project13.maven:git-commit-id-pluginto maintainedgit-commit-id-maven-plugin#8444Have test cases been added to cover the new functionality?
No — this is a build plugin migration only (not a runtime/functional change).
Verified with
mvn clean install -DskipTests→ BUILD SUCCESS across all modules.