-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: simplify openapi_specifications
to data_specifications
#64
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64 +/- ##
==========================================
- Coverage 45.59% 45.59% -0.01%
==========================================
Files 6 6
Lines 1136 1101 -35
==========================================
- Hits 518 502 -16
+ Misses 529 511 -18
+ Partials 89 88 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -27,9 +27,9 @@ type IConnector interface { | |||
// Add definition | |||
AddConnectorDefinition(def *pipelinePB.ConnectorDefinition) error | |||
// Get the connector definition by definition uid | |||
GetConnectorDefinitionByUID(defUID uuid.UUID, resourceConfig *structpb.Struct, componentConfig *structpb.Struct) (*pipelinePB.ConnectorDefinition, error) | |||
GetConnectorDefinitionByUID(defUID uuid.UUID, resourceConfig *structpb.Struct, component *pipelinePB.ConnectorComponent) (*pipelinePB.ConnectorDefinition, error) |
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.
Note:
The reason we want to pass component data into the definition is that some fields are dynamically generated. For example, in the Instill Model Connector, the enum inside the definition data JSON schema is generated by the connector setting on the fly. So we need to pass component data into it and generate a correct JSON schema.
The current implementation design looks a little bit weird, but it works. I think we can improve the structure 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.
👍 Thanks for the clarification, I wondered why we had these unused fields but with this info I realised that each connector implementation (e.g. restapi.Init()
must implement this interface and there we make use of these fields.
We'll need to update now the Nevermind, just saw instill-ai/connector#135connector
and operator
repos with the new interface, right?
a22d209
to
a865862
Compare
Because - Related to instill-ai/component#64, we simplifies `openapi_specification` into `data_specification` by preserving only the input and output JSON schema and removing the nested structure of the OpenAPI spec. We need to adopt this change. This commit - Adopts the new GetConnectorDefinition function interface.
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 good!
@@ -27,9 +27,9 @@ type IConnector interface { | |||
// Add definition | |||
AddConnectorDefinition(def *pipelinePB.ConnectorDefinition) error | |||
// Get the connector definition by definition uid | |||
GetConnectorDefinitionByUID(defUID uuid.UUID, resourceConfig *structpb.Struct, componentConfig *structpb.Struct) (*pipelinePB.ConnectorDefinition, error) | |||
GetConnectorDefinitionByUID(defUID uuid.UUID, resourceConfig *structpb.Struct, component *pipelinePB.ConnectorComponent) (*pipelinePB.ConnectorDefinition, error) |
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.
👍 Thanks for the clarification, I wondered why we had these unused fields but with this info I realised that each connector implementation (e.g. restapi.Init()
must implement this interface and there we make use of these fields.
We'll need to update now the Nevermind, just saw instill-ai/connector#135connector
and operator
repos with the new interface, right?
🤖 I have created a release *beep* *boop* --- ## [0.13.0-beta](v0.12.0-beta...v0.13.0-beta) (2024-03-07) ### Features * expose description field in component entities ([#62](#62)) ([85bbc22](85bbc22)) * simplify `openapi_specifications` to `data_specifications` ([#64](#64)) ([7c27d15](7c27d15)) ### Bug Fixes * **vdp:** better casting errors ([#65](#65)) ([81e34c4](81e34c4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…till-ai#64) Because - Related to this instill-ai/protobufs#282, currently, we have an `openapi_specification` field in the connector/operator definition. The original purpose was that we could generate an OpenAPI schema and have some UI to let the user debug on an individual component. However, it turns out that we don't really need that OpenAPI schema, and it makes our response very large and hard to read. This commit - Simplifies `openapi_specification` into `data_specification` by preserving only the input and output JSON schema and removing the nested structure of the OpenAPI spec.
🤖 I have created a release *beep* *boop* --- ## [0.13.0-beta](instill-ai/component@v0.12.0-beta...v0.13.0-beta) (2024-03-07) ### Features * expose description field in component entities ([instill-ai#62](instill-ai#62)) ([85bbc22](instill-ai@85bbc22)) * simplify `openapi_specifications` to `data_specifications` ([instill-ai#64](instill-ai#64)) ([7c27d15](instill-ai@7c27d15)) ### Bug Fixes * **vdp:** better casting errors ([instill-ai#65](instill-ai#65)) ([81e34c4](instill-ai@81e34c4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Because
openapi_specification
field in the connector/operator definition. The original purpose was that we could generate an OpenAPI schema and have some UI to let the user debug on an individual component. However, it turns out that we don't really need that OpenAPI schema, and it makes our response very large and hard to read.This commit
openapi_specification
intodata_specification
by preserving only the input and output JSON schema and removing the nested structure of the OpenAPI spec.