Fix group PR closure when dependencies remain outdated but no new versions available #13893
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?
Dependabot incorrectly closes group PRs during scheduled refresh when no new dependency versions are available, even when the PR's proposed updates are still needed. This creates a close/recreate cycle on each interval.
The bug is in
group_update_refreshing.rb:36-40where emptyupdated_dependenciesunconditionally triggers PR closure. This conflates two distinct scenarios:Anything you want to highlight for special attention from reviewers?
Core logic change:
Implementation:
pr_exists_and_is_up_to_date?iterates PR dependencies and comparescurrent_versionvspr_target_versiontruewhen all dependencies remain below PR target (still outdated)falsewhen any dependency matches/exceeds PR target (already done) or is missingString comparison is used for versions to match PR data format, consistent with
dependency_change_builder.rb:84.How will you know you've accomplished your goal?
Existing test "when the dependencies have been since been updated by someone else" validates scenario #2 (external update → close PR).
Scenario #1 (still outdated → keep PR) requires integration testing with actual refresh cycles, which needs Docker environment not available in current CI setup.
Checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.