Optimize performance for dependencies with all versions ignored#14294
Open
victor-fialkin-paylocity wants to merge 2 commits intodependabot:mainfrom
Open
Optimize performance for dependencies with all versions ignored#14294victor-fialkin-paylocity wants to merge 2 commits intodependabot:mainfrom
victor-fialkin-paylocity wants to merge 2 commits intodependabot:mainfrom
Conversation
Copilot started reviewing on behalf of
victor-fialkin-paylocity
February 26, 2026 21:18
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes performance for dependencies where all versions are ignored by short-circuiting registry lookups before they occur. The change addresses issue #13477 where private packages that were explicitly ignored still caused failures when Dependabot attempted to look them up in public registries.
Changes:
- Added
all_versions_ignored?method to check if a dependency has all versions ignored (using the>= 0pattern) - Modified
up_to_date?to returntrueearly for fully ignored dependencies, avoiding expensive registry API calls - Updated
can_update?to use the new helper method for consistency - Enhanced
bin/dry-run.rbto filter out fully ignored dependencies before creating update checkers
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/lib/dependabot/update_checkers/base.rb | Adds all_versions_ignored? method and updates up_to_date? and can_update? to use it for early returns |
| common/spec/dependabot/update_checkers/base_spec.rb | Adds comprehensive test coverage for the new method and verifies the optimization works correctly |
| bin/dry-run.rb | Filters out dependencies with all versions ignored before the update loop to prevent errors with private packages |
50cffe1 to
1006810
Compare
Extract all_versions_ignored? method to check for >= 0 ignore condition and short-circuit registry lookups in up_to_date? method. This prevents expensive and error-prone registry API calls for: - Private packages that may not exist on public registries - Dependencies explicitly configured to be completely ignored - Wildcard-ignored dependency patterns Also updates dry-run.rb to skip dependencies with all versions ignored earlier in the process, providing clearer feedback to users. Adds comprehensive test coverage for the new all_versions_ignored? method and verifies that registry lookups are avoided when all versions are ignored. Fixes dependabot#13477
1006810 to
857099a
Compare
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.
What are you trying to accomplish?
This PR optimizes performance short-circuits registry lookups in the
up_to_date?method if all versions to ignored. This prevents expensive and error-prone registry API calls for dependencies explicitly configured to be completely ignored.Anything you want to highlight for special attention from reviewers?
The key change is moving the
all_versions_ignored?check earlier in the flow (up_to_date?method) to avoid registry calls entirely. The logic was already present incan_update?, but moving it toup_to_date?provides better performance and clearer semantics.How will you know you've accomplished your goal?
all_versions_ignored?methodlatest_versionis not called when all versions are ignoredbin/dry-run.rbto skip ignored dependencies earlier with clear user feedbackChecklist