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

🪟 🎉 Multi-cloud: edit connection & workspace data geographies in the UI #18611

Merged
merged 29 commits into from
Nov 4, 2022

Conversation

josephkmh
Copy link
Contributor

@josephkmh josephkmh commented Oct 28, 2022

What

Adds data geography to workspace and connection settings.

Demo:
https://www.loom.com/share/cfc469c1e9b74e63b7e344851ddcf1dd

@natalyjazzviolin is working on a custom dropdown in a separate PR.

Note: the functionality is behind a feature flag that is currently disabled - we will do a staged rollout in production to test that it's working as intended.

How

This PR allows users to set data geography in three places:

  1. Workspace settings
  2. Creating a new connection
  3. Editing an existing connection

Recommended reading order

First, the available geographies need to be fetched from the backend. I followed the existing conventions and added a GeographiesService:

  • packages/cloud/lib/domain/geographies/GeographiesService.ts
  • packages/cloud/services/geographies/GeographiesService.ts

The default workspace data geography is set in the workspace settings:

  • packages/cloud/views/workspaces/DefaultDataResidencyView/DefaultDataResidencyView.tsx

Screen Shot 2022-10-31 at 5 06 39 PM

When creating a new connection, a new DataResidency section has been added:

  • components/CreateConnection/DataResidency.tsx

Screen Shot 2022-10-31 at 5 04 30 PM

When editing an existing connection, a new UpdateConnectionGeography has been added:

  • components/UpdateConnectionGeography/UpdateConnectionGeography.tsx

Screen Shot 2022-10-31 at 5 05 49 PM

The rest of the changes are related to fixing tests, styling changes, and updating interfaces to include the workspace.defaultGeography and connection.geography properties.

@github-actions github-actions bot added the area/platform issues related to the platform label Oct 28, 2022
@@ -5,6 +5,7 @@ export enum FeatureItem {
AllowUpdateConnectors = "ALLOW_UPDATE_CONNECTORS",
AllowOAuthConnector = "ALLOW_OAUTH_CONNECTOR",
AllowSync = "ALLOW_SYNC",
AllowChangeDataGeographies = "ALLOW_CHANGE_DATA_GEOGRAPHIES",
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 ability to change data geographies is behind a feature flag. It's not available in OSS, and it is currently disabled in cloud. We will do a staged rollout in production to test that it's working as expected.

/>
</div>
<div className={styles.dropdownWrapper}>
<div className={styles.spinner}>{connectionUpdating && <Spinner small />}</div>
Copy link
Contributor Author

@josephkmh josephkmh Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm waiting to hear back from Nico about how we should deal with this loading state. So this loading spinner may be replaced with something else.

@@ -39,7 +40,7 @@ interface CreateConnectionPropsInner extends Pick<CreateConnectionProps, "afterS

const CreateConnectionFormInner: React.FC<CreateConnectionPropsInner> = ({ schemaError, afterSubmitConnection }) => {
const navigate = useNavigate();

const canEditDataGeographies = useFeature(FeatureItem.AllowChangeDataGeographies);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is false for now, but can be overridden in LaunchDarkly for testing

@@ -27,7 +27,7 @@ interface SideMenuProps {
}

const Content = styled.nav`
min-width: 147px;
min-width: 155px;
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 sidebar is ever-so-slightly too small for Default Data Residency. This CSS should really be more flexible, but just making it work for now!

@@ -23,6 +24,7 @@ export const CloudSettingsPage: React.FC = () => {
// TODO: uncomment when supported in cloud
// const { countNewSourceVersion, countNewDestinationVersion } = useConnector();
const supportsCloudDbtIntegration = useFeature(FeatureItem.AllowDBTCloudIntegration);
const supportsDefaultDataResidency = useFeature(FeatureItem.AllowChangeDataGeographies);
Copy link
Contributor Author

@josephkmh josephkmh Oct 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is false for now, but can be overridden in LaunchDarkly for testing

@josephkmh josephkmh marked this pull request as ready for review October 31, 2022 16:21
@josephkmh josephkmh requested a review from a team as a code owner October 31, 2022 16:21
@josephkmh josephkmh changed the title 🪟 🎉 [DRAFT] Add connection & workspace geographies to UI 🪟 🎉 Add connection & workspace geographies to UI Oct 31, 2022
@josephkmh josephkmh changed the title 🪟 🎉 Add connection & workspace geographies to UI 🪟 🎉 Multi-cloud: edit connection & workspace data geographies Oct 31, 2022
@josephkmh josephkmh requested a review from ambirdsall November 2, 2022 20:27
"settings.dataResidency": "Data Residency",
"settings.defaultDataResidency": "Default Data Residency",
"settings.defaultGeography": "Geography",
"settings.defaultDataResidencyDescription": "Choose the default preferred data processing location for all of your connections. Setting this choice means your data never leaves this region. <lnk>Learn more</lnk>.",
Copy link
Contributor

@timroes timroes Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strictly spoken not completely true, and I feel this might be the place we need to clarify about that. Actually some data leaves the region. If you have incremental syncs the cursor field values, which we'll store as a "state" for the next run are always stored in our control plane (such US), no matter where the connection ran. Meaning if you chose a field as a cursor field that would anyhow have sensitive data in it (not entirely sure of a good example for that), this data will be send and stored in the US.

cc @andyjih we talked about that a while back, and I think it would be good if you could give your input on wording and where we might want to document that?

Just feels for me saying "your data will NEVER leave this region" is a bit harsh, given we know it might. Also it still depends on the connection's actually region setting (since this is only the default region screen), so we might also want to add that to the description here.

Copy link
Contributor Author

@josephkmh josephkmh Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it's a little misleading. @andyjih also wanted to add a short clarification that the workspace default only affects new connections. How about the following?

Choose the default preferred data processing location for your connections. The default Data Residency setting only affects new Connections. Existing Connections will retain their Data Residency setting. <lnk>Learn more</lnk>.

Edit: looks like the docs PR also has some discussion on this: #18872 (comment)

nextLine
label={<FormattedMessage id="connection.geographyTitle" />}
message={
<FormattedMessage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth to point here out, when this will take effect? I assume it's not cancelling the current running sync and I also assume it doesn't require a reset, so simply the next sync/reset jobs will be done in that region? Maybe worth putting something like: "This will take effect for all syncs and resets starting after the change." (or something better worded).

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 think this is almost self-explanatory and not necessary to explain, but maybe @andyjih can weigh in. It's also something we could consider adding to the docs instead of directly in the UI.

Here's a proposal for the wording if we do want to mention it:

Depending on your network configuration, you may need to <lnk>add IP addresses</lnk> to your allowlist. Changes to data residency will be applied to new sync and reset jobs. Currently running jobs will not be affected.

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. I tested the feature and seems changing workspace default residency is working and affecting new connections. Updating connections is working fine. Tested on Chrome Linux.

I left some thoughts around phrasing and code nitpick. Nothing of it functional for the feature, so I'm already going ahead and approve this PR.

@josephkmh josephkmh merged commit 4352686 into master Nov 4, 2022
@josephkmh josephkmh deleted the joey/multi-cloud-connection-geography branch November 4, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform team/compose
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants