Skip to content
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

Merged
merged 10 commits into from
Nov 29, 2022

Conversation

alovew
Copy link
Contributor

@alovew alovew commented Nov 22, 2022

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:

  1. openapi/config.yaml
  2. SchedulerHandler.java -> line 384
  3. WebBackendConnectionHandler.java
  4. WebBackendConnectionHandlerTest.java
  5. ConnectionHelpers.java <- helpers to support test objects

SchedulerHandler logic to disable broken connections:

  1. SchedulerHandler.java -> lines 376-382
  2. SchedulerHandlerTest.java

@octavia-squidington-iv octavia-squidington-iv added area/api Related to the api area/documentation Improvements or additions to documentation area/platform issues related to the platform area/server area/worker Related to worker kubernetes labels Nov 22, 2022
@alovew alovew temporarily deployed to more-secrets November 22, 2022 19:21 Inactive
@alovew alovew temporarily deployed to more-secrets November 22, 2022 19:22 Inactive
@alovew alovew force-pushed the anne/disable-connections-and-send-notif branch from a650eda to e5a7cd8 Compare November 22, 2022 19:31
@alovew alovew temporarily deployed to more-secrets November 22, 2022 19:33 Inactive
@alovew alovew temporarily deployed to more-secrets November 22, 2022 19:33 Inactive
@alovew alovew force-pushed the anne/disable-connections-and-send-notif branch from e5a7cd8 to 0def914 Compare November 23, 2022 22:15
@alovew alovew temporarily deployed to more-secrets November 23, 2022 22:17 Inactive
@alovew alovew temporarily deployed to more-secrets November 23, 2022 22:17 Inactive
@alovew alovew requested a review from a team as a code owner November 28, 2022 18:07
@alovew alovew temporarily deployed to more-secrets November 28, 2022 18:09 Inactive
@alovew alovew force-pushed the anne/disable-connections-and-send-notif branch from 93827a4 to 6ed3996 Compare November 28, 2022 18:09
@alovew alovew temporarily deployed to more-secrets November 28, 2022 18:11 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 18:11 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 18:39 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 18:39 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 19:36 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 19:36 Inactive
@@ -114,7 +119,8 @@ public SchedulerHandler(final ConfigRepository configRepository,
jobPersistence,
eventRunner,
new JobConverter(workerEnvironment, logConfigs),
connectionsHandler);
connectionsHandler,
new EnvVariableFeatureFlags());
Copy link
Contributor

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;
Copy link
Contributor

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.

@alovew alovew force-pushed the anne/disable-connections-and-send-notif branch from a9bc229 to 65d7d57 Compare November 28, 2022 19:48
@alovew alovew temporarily deployed to more-secrets November 28, 2022 19:50 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 19:50 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 20:35 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 20:35 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 20:40 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 20:40 Inactive
@alovew alovew force-pushed the anne/disable-connections-and-send-notif branch from f1a2992 to c5be1b0 Compare November 28, 2022 20:44
@alovew alovew temporarily deployed to more-secrets November 28, 2022 20:45 Inactive
@alovew alovew temporarily deployed to more-secrets November 28, 2022 20:46 Inactive
} else {
connectionStatus = ConnectionStatus.ACTIVE;
}
updateObject.status(connectionStatus);
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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 🤦

@alovew alovew merged commit f07cef8 into master Nov 29, 2022
@alovew alovew deleted the anne/disable-connections-and-send-notif branch November 29, 2022 20:20
terencecho added a commit that referenced this pull request Dec 1, 2022
terencecho added a commit that referenced this pull request Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Related to the api area/documentation Improvements or additions to documentation area/platform issues related to the platform area/server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants