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-0076]Validate Results type and object properties #4920

Merged
merged 1 commit into from
Jul 4, 2022

Conversation

Yongxuanzhang
Copy link
Member

@Yongxuanzhang Yongxuanzhang commented May 31, 2022

Changes

This is part of work in TEP-0076.
This commit provides the validation of results in reconciler after we
get the emitted results. It covers the validation of mismatched types
between the results emitted and specified, the results object
properties.
Previous this commit these validations are missing and errors are
ignored.

/kind feature

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

Add Properties for TaskResult so user can define what keys are needed for object type TaskResult and leverage this Properties for validation.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 31, 2022
@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/pod/status.go 90.9% 90.0% -1.0

@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/pod/status.go 90.9% 91.6% 0.7

@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/pod/status.go 90.9% 91.6% 0.7

@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/pod/status.go 90.9% 91.6% 0.7

@Yongxuanzhang
Copy link
Member Author

/retest

@Yongxuanzhang Yongxuanzhang marked this pull request as ready for review May 31, 2022 15:13
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 31, 2022
@Yongxuanzhang
Copy link
Member Author

@ywluogg

@ywluogg
Copy link
Contributor

ywluogg commented Jun 8, 2022

/assign ywluogg

@ywluogg
Copy link
Contributor

ywluogg commented Jun 8, 2022

Can you add release notes for results?

pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
pkg/pod/status.go Outdated Show resolved Hide resolved
@ywluogg
Copy link
Contributor

ywluogg commented Jun 8, 2022

#4723

@Yongxuanzhang
Copy link
Member Author

Can you add release notes for results?

Yes!

@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/pod/status.go 90.9% 91.6% 0.7

@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/pod/status.go 90.9% 91.6% 0.7

@Yongxuanzhang
Copy link
Member Author

/retest

pkg/pod/status.go Outdated Show resolved Hide resolved
neededTypes := make(map[string][]string)
providedTypes := make(map[string][]string)
// collect needed keys for object results
if tr.Spec.TaskSpec != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I think it would make more sense for this function to have only one task spec as the source of truth (and same for the function below it)

Copy link
Member Author

Choose a reason for hiding this comment

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

you mean merge them before calling these functions?

Copy link
Member Author

Choose a reason for hiding this comment

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

If so, I merged them into one results list

Copy link
Member

Choose a reason for hiding this comment

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

no -- I think "resolvedTaskSpec" should be used as the source of truth for what the task spec is

pkg/pod/status_test.go Outdated Show resolved Hide resolved
pkg/pod/status_test.go Outdated Show resolved Hide resolved
@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/reconciler/taskrun/taskrun.go 81.6% 81.5% -0.2
pkg/reconciler/taskrun/validate_resources.go 93.7% 96.2% 2.5

@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/reconciler/taskrun/taskrun.go 81.6% 81.5% -0.2
pkg/reconciler/taskrun/validate_resources.go 93.7% 96.1% 2.4

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 21, 2022
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2022
@ywluogg
Copy link
Contributor

ywluogg commented Jun 27, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2022
Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

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

Thanks for moving out of pkg/pod, I think this looks a lot better! I would actually create a new package (maybe pkg/results?) and export a function that validates a task spec against a list of task results. Does that make sense/seem reasonable?

@ywluogg
Copy link
Contributor

ywluogg commented Jun 27, 2022

Thanks for moving out of pkg/pod, I think this looks a lot better! I would actually create a new package (maybe pkg/results?) and export a function that validates a task spec against a list of task results. Does that make sense/seem reasonable?

Maybe adding a TODO and I believe Yongxuan would definitely do that later? We are trying to target v0.38 release, so wanted to get the features implemented and tested soon

@lbernick
Copy link
Member

Maybe adding a TODO and I believe Yongxuan would definitely do that later? We are trying to target v0.38 release, so wanted to get the features implemented and tested soon

sounds good, could you please create an issue to track?

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 Jun 28, 2022
@ywluogg
Copy link
Contributor

ywluogg commented Jun 28, 2022

Maybe adding a TODO and I believe Yongxuan would definitely do that later? We are trying to target v0.38 release, so wanted to get the features implemented and tested soon

sounds good, could you please create an issue to track?

Yep! #5001 is the issue that tracks this.

This is part of work in TEP-0076.
This commit provides the validation of results in reconciler after we
get the emitted results. It covers the validation of mismatched types
between the results emitted and specified, the results object
properties.
Previous this commit these validations are missing and errors are
ignored.
@tekton-robot tekton-robot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 30, 2022
@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/reconciler/taskrun/taskrun.go 81.6% 81.5% -0.2
pkg/reconciler/taskrun/validate_resources.go 93.7% 96.1% 2.4

@ywluogg
Copy link
Contributor

ywluogg commented Jun 30, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 30, 2022
@Yongxuanzhang
Copy link
Member Author

/retest

@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/reconciler/taskrun/taskrun.go 81.6% 81.5% -0.2
pkg/reconciler/taskrun/validate_resources.go 93.7% 96.1% 2.4

@Yongxuanzhang
Copy link
Member Author

/retest

2 similar comments
@Yongxuanzhang
Copy link
Member Author

/retest

@Yongxuanzhang
Copy link
Member Author

/retest

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. kind/feature Categorizes issue or PR as related to a new feature. 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/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.

4 participants