-
Notifications
You must be signed in to change notification settings - Fork 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
Create feature flag for Grouped security updates #8529
Create feature flag for Grouped security updates #8529
Conversation
9365316
to
e9ccc8c
Compare
@@ -15,6 +15,7 @@ class CreateGroupSecurityUpdatePullRequest | |||
include GroupUpdateCreation | |||
|
|||
def self.applies_to?(job:) | |||
return false if Dependabot::Experiments.enabled?(:grouped_security_updates_disabled) |
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 recognize that it's a bit weird to phrase it like this, but I need the default case to be grouped_security_updates being on and the way Dependabot::Experiments works is it's falsy by default.
@@ -209,8 +209,12 @@ | |||
context "when there is an exception that blocks PR creation (cloud)" do | |||
before do | |||
allow(api_client).to receive(:create_pull_request).and_raise(StandardError, "oh no!") | |||
allow(Dependabot::Experiments).to receive(:enabled?).with(:record_ecosystem_versions).and_return(true) |
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.
As far as I can tell doing it this way really only worked while we had a single call against enabled?
. Since we already had the reset!
method I figured we could make use of it instead of mocking things so that later levels of abstraction have an easier time handling things.
@@ -232,10 +236,6 @@ | |||
end | |||
end | |||
|
|||
before do | |||
allow(Dependabot::Experiments).to receive(:enabled?).with(:record_update_job_unknown_error).and_return(false) |
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.
These explicit mocks were not needed once we stop mocking (default to false), so I deleted them.
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.
Thanks!
This creates a feature flag for Grouped security updates.