Skip to content

Add validation for sources API#1886

Merged
knative-prow-robot merged 1 commit into
knative:masterfrom
qiujian16:source-validation
Sep 17, 2019
Merged

Add validation for sources API#1886
knative-prow-robot merged 1 commit into
knative:masterfrom
qiujian16:source-validation

Conversation

@qiujian16
Copy link
Copy Markdown
Contributor

Fixes #1196

Proposed Changes

  • Add validation for all source API

Release Note

NONE

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Sep 16, 2019
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 16, 2019
@knative-prow-robot
Copy link
Copy Markdown
Contributor

Hi @qiujian16. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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/test-infra repository.

@lionelvillard
Copy link
Copy Markdown
Contributor

/ok-to-test

@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 16, 2019
@lionelvillard
Copy link
Copy Markdown
Contributor

@qiujian16 thanks for this PR!

Please run go test ./... and make sure all unit tests pass locally.

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/sources/v1alpha1/apiserver_defaults.go Do not exist 100.0%
pkg/apis/sources/v1alpha1/apiserver_validation.go Do not exist 81.8%
pkg/apis/sources/v1alpha1/containersource_defaults.go Do not exist 100.0%
pkg/apis/sources/v1alpha1/containersource_validation.go Do not exist 75.0%
pkg/apis/sources/v1alpha1/cron_job_defaults.go Do not exist 100.0%
pkg/apis/sources/v1alpha1/cron_job_validation.go Do not exist 81.8%
pkg/reconciler/containersource/containersource.go 80.3% 82.8% 2.5
pkg/reconciler/cronjobsource/cronjobsource.go 68.7% 70.7% 2.0

@qiujian16
Copy link
Copy Markdown
Contributor Author

@lionelvillard thanks, it is fixed

@lionelvillard
Copy link
Copy Markdown
Contributor

/lgtm

@n3wscott for approval.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2019
if cs.Sink == nil {
fe := apis.ErrMissingField("sink")
errs = errs.Also(fe)
} else if fe := messagingv1alpha1.IsValidObjectReference(*cs.Sink); fe != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is totally fine for now, since it's just a ref, but we should probably (if not, I'll check) add an issue tracking changing these to use the duck types, which will change these to Destination instead of just an objref.

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Sep 17, 2019

/approve

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16, vaikas-google

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 17, 2019
@knative-prow-robot knative-prow-robot merged commit f4dce78 into knative:master Sep 17, 2019
@qiujian16 qiujian16 deleted the source-validation branch September 18, 2019 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include sources.eventing.knative.dev in validation webhook.

6 participants