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

TEP-0090: Refactor Validation of Parameters in TaskRun Reconciler #4841

Merged
merged 1 commit into from
May 6, 2022

Conversation

jerop
Copy link
Member

@jerop jerop commented May 6, 2022

Changes

In this change, we refactor the function that validates Parameters
in the TaskRun reconciler in preparation for changes related to
Matrix. The refactor mainly involves splitting up the lengthy
function to make it easier to understand, maintain and reuse parts
of the logic.

There are no functional changes.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in
    (if there are no user facing changes, use release note "NONE")

Release Notes

NONE

In this change, we refactor the function that validates `Parameters`
in the `TaskRun` reconciler in preparation for changes related to
`Matrix`. The refactor mainly involves splitting up the lengthy
function to make it easier to understand, maintain and reuse parts
of the logic.

There are no functional changes.
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 6, 2022
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 6, 2022
@jerop
Copy link
Member Author

jerop commented May 6, 2022

finished with error: Try a different location, or try again later: Google Compute Engine does not have enough resources available to fulfill request: us-central1-b 🤔

/test pull-tekton-pipeline-alpha-integration-tests

@jerop
Copy link
Member Author

jerop commented May 6, 2022

/retest

@jerop
Copy link
Member Author

jerop commented May 6, 2022

/test pull-tekton-pipeline-go-coverage

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

The descriptive paramNames make it very readable. Thanks @jerop !

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2022
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, lbernick

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 May 6, 2022
@tekton-robot tekton-robot merged commit f1ff83f into tektoncd:main May 6, 2022
jerop added a commit to jerop/pipeline that referenced this pull request May 6, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reonciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above.

Related refactors were done in tektoncd#4841.
jerop added a commit to jerop/pipeline that referenced this pull request May 6, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above.

Related refactors were done in tektoncd#4841.
jerop added a commit to jerop/pipeline that referenced this pull request May 6, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above.

Related refactors were done in tektoncd#4841.
jerop added a commit to jerop/pipeline that referenced this pull request May 6, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above. This includes validating
that `Parameters` in the `Matrix` field are `Arrays` only, and that they are
subsituting `Parameters` of type `String` in the underlying `Task`.

Related refactors were done in tektoncd#4841.
jerop added a commit to jerop/pipeline that referenced this pull request May 6, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above. This includes validating
that `Parameters` in the `Matrix` field are `Arrays` only, and that they are
substituting `Parameters` of type `String` in the underlying `Task`.

Related refactors were done in tektoncd#4841.
jerop added a commit to jerop/pipeline that referenced this pull request May 9, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above. This includes validating
that `Parameters` in the `Matrix` field are `Arrays` only, and that they are
substituting `Parameters` of type `String` in the underlying `Task`.

Related refactors were done in tektoncd#4841.
jerop added a commit to jerop/pipeline that referenced this pull request May 9, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above. This includes validating
that `Parameters` in the `Matrix` are substituting `Parameters` of type `String`
in the underlying `Task`.

Related:
- tektoncd#4704
- tektoncd#4841
jerop added a commit to jerop/pipeline that referenced this pull request May 9, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above. This includes validating
that `Parameters` in the `Matrix` are substituting `Parameters` of type `String`
in the underlying `Task`.

Related:
- tektoncd#4704
- tektoncd#4841
tekton-robot pushed a commit that referenced this pull request May 11, 2022
… Reconciler

The `TaskRun` reconciler validates that the needed `Parameters` are provided,
no extra `Parameters` are provide and the types of `Parameters` are matching.

Prior to this change, the reconciler did the above validation considering the
`params` field in the `PipelineTask` only. In this change, we include `matrix`
field into the validation routine described above. This includes validating
that `Parameters` in the `Matrix` are substituting `Parameters` of type `String`
in the underlying `Task`.

Related:
- #4704
- #4841
@jerop jerop deleted the takrun-validate-params branch June 11, 2022 01:44
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants