Skip to content

Commit

Permalink
feat(vdp): add event schema in component definitions (#515)
Browse files Browse the repository at this point in the history
Because

- We’re introducing the run-on-event pipeline, which requires providing
setup and message schemas so users can understand the event message
format.

This commit
 - Adds event schemas to component definitions.
 - Removes deprecated connector and operator definitions API.

---------

Co-authored-by: droplet-bot <[email protected]>
  • Loading branch information
donch1989 and droplet-bot authored Nov 13, 2024
1 parent 0f9ef80 commit 4e94223
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 323 deletions.
61 changes: 57 additions & 4 deletions openapi/v2/service.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6073,6 +6073,13 @@ definitions:
readOnly: true
allOf:
- $ref: '#/definitions/ComponentDefinition.ReleaseStage'
events:
type: array
items:
type: object
$ref: '#/definitions/ComponentEvent'
description: List of events that can be produced by the component.
readOnly: true
description: ComponentDefinition describes a certain type of Component.
ComponentDefinition.ReleaseStage:
type: string
Expand Down Expand Up @@ -6126,6 +6133,24 @@ definitions:
- VIEW_BASIC: Default view, only includes basic information (removes the `spec`
field).
- VIEW_FULL: Full representation.
ComponentEvent:
type: object
properties:
name:
type: string
description: The event name, e.g. `EVENT_NEW`.
readOnly: true
title:
type: string
description: Title is the event name in a human-friendly format.
readOnly: true
description:
type: string
description: Description contains information about the event.
readOnly: true
description: |-
ComponentEvent contains information about an event that a component can
produce.
ComponentRun:
type: object
properties:
Expand Down Expand Up @@ -6560,7 +6585,9 @@ definitions:
type: object
description: JSON schema describing the component output data.
readOnly: true
description: DataSpecification describes the JSON schema of component input and output.
description: |-
DataSpecification describes the JSON schema of component input and output.
Note: This message will be renamed to TaskSpecifications in the future.
DeleteAppResponse:
type: object
description: DeleteAppResponse represents a response for deleting a app.
Expand Down Expand Up @@ -6649,6 +6676,24 @@ definitions:
description: |-
ErrPipelineValidation contains information about a failed pipeline
validation.
EventSpecification:
type: object
properties:
setupSchema:
type: object
description: JSON schema describing the component event setup data.
readOnly: true
messageSchema:
type: object
description: JSON schema describing the component event message data.
readOnly: true
messageExamples:
type: array
items:
type: object
description: JSON schema describing the component event examples.
readOnly: true
description: EventSpecification describes the JSON schema of component event setup and examples.
File:
type: object
properties:
Expand Down Expand Up @@ -9560,17 +9605,25 @@ definitions:
componentSpecification:
type: object
description: Component specification.
readOnly: true
dataSpecifications:
type: object
additionalProperties:
$ref: '#/definitions/DataSpecification'
description: |-
Data specifications.
The key represents the task, and the value is the corresponding data_specification.
Note: This field will be renamed to task_specifications in the future.
readOnly: true
eventSpecifications:
type: object
additionalProperties:
$ref: '#/definitions/EventSpecification'
description: |-
Event specifications.
The key represents the event, and the value is the corresponding event_specification.
readOnly: true
description: Spec represents a specification data model.
required:
- componentSpecification
- dataSpecifications
StripeSubscriptionDetail:
type: object
properties:
Expand Down
11 changes: 11 additions & 0 deletions vdp/pipeline/v1beta/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ message ComponentTask {
string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ComponentEvent contains information about an event that a component can
// produce.
message ComponentEvent {
// The event name, e.g. `EVENT_NEW`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Title is the event name in a human-friendly format.
string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Description contains information about the event.
string description = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ComponentType defines the component type based on its task features.
enum ComponentType {
// Unspecified.
Expand Down
Loading

0 comments on commit 4e94223

Please sign in to comment.