[Updater] Ensure we no longer test the legacy code path#7136
Merged
Conversation
1a349fd to
99ef87a
Compare
jakecoffman
reviewed
Apr 21, 2023
jakecoffman
reviewed
Apr 21, 2023
updater/lib/dependabot/updater.rb
Outdated
Member
There was a problem hiding this comment.
The other day I was wondering why we had this exception. Nice use of it!
d5fe1ee to
cd69bf4
Compare
Base automatically changed from
brrygrdn/extract-refresh-security-update-operation
to
main
April 24, 2023 15:17
cb0d338 to
3cfe75f
Compare
3cfe75f to
7d10554
Compare
Merged
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.
Follows on from #7128
Now that all well-formed job definitions are routed to an Operation class, the only jobs that can possibly hit the
Updater#legacy_runpath are those where the attributes do not match real-world configurations.This PR makes a change to disable the
Updater#legacy_runmethod in our test suite so any existing or new tests which hit the legacy code line will fail.Having done this, it then addresses two cohorts of failing tests:
job.dependenciesas a convenience in their test setup to avoid having to account for N dependenciesRationale
The overall goal of the Operation classes is to only have concrete code lines for the job configurations we run in the real world, this ultimately means removing a single capability expressed in our tests at present which is to create a fresh Version Update PR for a set of specific dependencies.
This capability definitely seems like something we might want in future, but in keeping with our intent to make the code paths as explicit as possible I think it makes sense to remove it until we need it rather than leave ambiguity.
As a follow-on from the grouped update introduction and as part of the cleanup from this task the
updater_specshould be broken up to more thoroughly test the concrete classes which will make it much easier to bring this back with exhaustive testing rather than having one example in the file currently touch this path.