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

convert the workspace update api to patch style #16739

Merged
merged 3 commits into from
Sep 26, 2022

Conversation

mfsiega-airbyte
Copy link
Contributor

What

Convert the workspace update API to accept PATCH-style updates.

How

Only apply updates from request parameters that have been specified.

Recommended reading order

  1. airbyte-server/src/main/java/io/airbyte/server/handlers/WorkspacesHandler.java
  2. airbyte-server/src/test/java/io/airbyte/server/handlers/WorkspacesHandlerTest.java

Copy link
Contributor

@pmossman pmossman left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just left a small suggestion

if (workspacePatch.getSecurityUpdates() != null) {
workspace.setSecurityUpdates(workspacePatch.getSecurityUpdates());
}
if (workspacePatch.getEmail() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the old code was doing a nullOrEmpty check, but the new code is just checking for null. Maybe the best thing to do for the new code would be to add a validation in validateWorkspacePatch that the email address is properly formed? Or at least not an empty string?

@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 23, 2022 16:57 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 23, 2022 17:10 Inactive
@mfsiega-airbyte mfsiega-airbyte merged commit 32a9841 into master Sep 26, 2022
@mfsiega-airbyte mfsiega-airbyte deleted the msiega/workspace-patch-update branch September 26, 2022 09:29
robbinhan pushed a commit to robbinhan/airbyte that referenced this pull request Sep 29, 2022
* convert the workspace api to patch style

* check for empty email in workspace update
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
* convert the workspace api to patch style

* check for empty email in workspace update
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.

None yet

2 participants