-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Disable broken connections when feature flag is on #19730
Conversation
a650eda
to
e5a7cd8
Compare
e5a7cd8
to
0def914
Compare
93827a4
to
6ed3996
Compare
@@ -114,7 +119,8 @@ public SchedulerHandler(final ConfigRepository configRepository, | |||
jobPersistence, | |||
eventRunner, | |||
new JobConverter(workerEnvironment, logConfigs), | |||
connectionsHandler); | |||
connectionsHandler, | |||
new EnvVariableFeatureFlags()); |
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.
Can we inject that instead of creating a new instance here, it will help for the migration to micronaut.
|
||
return containsBreakingChange || preference == NonBreakingChangesPreference.DISABLE; |
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.
should this be an && instead of an ||? Otherwise we will disable all connection where the preference is NonBreakingChangesPreference.DISABLE
.
We need an UTest to catch that.
a9bc229
to
65d7d57
Compare
This reverts commit dc7a1d1.
f1a2992
to
c5be1b0
Compare
} else { | ||
connectionStatus = ConnectionStatus.ACTIVE; | ||
} | ||
updateObject.status(connectionStatus); |
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.
We need a test that check that we are setting the expected status.
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 have a bunch of new SchedulerHandlerTests -- is there another case you think I should be testing?
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.
The status is being tested on each new test, and I also added it to existing tests
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.
Is there a test that check that we are not disabling the connection if the feature flag is set to false or if the preference is set to not disable?
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.
yes - you have to expand SchedulerHandlerTest in github to see it because I think it is collapsed due to the large number of changes to the file
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.
Oh my bad, I missed them because of them being collapsed 🤦
This reverts commit f07cef8.
This reverts commit f07cef8.
What
Check the feature flag in the discover read endpoint and if it is enabled, then disable connections that have breaking schema changes or where the user has specified that non-breaking changes should cause the connection to be disabled
Recommended reading order
Adding ConnectionStatus to SchemaRead object and updating ConnectionRead object:
openapi/config.yaml
SchedulerHandler.java
-> line 384WebBackendConnectionHandler.java
WebBackendConnectionHandlerTest.java
ConnectionHelpers.java
<- helpers to support test objectsSchedulerHandler logic to disable broken connections:
SchedulerHandler.java
-> lines 376-382SchedulerHandlerTest.java