-
Notifications
You must be signed in to change notification settings - Fork 994
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
[Updater] The Updater always expects job.dependency_groups to be defined #7216
Conversation
# If no groups are defined, all dependencies are ungrouped by default. | ||
return allowed_dependencies unless groups.any? | ||
|
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.
nice cleanup!
branch: | ||
api-endpoint: https://api.github.com/ | ||
hostname: github.com | ||
dependencies: |
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 think you would want to include dummy-pkg-a and dummy-pkg-b under the dependencies key here?
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.
Ah, good eye - for "All Version" updates, we ignore any content in this array and the backend won't actually populate it so I've started leaving it blank when some of our older test fixtures fill it in.
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'm seeing the tests all pass 💚
I left a nit about including the dependencies being testing under the :dependencies key in the grouped + ungrouped job fixture so we don't leave a landmine for future tests using that fixture, but the code LGTM
8020195
to
057d1ee
Compare
…oes-not-inject-groups [Updater] The Updater always expects job.dependency_groups to be defined
As we start to test configured Dependency Groups, we no longer need to rely on the Updater handling empty dependency groups by failing over to a "group everything in one PR" placeholder rule.
The service is now responsible for injecting this in places where it is required, otherwise we should treat an empty
job.dependency_groups
as a sign the feature is not being invoked since this is the target production behaviour.Removing it now will avoid any debugging confusion as we start to test more widely.
Other Changes
As part of making this change I migrated the test that verifies that the
GroupUpdateAllVersions
class handles mixes of grouped and ungrouped dependencies properly from the "legacy"updater_spec.rb
into the class-specific test.This lead on to a further change in
DependabotSnapshot#ungrouped_dependencies
as it was surprising to find this set empty where no groups were defined.I've added a guard clause to return the full list of
allowed_dependencies
whenDependabotSnapshot#groups
are empty so it can be asserted against in tests consistently andUpdateAllVersions
no longer needs to be aware of whether groups exist or not.