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

refactor pipeline validation #2504

Merged
merged 1 commit into from
May 7, 2020

Conversation

pritidesai
Copy link
Member

@pritidesai pritidesai commented Apr 28, 2020

Changes

This change is part of the larger effort to add pipeline level finally.
This initial refactoring is done so that it simplifies implementing
validation for finally section which is similar to tasks section.

This refactoring includes:

  1. Creating a new local function validatePipelineTasks which contains
    check on PipelineTask name and validates PipelineTask to at least contain
    one of taskRef or taskSpec. The same function will then be used by finally
    section as well.
  2. Changing return type of validateFrom

This refactoring simplifies changes listed in finally PR: #2437

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

@tekton-robot tekton-robot requested review from imjasonh and a user April 28, 2020 16:46
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 28, 2020
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/pipeline_validation.go 96.9% 97.0% 0.2
pkg/apis/pipeline/v1beta1/pipeline_validation.go 91.7% 92.0% 0.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/pipeline_validation.go 96.9% 97.0% 0.2
pkg/apis/pipeline/v1beta1/pipeline_validation.go 91.7% 92.0% 0.4

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/pipeline_validation.go 96.9% 97.0% 0.2
pkg/apis/pipeline/v1beta1/pipeline_validation.go 91.7% 92.0% 0.4

@pritidesai
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@pritidesai
Copy link
Member Author

/test pull-tekton-pipeline-build-tests

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/meow

@tekton-robot
Copy link
Collaborator

@vdemeester: cat image

In response to this:

/meow

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.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 29, 2020
Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thank you for this!
So much fun that we need to change both alpha and beta - I can't wait until we start storing beta in etcd :)
/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 3, 2020
@pritidesai
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

1 similar comment
@vdemeester
Copy link
Member

/test pull-tekton-pipeline-integration-tests

@imjasonh
Copy link
Member

imjasonh commented May 4, 2020

Is there anything worth mentioning in the Release Notes section of the PR? If not, please remove it.

@pritidesai
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

1 similar comment
@vdemeester
Copy link
Member

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member

/retest

@vdemeester
Copy link
Member

/lgtm cancel

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label May 5, 2020
@vdemeester
Copy link
Member

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member

/test pull-tekton-pipeline-build-tests

@vdemeester
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2020
This change is part of the larger effort to add pipeline level finally.
This initial refactoring is done so that it simplifies implementing
validation for finally section which is similar to tasks section.

This refactoring includes:

1) creating a new local function validatePipelineTasks which contians
check on PipelineTask name and validates PipelineTask to at least contian
one of taskRef or taskSpec. The same function will then be used by finally
section as well.
2) Changing return type of validateFrom
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label May 5, 2020
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/pipeline_validation.go 96.9% 97.0% 0.2
pkg/apis/pipeline/v1beta1/pipeline_validation.go 91.7% 92.0% 0.4

@pritidesai
Copy link
Member Author

/test pull-tekton-pipeline-build-tests

@vdemeester
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2020
@pritidesai
Copy link
Member Author

@bobcatfish, starting to refactor pipeline validation like you mentioned here, more refactoring is on the way ✍️

@pritidesai
Copy link
Member Author

/test pull-tekton-pipeline-build-tests

@tekton-robot tekton-robot merged commit 67158dd into tektoncd:master May 7, 2020
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