-
Notifications
You must be signed in to change notification settings - Fork 20
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
Define and implement an OpenAPI spec in the backend #141
Define and implement an OpenAPI spec in the backend #141
Conversation
Signed-off-by: Ali Ok <[email protected]>
Signed-off-by: Ali Ok <[email protected]>
Signed-off-by: Ali Ok <[email protected]>
@aliok: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: Ali Ok <[email protected]>
cc @pierDipi |
// TODO: remove | ||
// convertEventType converts a Knative Eventing EventType to a simplified representation that is easier to consume by the Backstage plugin. | ||
// see EventType. | ||
func convertEventType(et *v1beta2.EventType) EventType { | ||
return EventType{ | ||
Name: et.Name, | ||
Namespace: et.Namespace, | ||
Type: et.Spec.Type, | ||
UID: string(et.UID), | ||
Description: et.Spec.Description, | ||
SchemaData: et.Spec.SchemaData, | ||
SchemaURL: et.Spec.Schema.String(), | ||
Uid: string(et.UID), | ||
Description: ToStrPtrOrNil(et.Spec.Description), | ||
SchemaData: ToStrPtrOrNil(et.Spec.SchemaData), | ||
SchemaURL: ToStrPtrOrNil(et.Spec.Schema.String()), | ||
Labels: et.Labels, | ||
Annotations: FilterAnnotations(et.Annotations), | ||
Reference: ToStrPtrOrNil(NamespacedRefName(et.Spec.Reference)), | ||
// this field will be populated later on, when we have process the triggers | ||
ConsumedBy: make([]string, 0), | ||
} | ||
} |
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.
This is to be removed when we're switching to v1beta3 EventTypes
func convertEventTypev1beta3(et *v1beta3.EventType) EventType { | ||
cet := EventType{ | ||
Name: et.Name, | ||
Namespace: et.Namespace, | ||
Uid: string(et.UID), | ||
Description: ToStrPtrOrNil(et.Spec.Description), | ||
Labels: et.Labels, | ||
Annotations: FilterAnnotations(et.Annotations), | ||
Reference: NamespacedRefName(et.Spec.Reference), | ||
Reference: ToStrPtrOrNil(NamespacedRefName(et.Spec.Reference)), | ||
// this field will be populated later on, when we have process the triggers | ||
ConsumedBy: make([]string, 0), | ||
} | ||
|
||
if len(et.Spec.Attributes) == 0 { | ||
return cet | ||
} | ||
|
||
for _, attr := range et.Spec.Attributes { | ||
switch attr.Name { | ||
case "type": // TODO: any CE constant for these? | ||
cet.Type = attr.Value | ||
case "schemadata": | ||
cet.SchemaURL = ToStrPtrOrNil(attr.Value) | ||
} | ||
} | ||
|
||
return cet | ||
} |
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.
I can actually remove this part as we don't use v1beta3 EventTypes at this stage of this PR
/test e2e-tests |
Signed-off-by: Ali Ok <[email protected]>
Signed-off-by: Ali Ok <[email protected]>
hack/verify-go-codegen.sh
Outdated
then | ||
echo "${REPO_ROOT_DIR} is up to date." | ||
else | ||
echo "ERROR: ${REPO_ROOT_DIR} is out of date. Please run ./hack/update-templates.sh" |
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.
shouldn't the message be ... Please run ./hack/update-go-codegen.sh
?
hack/update-go-codegen.sh
Outdated
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.
I think we need to call this in https://github.com/knative-extensions/backstage-plugins/blob/main/hack/update-codegen.sh as that's the one the bots call or everyone contributing to Knative runs
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.
I think we need to call this script in https://github.com/knative-extensions/backstage-plugins/blob/main/hack/verify-codegen.sh as that's the one tests run to verify the code generated
Signed-off-by: Ali Ok <[email protected]>
@pierDipi can you take a new look? |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aliok, pierDipi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a625a17
into
knative-extensions:main
Instead of #138
Changes
Switched to using a
/getEventMesh
path, instead of serving from/
directly.No other behavior change!
Motivation:
/kind
Fixes #
Release Note
Docs