-
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
Add Workspace and Connection Geography Support to API #17650
Conversation
d19b471
to
909f342
Compare
8c492df
to
1b4d45c
Compare
1b4d45c
to
e5afee7
Compare
@@ -286,7 +287,8 @@ private static void createWorkspaceIfNoneExists(final ConfigRepository configRep | |||
.withSlug(workspaceId.toString()) | |||
.withInitialSetupComplete(false) | |||
.withDisplaySetupWizard(true) | |||
.withTombstone(false); | |||
.withTombstone(false) | |||
.withDefaultGeography(Geography.AUTO); |
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.
nice touch
airbyte-server/src/main/java/io/airbyte/server/handlers/WebBackendGeographiesHandler.java
Outdated
Show resolved
Hide resolved
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.
lgtm, left a couple of comments. I think it's probably worth waiting for someone on FE to give another approval before merging.
e5afee7
to
b68ed71
Compare
b68ed71
to
020edce
Compare
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 API contracts look reasonable to me. I like that it seems the frontend can use the same code path for OSS and cloud, and will simply fetch different geography lists based on context (hiding a geography selection UI if the only geography is auto
is a reasonable piece of busines logic, and cleaner than hardcoding distinct OSS/cloud behaviors); easy to work with and extend in various directions as the product evolves.
My only issue is fetching data with a POST
verb, but that's a sufficiently well-established convention that it wouldn't be appropriate to add in an ad hoc one-off GET
endpoint.
/** | ||
* Only called by the wrapped Cloud API to enable multi-cloud | ||
*/ | ||
public WebBackendGeographiesListResult listGeographiesCloud() { |
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.
remind me: why/how does the Cloud api call this?
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 the idea to explicitly call this method in the wrapped server in Cloud?
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.
Yeah exactly, in the Cloud wrapped server, we'd call this specific endpoint instead of the OSS-specific endpoint. I think this is a short-term solution that we'll iterate on once we have more concrete needs around specialized OSS use-cases. I think it should serve our needs for now and should be pretty easy to adjust in the future
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.
Looks sane to me!
One question to make sure I understand how we want to call this in Cloud.
@ambirdsall definitely agree with this - we have some lower-level server code that assumes every API call is a POST for logging and redaction of sensitive parameters, so that's the convention we use for now. I think there's growing consensus that this is something we'll want to change eventually but for now I think following the established convention makes sense |
* progress on adding geography throughout api * fix workspace handler test * more progress * implement workspace defaulting and add/update more tests * fix bootloader tests * set defaultGeography in missing places * add Geography column when reading Connection record from DB * fix pmd * add more comments/description * format * description
What
Addresses https://github.com/airbytehq/airbyte-cloud/issues/2278
How
v1/web_backend/geographies/list
which returns available Geographies['auto']
in OSS, and['auto', 'us', 'eu']
in Cloud/v1/workspaces/update
to support a new property calleddefaultGeography
defaultGeography
column to the valuedefaultGeography
unmodified/v1/connections/create
and/v1/web_backend/connections/create
endpoint to support a new optional property calledgeography
defaultGeography
./v1/connections/update
and/v1/web_backend/connections/update
endpoint to support a new optional property calledgeography
Recommended reading order
.yaml
files that define the Geography type and various schema updates