Skip to content

Submit Maven dependency snapshots; drop counterproductive dependency-review retry - #213

Merged
AndreasIgel merged 1 commit into
java-helpers:mainfrom
AndreasIgel:feature/160-dependency-submission
Jul 20, 2026
Merged

AndreasIgel merged 1 commit into
java-helpers:mainfrom
AndreasIgel:feature/160-dependency-submission

Conversation

@AndreasIgel

Copy link
Copy Markdown
Collaborator

Summary

Fixes the confusing "No snapshots were found for the head SHA" warning that dependency-review posts in PR comments. The check is not actually failing — it's green — but the warning is prominent and looks like a failure. Fixes #212 (follow-up to #160 / #182).

Root cause: this Maven repo's dependency graph is populated only by GitHub's static pom.xml parsing. No dependency submission snapshots exist, so dependency-review-action emits the snapshot warning while still passing via the manifest-derived graph. The retry-on-snapshot-warnings: true added in #182 is counterproductive here — with no submission workflow it retries ~2 min for a snapshot that never arrives, then proceeds with the warning anyway.

Changes:

  1. New dependency-submission.yml — on push to main (+ manual dispatch), submits the full transitive Maven dependency snapshot to the dependency graph via advanced-security/maven-dependency-submission-action (SHA-pinned @v5.0.0, contents: write). This improves vulnerability coverage (transitive, not just declared deps) and gives main real snapshot data for reviews to compare against.

  2. dependency-review.yml — remove the counterproductive retry-on-snapshot-warnings, and document that the head-SHA warning on fork PRs is expected/benign:

   comment-summary-in-pr: always
+  # Fork PR head SHAs may show "No snapshots were found for the head SHA" because
+  # submitting a snapshot would require building untrusted fork code with a write
+  # token. Expected & benign: the check uses the manifest-derived graph and passes.
   fail-on-severity: high
   deny-licenses: GPL-1.0-or-later, ...
-  # Snapshot dependency data can lag right after a push; retry instead of failing spuriously.
-  retry-on-snapshot-warnings: true

Why the head-SHA warning can't be fully removed for fork PRs: submitting a snapshot for a fork PR's head commit would require building untrusted fork code with a contents: write token — the exact pattern the fork-CI design deliberately avoids. So the base side (main) gets snapshots; the fork PR head warning remains but is harmless and now documented.

Related

…cy-review retry (java-helpers#160)

Co-Authored-By: Andreas Igel <andreas.igel@computacenter.com>
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 151eb56.
Ensure that dependencies are being submitted on PR branches. Re-running this action after a short time may resolve the issue. See the documentation for more information and troubleshooting advice.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 34e114876b0b11c390a56381ad16ebd13914f8d5 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1024 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
actions/actions/setup-java c1e323688fd81a25caa38c78aa6df2d33d3e20d9 🟢 5.3
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 3Found 7/21 approved changesets -- score normalized to 3
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
Security-Policy🟢 9security policy file detected
actions/advanced-security/maven-dependency-submission-action b275d12641ac2d2108b2cbb7598b154ad2f2cee8 🟢 6.3
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 10all changesets reviewed
Security-Policy🟢 10security policy file detected
Maintained🟢 810 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8
Binary-Artifacts🟢 9binaries present in source code
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
SAST🟢 3SAST tool is not run on all commits -- score normalized to 3

Scanned Files

  • .github/workflows/dependency-submission.yml

@AndreasIgel
AndreasIgel merged commit ab4399c into java-helpers:main Jul 20, 2026
6 checks passed
@AndreasIgel
AndreasIgel deleted the feature/160-dependency-submission branch July 20, 2026 23:53
@AndreasIgel

Copy link
Copy Markdown
Collaborator Author

Superseded by #216. The Maven dependency-submission approach here doesn't fix the reported problem — submitting on main can't create a snapshot for a fork PR's head SHA, so the "No snapshots were found" warning would still show on PRs. #216 instead sets comment-summary-in-pr: on-failure so the benign warning stops being posted as a PR comment. Closing this.

@AndreasIgel

Copy link
Copy Markdown
Collaborator Author

Correction: this PR was already merged (2026-07-20), so it's already on main — my earlier "closing this" note was inaccurate. The submission workflow it added is harmless and stays. #216 builds on top of it to flip comment-summary-in-pr from always to on-failure, which is what actually stops the benign "No snapshots were found for the head SHA" warning from appearing on PRs.

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.

dependency-review posts benign 'missing snapshots' warning; submit Maven dependency snapshots

1 participant