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-0114: Added CustomRun references and specifications to v1beta1 #5403

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

vsinghai
Copy link
Contributor

@vsinghai vsinghai commented Aug 31, 2022

Changes

Prior to this commit, we proposed migrating
Custom Tasks and Runs to beta. Today, embedded specs
are in Run.Spec.Spec.

In this commit, we will align the embedded specs
with the rest of the API such that it's
CustomRun.Spec.CustomSpec.

Fixes issue #5154
Fixes issue #5153
/cc @jerop
/cc @dibyom

/kind feature

Submitter Checklist

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

[n/a] 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
    [n/a] 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

NONE

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 31, 2022
@tekton-robot
Copy link
Collaborator

Hi @vsinghai. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@vsinghai vsinghai marked this pull request as draft August 31, 2022 15:14
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 31, 2022
@dibyom
Copy link
Member

dibyom commented Aug 31, 2022

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 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/apis/pipeline/v1beta1/customrun_types.go Do not exist 0.0%

@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 1, 2022
@vsinghai vsinghai marked this pull request as ready for review September 1, 2022 15:06
@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 Sep 1, 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/apis/pipeline/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

@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/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

@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/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

@vsinghai vsinghai force-pushed the references branch 2 times, most recently from 22d3640 to e1c0422 Compare September 2, 2022 15:20
@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/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

@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/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

@vsinghai
Copy link
Contributor Author

vsinghai commented Sep 6, 2022

Below are some problems and resolutions I encountered while creating this PR:

Problems:

  1. ./hack/update-codegen.sh kept creating a file docs/pipeline-api.md.backup that would mess up the CI testing
  2. ./hack/update-codegen.sh would add indents to register.go files for go versions that are run locally on a mac. This would cause build failures because the CI is running a different version of go and the diff between the two register.go files would vary.

Resolutions:

  1. The issue was brought up in Redundant md.backup file by update-reference-docs.sh #5417 and resolved in Add docs/pipeline-api.md.backup to .gitignore #5418 . I also manually removed the docs/pipeline-api.md.backup file.
  2. I manually removed the indents from the files.

@jerop jerop changed the title Added CustomRun references and specifications to v1beta1 TEP-0114: Added CustomRun references and specifications to v1beta1 Sep 6, 2022
jerop added a commit to jerop/community that referenced this pull request Sep 6, 2022
In v1alpha1, `Runs` have `Pod` templates. However, `Runs` do not
always create `Pods`. In this change, we propose that `Runs` in
v1beta1 should not have `Pod` templates - specific `Custom Tasks`
implementation can support that in their own specifications.

Context: tektoncd/pipeline#5403 (comment)

Many thanks to @lbernick for catching this issue!
@XinruZhang
Copy link
Member

/assign

pkg/apis/pipeline/v1beta1/customrun_types_test.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/customrun_types_test.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/customrun_validation.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/customrun_validation.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/customrun_validation_test.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/customrun_validation_test.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/customrun_validation_test.go Outdated Show resolved Hide resolved
Copy link
Member

@XinruZhang XinruZhang left a comment

Choose a reason for hiding this comment

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

As review goes, I can see this is such a large and important effort for Custom Task Beta. Appreciate your work here!

pkg/apis/pipeline/v1beta1/customrun_validation_test.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1beta1/swagger.json Show resolved Hide resolved
},
"metadata": {
"default": {},
"$ref": "#/definitions/v1beta1.PipelineTaskMetadata"
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 not sure if this is correct? Why is it PipelineTaskMetadata? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is correct, Metadata PipelineTaskMetadata json:"metadata,omitempty", found in customrun_types.go line 39. The swagger.json files are autogenerated files.

Copy link
Member

Choose a reason for hiding this comment

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

@jerop same here

Copy link
Member

Choose a reason for hiding this comment

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

@XinruZhang this is also another case of reusing the metadata type -- we can rename it to something more appropriate for all places that it's used but would rather leave it out of scope for this change

pkg/apis/run/v1beta1/customrunstatus_types.go Outdated Show resolved Hide resolved
pkg/apis/run/v1beta1/customrunstatus_types.go Outdated Show resolved Hide resolved
@vsinghai
Copy link
Contributor Author

vsinghai commented Sep 7, 2022

Thank you @XinruZhang for the feedback! :)

@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/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

pkg/apis/pipeline/v1beta1/customrun_types.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 Sep 8, 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/apis/pipeline/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

@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/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

Prior to this commit, we proposed migrating
`Custom Tasks` and `Runs` to beta. Today, [embedded specs](https://github.com/tektoncd/pipeline/blob/main/docs/runs.md#2-specifying-the-target-custom-task-by-embedding-its-spec)
are in `Run.Spec.Spec`.

In this commit, we will align the embedded specs
with the rest of the API such that it's
`CustomRun.Spec.CustomSpec`.

Fixes issue [tektoncd#5154](tektoncd#5154)
/cc @jerop
/cc @dibyom

/kind feature
@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/v1beta1/customrun_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/customrun_types.go Do not exist 59.3%
pkg/apis/pipeline/v1beta1/customrun_validation.go Do not exist 92.6%

Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerop, 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 merged commit 04e1150 into tektoncd:main Sep 8, 2022
tekton-robot pushed a commit to tektoncd/community that referenced this pull request Sep 8, 2022
In v1alpha1, `Runs` have `Pod` templates. However, `Runs` do not
always create `Pods`. In this change, we propose that `Runs` in
v1beta1 should not have `Pod` templates - specific `Custom Tasks`
implementation can support that in their own specifications.

Context: tektoncd/pipeline#5403 (comment)

Many thanks to @lbernick for catching this issue!
@vsinghai vsinghai deleted the references branch September 8, 2022 17:06
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesnt merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants