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

Expose v1beta1 to the world ⛈ #2035

Merged
merged 4 commits into from
Mar 2, 2020

Conversation

vdemeester
Copy link
Member

@vdemeester vdemeester commented Feb 11, 2020

Changes

This exposes v1alpha2 to the world, hooking the webhook, auto-conversion and the controller all together, adding v1alpha2 CRD version.

Still to do.

  • split the commit into pieces
  • fix the CI 😝
  • e2e tests
  • rename to v1beta1
  • [] a big documentation pass
  • update release note

/hold

Depends on #2025
Closes #1526

/cc @bobcatfish @sbwsg

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:
v1alpha2

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

Release Notes

Expose v1beta1 APIs to the world :tada: 

v1beta1 is gonna be the first beta API supported by Tekton Pipeline. It contains `Pipeline`, `PipelineRun`, `Task`, `ClusterTask` and `PipelineRun` objects. `Condition` and `PipelineResource` are staying in alpha state. This means **they can be used in the beta object *but* the won't be supported**.

We can only store one version on the CRD and we want
to serve multilple. To keep the latest API the cleanest (here
`v1beta1`), we are using `v1alpha1` and making sure that `v1alpha1`
struct are compatible (aka a `v1beta1` struct can be serialized in a
`v1alpha1` struct so that it can be stored). This is what the
auto-conversion role is :

- take a version and convert it to the most recent version (here
  `v1beta1`)
- then store it as the lowest version (here `v1alpha1`)

For the controller this means we still work with `v1alpha1`
struct *but* with only the part that is compatible with
`v1beta1`.

@tekton-robot tekton-robot requested review from bobcatfish and a user February 11, 2020 15:17
@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 11, 2020
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Feb 11, 2020
@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 11, 2020
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha2/conversion_error.go Do not exist 0.0%
pkg/apis/pipeline/v1alpha2/pipelinerun_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1alpha2/pipelinerun_types.go 93.1% 90.0% -3.1
pkg/apis/pipeline/v1alpha2/task_validation.go 83.1% 83.8% 0.7
pkg/apis/pipeline/v1alpha2/taskrun_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1alpha2/taskrun_types.go 74.1% 71.4% -2.6
test/builder/task.go 81.1% 69.7% -11.5

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Looks good so far! Will revisit once WIP is removed.

config/300-clustertask.yaml Show resolved Hide resolved
pkg/apis/pipeline/v1alpha1/pipelinerun_conversion.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1alpha1/taskrun_conversion.go Outdated Show resolved Hide resolved
pkg/reconciler/taskrun/resources/image_exporter.go Outdated Show resolved Hide resolved
@vdemeester vdemeester force-pushed the expose-v1alpha2 branch 4 times, most recently from d0f98ff to 8627424 Compare February 12, 2020 14:40
@vdemeester
Copy link
Member Author

… so close… 😓

@vdemeester vdemeester force-pushed the expose-v1alpha2 branch 2 times, most recently from 2b4e209 to f7fee33 Compare February 12, 2020 15:57
@vdemeester
Copy link
Member Author

/retest

@vdemeester vdemeester force-pushed the expose-v1alpha2 branch 3 times, most recently from e81c715 to 3874ceb Compare February 13, 2020 13:54
@vdemeester
Copy link
Member Author

/retest

@vdemeester vdemeester force-pushed the expose-v1alpha2 branch 4 times, most recently from 013633a to 1a66080 Compare February 14, 2020 11:22
@tektoncd tektoncd deleted a comment from tekton-robot Feb 14, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Feb 14, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Feb 14, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Feb 14, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Feb 14, 2020
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2020
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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 removed the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2020
@vdemeester
Copy link
Member Author

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 2, 2020
@ghost
Copy link

ghost commented Mar 2, 2020

Needs rebase :S

With this commit, the reconcilers (PipelineRun and TaskRun) now uses
the v1alpha2 part of the struct instead of the old one. In a gist,
this means

- `TaskRun.Inputs.Params` becomes `TaskRun.Params`
- `TaskRun.Inputs.Resources` becomes `TaskRun.Resources.Inputs`
- `TaskRun.Outputs.Resources` becomes `TaskRun.Resources.Outputs`

Kubernetes can only store one version of the CRD, and before 1.17
does not support conversion webhook per-se. *Note* that once we have
conversion webhook it will be simpler ; support for conversion webhook
should land soon-ish in knative.dev/pkg which will allow us to easily
switch to it.

> 1. Pick a conversion strategy. Since custom resource objects need to
> be able to be served at both versions, that means they will
> sometimes be served at a different version than their storage
> version. In order for this to be possible, the custom resource
> objects must sometimes be converted between the version they are
> stored at and the version they are served at. If the conversion
> involves schema changes and requires custom logic, a conversion
> webhook should be used. If there are no schema changes, the default
> None conversion strategy may be used and only the apiVersion field
> will be modified when serving different versions.
> 2. If using conversion webhooks, create and deploy the conversion
> webhook. See the Webhook conversion for more details.

As written above, we can only store one version on the CRD and we want
to serve multilple. To keep the latest API the cleanest (here
`v1alpha2`), we are using `v1alpha1` and making sure that `v1alpha1`
struct are compatible (aka a `v1alpha2` struct can be serialized in a
`v1alpha1` struct so that it can be stored). This is what the
auto-conversion role is :

- take a version and convert it to the most recent version (here
  `v1alpha2`)
- then store it as the lowest version (here `v1alpha1`)

For the controller this means we still work with `v1alpha1`
struct *but* with only the part that is compatible with
`v1alpha2`.

One follow-up will be to rename the `v1alpha1` field that are not used
anymore, prepending them with `Deprecated`.

Signed-off-by: Vincent Demeester <[email protected]>
- move current examples in `examples/v1alpha1`
- copy and migrate those examples for `v1alpha1` (in `examples/v1alpha2`)

Signed-off-by: Vincent Demeester <[email protected]>
Let's go directly to v1beta1 and do several RC releases 👼

Signed-off-by: Vincent Demeester <[email protected]>
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_defaults.go 80.0% 53.8% -26.2
pkg/apis/pipeline/v1alpha1/task_validation.go 88.6% 83.9% -4.7
pkg/apis/pipeline/v1alpha1/taskrun_validation.go 96.2% 93.0% -3.2
pkg/apis/pipeline/v1beta1/cluster_task_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/cluster_task_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/cluster_task_types.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/cluster_task_validation.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/conversion_error.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/merge.go Do not exist 72.4%
pkg/apis/pipeline/v1beta1/param_types.go Do not exist 94.7%
pkg/apis/pipeline/v1beta1/pipeline_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/pipeline_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/pipeline_types.go Do not exist 82.4%
pkg/apis/pipeline/v1beta1/pipeline_validation.go Do not exist 94.2%
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/pipelinerun_defaults.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/pipelinerun_types.go Do not exist 90.0%
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go Do not exist 95.5%
pkg/apis/pipeline/v1beta1/register.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/resource_types.go Do not exist 89.3%
pkg/apis/pipeline/v1beta1/resource_types_validation.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/substitution.go Do not exist 17.8%
pkg/apis/pipeline/v1beta1/task_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/task_defaults.go Do not exist 66.7%
pkg/apis/pipeline/v1beta1/task_types.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/task_validation.go Do not exist 83.8%
pkg/apis/pipeline/v1beta1/taskrun_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/taskrun_defaults.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/taskrun_types.go Do not exist 71.4%
pkg/apis/pipeline/v1beta1/taskrun_validation.go Do not exist 97.2%
pkg/apis/pipeline/v1beta1/workspace_types.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/workspace_validation.go Do not exist 100.0%
test/builder/task.go 81.5% 70.2% -11.3

@tektoncd tektoncd deleted a comment from tekton-robot Mar 2, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Mar 2, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Mar 2, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Mar 2, 2020
@tektoncd tektoncd deleted a comment from tekton-robot Mar 2, 2020
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/task_defaults.go 80.0% 53.8% -26.2
pkg/apis/pipeline/v1alpha1/task_validation.go 88.6% 83.9% -4.7
pkg/apis/pipeline/v1alpha1/taskrun_validation.go 96.2% 93.0% -3.2
pkg/apis/pipeline/v1beta1/cluster_task_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/cluster_task_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/cluster_task_types.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/cluster_task_validation.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/conversion_error.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/merge.go Do not exist 72.4%
pkg/apis/pipeline/v1beta1/param_types.go Do not exist 94.7%
pkg/apis/pipeline/v1beta1/pipeline_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/pipeline_defaults.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/pipeline_types.go Do not exist 82.4%
pkg/apis/pipeline/v1beta1/pipeline_validation.go Do not exist 94.2%
pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/pipelinerun_defaults.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/pipelinerun_types.go Do not exist 90.0%
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go Do not exist 95.5%
pkg/apis/pipeline/v1beta1/register.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/resource_types.go Do not exist 89.3%
pkg/apis/pipeline/v1beta1/resource_types_validation.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/substitution.go Do not exist 17.8%
pkg/apis/pipeline/v1beta1/task_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/task_defaults.go Do not exist 66.7%
pkg/apis/pipeline/v1beta1/task_types.go Do not exist 0.0%
pkg/apis/pipeline/v1beta1/task_validation.go Do not exist 83.8%
pkg/apis/pipeline/v1beta1/taskrun_conversion.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/taskrun_defaults.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/taskrun_types.go Do not exist 71.4%
pkg/apis/pipeline/v1beta1/taskrun_validation.go Do not exist 97.2%
pkg/apis/pipeline/v1beta1/workspace_types.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/workspace_validation.go Do not exist 100.0%
test/builder/task.go 81.5% 70.2% -11.3

- name: url
value: https://github.com/tektoncd/pipeline
---
apiVersion: tekton.dev/v1beta1
Copy link

Choose a reason for hiding this comment

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

🎉

@ghost
Copy link

ghost commented Mar 2, 2020

re-adding the lgtm so that 🤞 it merges once tests pass

/lgtm

@tekton-robot tekton-robot assigned ghost Mar 2, 2020
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2020
@tekton-robot tekton-robot merged commit 97a0c45 into tektoncd:master Mar 2, 2020
@ghost
Copy link

ghost commented Mar 2, 2020

ERMERGERD it merged.

@vdemeester vdemeester deleted the expose-v1alpha2 branch March 2, 2020 14:40
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. area/api Indicates an issue or PR that deals with the API. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm Indicates that a PR is ready to be merged. 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.

Create a v1alpha2 apiVersion
5 participants