Fix ignore option for gitsubmodule#14352
Merged
thavaahariharangit merged 1 commit intodependabot:mainfrom Mar 3, 2026
Merged
Conversation
Dependabot has an `ignore` option to exclude certain version ranges from
update proposals. However, for gitsubmodule ecosystem these options get
ignored, effectively making it impossible to track the latest HEAD when
release tags are present on the current branch.
With this fix, it becomes possible to opt out of release tracking:
```yaml
updates:
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "*"
versions: ["> 0.0.0"]
```
Contributor
There was a problem hiding this comment.
Pull request overview
Routes Dependabot’s standard ignore (and related) update-checker options through the git_submodules ecosystem so users can opt out of release/tag tracking (e.g., to follow the latest branch HEAD even when tags are present).
Changes:
- Pass
ignored_versions,security_advisories,raise_on_ignored, anddependency_filesinto the GitSubmodulesLatestVersionFinder. - Apply ignored-version filtering in
LatestVersionFinder#latest_tag. - Add specs covering the
"> 0.0.0"ignore behavior and the “all versions ignored” (nil/AllVersionsIgnored) cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| git_submodules/lib/dependabot/git_submodules/update_checker.rb | Forwards ignore/security/raise options into LatestVersionFinder so GitSubmodules honors standard update-checker behavior. |
| git_submodules/lib/dependabot/git_submodules/update_checker/latest_version_finder.rb | Applies filter_ignored_versions when computing the latest tag. |
| git_submodules/spec/dependabot/git_submodules/update_checker/latest_version_finder_spec.rb | Adds coverage for ignored versions affecting tag selection and for “all versions ignored” behavior. |
Comments suppressed due to low confidence (1)
git_submodules/lib/dependabot/git_submodules/update_checker/latest_version_finder.rb:31
- The comment about falling back to the current tag when there are no releases after filters is misleading:
apply_post_fetch_latest_versions_filterreturns early whenreleases.empty?, so no fallback is applied (andlatest_tagbecomesnil). Consider updating the comment to match the actual behavior (especially now thatignored_versionscan legitimately filter everything), or adjusting the method if the intended behavior is to always include the current tag as a fallback candidate.
releases = filter_by_cooldown(T.must(releases))
releases = filter_ignored_versions(releases)
# if there are no releases after applying filters, we fallback to the current tag to avoid empty results
releases = apply_post_fetch_latest_versions_filter(releases)
releases.max_by(&:version)&.tag
end
thavaahariharangit
approved these changes
Mar 3, 2026
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.
Dependabot has an
ignoreoption to exclude certain version ranges from update proposals. However, for gitsubmodule ecosystem these options get ignored, effectively making it impossible to track the latest HEAD when release tags are present on the current branch.With this fix, it becomes possible to opt out of release tracking:
What are you trying to accomplish?
Fixes #1639 (comment)
Anything you want to highlight for special attention from reviewers?
This is essentially a fix for pre-existing functionality of Dependabot that simply wasn't properly routed to gitsubmodule.
How will you know you've accomplished your goal?
Added a new test that covers the "> 0.0.0" case specifically.
Checklist