Skip to content
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

Validate Task for undefined variables #412

Conversation

vdemeester
Copy link
Member

A Task can fail at "runtime", when the variables are interpolated
based on resources and parameters. Adding validation for those
inexistent variable shorten the loop when trying to write a Pipeline.

Fixes #212

cc @bobcatfish @tanner-bruce

Signed-off-by: Vincent Demeester [email protected]

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 21, 2019
Copy link
Contributor

@shashwathi shashwathi left a comment

Choose a reason for hiding this comment

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

Great work on this PR. I noticed in this file there is no validation of the expected error. There are tests for invalid cases which also include the expected error. I like that practice more because it helps developer understand

  • the expected error for that case
  • when there is change in code about returned error the test fails
  • test is failing for right reasons

A Task can fail at "runtime", when the variables are interpolated
based on resources and parameters. Adding validation for those
inexistent variable shorten the loop when trying to write a Pipeline.

Signed-off-by: Vincent Demeester <[email protected]>
@vdemeester vdemeester force-pushed the 212-task-pipeline-variable-validation branch from 4b6b880 to 8a10953 Compare January 22, 2019 09:45
@bobcatfish
Copy link
Collaborator

Thanks for adding this @vdemeester !!! 😻 (ill leave it for @shashwathi to sign off on this when she's happy :))

@shashwathi
Copy link
Contributor

/assign @shashwathi

@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_validation.go 90.9% 83.1% -7.8

Copy link
Contributor

@shashwathi shashwathi left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thank you for addressing comments. I appreciate it.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 23, 2019
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shashwathi, vdemeester

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 /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 Jan 23, 2019
@knative-prow-robot knative-prow-robot merged commit 2ce21d9 into tektoncd:master Jan 23, 2019
@vdemeester vdemeester deleted the 212-task-pipeline-variable-validation branch January 23, 2019 15:22
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants