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

Add conversion for remote tasks and pipelines to support v1 #6254

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

Yongxuanzhang
Copy link
Member

@Yongxuanzhang Yongxuanzhang commented Feb 28, 2023

Changes

This commit adds conversion for remote tasks and pipelines after they are resolved by resolvers to support v1 types. Before this commit v1 tasks and pipelines are not supported in remote resolution since we use v1beta1 as the storage version and in reconciler we will convert v1 crd into v1beta. But this conversion is missing for remote resources. After we change the storage version to v1 we should update the code to support v1beta.

Closes #6141

/kind bug

Signed-off-by: Yongxuan Zhang [email protected]

Submitter Checklist

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

  • Has Docs included if any changes are user facing
  • 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)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

V1 tasks and pipelines are supported in remote resolution

@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/bug Categorizes issue or PR as related to a bug. labels Feb 28, 2023
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 28, 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 Feb 28, 2023
@Yongxuanzhang Yongxuanzhang marked this pull request as ready for review February 28, 2023 19:45
@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 Feb 28, 2023
@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/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 90.0% -0.7

@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/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 90.0% -0.7

@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/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 90.0% -0.7

@dibyom
Copy link
Member

dibyom commented Feb 28, 2023

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 28, 2023
Copy link
Member

@JeromeJu JeromeJu left a comment

Choose a reason for hiding this comment

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

Thanks @Yongxuanzhang
This lgtm. Just a small comment if we would want to also include some invalid pipeline/task conversion

@Yongxuanzhang
Copy link
Member Author

Thanks @Yongxuanzhang This lgtm. Just a small comment if we would want to also include some invalid pipeline/task conversion

I'm trying to find a case where we can return the error, but it looks like we will always have errors before this one,
e.g. If I pass a Pipeline or a wrong api version, then we will get error when we resolve it.

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 1, 2023
@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/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 89.9% -0.8

@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/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 89.9% -0.8

Copy link
Member

@QuanZhang-William QuanZhang-William left a comment

Choose a reason for hiding this comment

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

Thanks @Yongxuanzhang! We could also leave a todo comment here to convert to v1 once the migration is completed, not a blocker and

/lgtm

@tekton-robot
Copy link
Collaborator

@QuanZhang-William: changing LGTM is restricted to collaborators

In response to this:

Thanks @Yongxuanzhang! We could also leave a todo comment here to convert to v1 once the migration is completed, not a blocker and

/lgtm

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.

@QuanZhang-William
Copy link
Member

/assign

@JeromeJu
Copy link
Member

JeromeJu commented Mar 1, 2023

Thanks @Yongxuanzhang! We could also leave a todo comment here to convert to v1 once the migration is completed, not a blocker and

/lgtm

I think it might be necessary to support v1beta1 till it deprecates?

@Yongxuanzhang
Copy link
Member Author

Yongxuanzhang commented Mar 1, 2023

Thanks @Yongxuanzhang! We could also leave a todo comment here to convert to v1 once the migration is completed, not a blocker and

/lgtm

Oh thanks for the reminder! I will add a todo there

if err := t.ConvertFrom(ctx, obj); err != nil {
return nil, err
}
return t, nil
}

return nil, errors.New("resource is not a pipeline")
Copy link
Member

Choose a reason for hiding this comment

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

can you please add a test for this case? (and same for taskref)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we could add a test for this, the error will be caught by code before this one

pkg/reconciler/pipelinerun/resources/pipelineref_test.go Outdated Show resolved Hide resolved
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 2, 2023
This commit adds conversion for remote tasks and pipelines after they
are resolved by resolvers to support v1 types. Before this commit v1
tasks and pipelines are not supported in remote resolution since we use
v1beta1 as the storage version and in reconciler we will convert v1 crd
into v1beta. But this conversion is missing for remote resources. After
we change the storage version to v1 we should update the code to support
v1beta.

Signed-off-by: Yongxuan Zhang [email protected]
@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/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 89.9% -0.8

@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/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 89.9% -0.8

@Yongxuanzhang
Copy link
Member Author

Note that the coverage drop of these 2 files are inevitable, the error case is not possible in current funciton

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JeromeJu, lbernick, 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:
  • OWNERS [lbernick,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lbernick
Copy link
Member

lbernick commented Mar 8, 2023

/lgtm
(approval from Vincent)

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

/test pull-tekton-pipeline-go-coverage-df

@tekton-robot
Copy link
Collaborator

@Yongxuanzhang: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-beta-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test pull-tekton-pipeline-go-coverage-df

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.

@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-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/resources/pipelineref.go 95.0% 93.8% -1.2
pkg/reconciler/taskrun/resources/taskref.go 90.7% 89.9% -0.8

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

Support v1 Task&Pipeline in remote resolution
7 participants