-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not close a PR when it supersedes other groups #11382
base: main
Are you sure you want to change the base?
Conversation
set += Array(dependency_names) | ||
names = Array(dependency_names) | ||
Dependabot.logger.info("Adding dependencies as handled: (#{names.join(', ')}).") | ||
set += names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method can be simplified to avoid redundant variables (set
and names
) and directly update the handled dependencies. Here's a suggestion:
def add_handled_dependencies(dependency_names)
assert_current_directory_set!
@handled_dependencies[@current_directory] ||= Set.new
names = Array(dependency_names)
Dependabot.logger.info("Adding dependencies as handled: (#{names.join(', ')}).")
@handled_dependencies[@current_directory] += names
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also just found a solution to the original problem that I've committed in addition to the logging
849f618
to
5167305
Compare
527905f
to
e52e699
Compare
@@ -1,4 +1,21 @@ | |||
[ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why 2.0.0
did not exist here, but did elsewhere
Thank you so much @judocode ! |
What are you trying to accomplish?
Prevent this issue, which, in summary:
Anything you want to highlight for special attention from reviewers?
I added an optional param to
mark_group_handled
calledexcluding_dependencies
, which should work as advertised, and will avoid the exclusion if the dependency is in an existing PR. Also, this should maintain current behavior of closing a PR when a dep exists in more than 1 PR.I only used this optional param in RefreshGroupUpdatePullRequest, and there are 2 other uses in GroupUpdateAllVersions. We may consider adding
excluding_dependencies
there as well, but I am not familiar with that path.How will you know you've accomplished your goal?
I have added a new test along with fixtures that demonstrates this new functionality works. Also, previous functionality and tests are maintained, which include an existing test that will close a PR if it sees a dependency exists in 2 PRs.
Checklist