Skip to content

Add structured dbt cloud information to the operations api #19395

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

Merged
merged 6 commits into from
Nov 17, 2022

Conversation

mfsiega-airbyte
Copy link
Contributor

What

Add structured dbt Cloud information to the Operations API

How

  • Add the structured info to the openapi spec
  • In the API/persistence layer converter, add logic to convert between persistence layer and API format

NOTE: this PR has dual-writing when we return results, both to the old and new formations for a "generic webhook". When the frontend switches to the new format, we'll remove the old one.

Recommended reading order

  1. airbyte-api/src/main/openapi/config.yaml
  2. airbyte-server/src/main/java/io/airbyte/server/converters/OperationsConverter.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 labels Nov 14, 2022
Copy link
Contributor

@ambirdsall ambirdsall left a comment

Choose a reason for hiding this comment

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

I'll defer approval to java devs, but the updated endpoint design works for me!

webhookConfigId:
type: string
format: uuid
description: The id of the webhook configs to use from the workspace.
webhookType:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a nice little affordance, lets the frontend use if (operatorWebhook.webhookType === "dbtCloud") to narrow the type checking to dbtCloud-specific fields.

Comment on lines +3808 to +3813
accountId:
type: integer
description: The account id associated with the job
jobId:
type: integer
description: The job id associated with the job
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the same field names and types is the key thing to make the frontend DX smooth 👍. Using the same type through the whole "list -> select -> submit" pipeline would let the frontend code be even cleaner, but not by a big enough margin to justify a lot of backend hassle.

enum:
- generic
- dbtCloud
generic:
Copy link
Contributor

Choose a reason for hiding this comment

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

curious, is the idea to remove generic once the webapp switches over to the dbtCloud one?

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 idea was actually leave it around, but that's a good point - it's basically dead code, since nothing will be using it.

I'm happy to eliminate it, and just have structured dbtCloud (plus the deprecated fields, which will indeed be removed soon). Also happy to leave it, as a marker to say "generic webhook operations are a possible thing".

Copy link
Contributor

@davinchia davinchia Nov 14, 2022

Choose a reason for hiding this comment

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

I think at minimum we should remove the backend code to make it clear it's not executed on.

We can leave the interface around with the above comment so we don't have to redesign it. I have a slight preference to remove, however mainly neutral here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I'm on board with removing it altogether.

Copy link
Contributor

@davinchia davinchia left a comment

Choose a reason for hiding this comment

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

Generally looks good!

Comments on testing & making sure I understand certain bits.

@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets November 16, 2022 00:06 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets November 16, 2022 17:38 Inactive
@davinchia
Copy link
Contributor

@mfsiega-airbyte is this ready for another review?

@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets November 16, 2022 19:37 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets November 16, 2022 20:25 Inactive
@mfsiega-airbyte
Copy link
Contributor Author

@davinchia this is now ready!

@mfsiega-airbyte mfsiega-airbyte merged commit d87b38d into master Nov 17, 2022
@mfsiega-airbyte mfsiega-airbyte deleted the msiega/dbt-cloud-operation branch November 17, 2022 16:49
akashkulk pushed a commit that referenced this pull request Dec 2, 2022
* add structured dbt cloud information to the operations api

* remove unused webhook features, test updates

* update tests to use structured dbt cloud operation api

* add missing webhook operator type
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.

4 participants