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-0091] support remote v1 task verification #6764

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

Yongxuanzhang
Copy link
Member

@Yongxuanzhang Yongxuanzhang commented Jun 2, 2023

Changes

This commit adds the support for v1 task verification. Previously we only support v1beta1 verification.

Part of #6729

/kind feature

Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com

Submitter Checklist

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

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Trusted Resources supports v1 remote tasks verification

@tekton-robot
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 2, 2023
@Yongxuanzhang Yongxuanzhang changed the title [TEP-0091]support remote v1 task verification [TEP-0091] support remote v1 task verification Jun 2, 2023
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesnt merit a release note. labels Jun 2, 2023
@@ -1016,6 +1039,288 @@ func TestGetTaskFunc_VerifyError(t *testing.T) {
}
}

func TestGetTaskFunc_V1Task_VerifyNoError(t *testing.T) {
Copy link
Member Author

@Yongxuanzhang Yongxuanzhang Jun 2, 2023

Choose a reason for hiding this comment

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

The tests in this PR are all copied from current v1beta1 tasks. I tried to merge them into 1 test but seems not so straightforward. Maybe the easiest way for now is to have separate tests? Any suggestions are welcome

Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing this tests might change a bit once we swap the storage version to v1 - I think it's worth checking them to see if we can merge the tests or at least come up with a few helper methods to reduce the amount of copied code between tests

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will pair with @JeromeJu on fixing the tests for the swap PR.
I tried to merge the v1 tests into v1beta1 tests but it still requires lots of test code changes. But helper functions may help.

Copy link
Member

Choose a reason for hiding this comment

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

This could be tackled as part of #5820

@Yongxuanzhang Yongxuanzhang marked this pull request as ready for review June 2, 2023 16:24
@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 Jun 2, 2023
@tekton-robot tekton-robot requested a review from dibyom June 2, 2023 16:24
@Yongxuanzhang
Copy link
Member Author

This PR only has 2 lines of code, other code changes are copied tests and helper functions.

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/taskref.go 90.0% 90.1% 0.1

@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/resources/taskref.go 90.0% 90.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/taskref.go 90.0% 90.1% 0.1

@chitrangpatel
Copy link
Contributor

/assign

},
},
}
tr := parse.MustParseV1beta1TaskRun(t, fmt.Sprintf(`
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason we are using a v1beta1TaskRun and not a v1TaskRun?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, for now in

type Data struct {
PipelineRuns []*v1beta1.PipelineRun
Pipelines []*v1beta1.Pipeline
TaskRuns []*v1beta1.TaskRun
we only support v1beta1 taskrun. The swap PR will change this to v1

Copy link
Member

@JeromeJu JeromeJu Jun 5, 2023

Choose a reason for hiding this comment

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

currently in #6444 we are swapping to v1, so maybe we should keep both in either case?

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 this is fine-- a v1beta1 TaskRun can reference a v1 Task, and it looks like this is correctly testing that case and will be swapped to a v1 TaskRun in Jerome's PR. @Yongxuanzhang can you update the existing test class names to indicate that they're resolving a v1beta1 Task? @JeromeJu just make sure your PR doesn't change the test cases referencing a v1beta1 Task, otherwise they will become redundant with this test case.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @lbernick , I left all v1beta1 verifications as they are in both unit tests and e2e tests, only modifying the apiVersion of the pr/tr referencing the v1beta1 pipeline/task.

@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/resources/taskref.go 90.0% 90.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/taskref.go 90.0% 90.1% 0.1

@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/resources/taskref.go 90.0% 90.1% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/taskref.go 90.0% 90.1% 0.1

},
},
}
tr := parse.MustParseV1beta1TaskRun(t, fmt.Sprintf(`
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 this is fine-- a v1beta1 TaskRun can reference a v1 Task, and it looks like this is correctly testing that case and will be swapped to a v1 TaskRun in Jerome's PR. @Yongxuanzhang can you update the existing test class names to indicate that they're resolving a v1beta1 Task? @JeromeJu just make sure your PR doesn't change the test cases referencing a v1beta1 Task, otherwise they will become redundant with this test case.

@@ -1016,6 +1039,288 @@ func TestGetTaskFunc_VerifyError(t *testing.T) {
}
}

func TestGetTaskFunc_V1Task_VerifyNoError(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

This could be tackled as part of #5820

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2023
This commit adds the support for v1 task verification. Previously we
only support v1beta1 verificaiton.

Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com
@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/resources/taskref.go 89.9% 90.0% 0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/resources/taskref.go 89.9% 90.0% 0.1

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

@Yongxuanzhang
Copy link
Member Author

Yongxuanzhang commented Jun 6, 2023

@chitrangpatel
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2023
@tekton-robot tekton-robot merged commit ec04eef into tektoncd:main Jun 6, 2023
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/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.

7 participants