Skip to content

Conversation

vdemeester
Copy link
Member

Changes

This adds versions for the builder: v1alpha1 and v1beta1.

This also migrate the builder to internal/builder while keeping an
alias on test/builder for user of this package (marking it as
deprecated).

Those are in the internal package so only this project can refer them (making it easier to remove later on as nobody from the outside will depend on them).
This is in preparation of #2410 as… well… builders are gonna be needed for v1beta1 (or… it will take ages to do 😹 ).

This feels big but there is not much net new code:

  • It's moving files around (test/builder -> internal/builder/v1alpha1)
  • It's adding a whole new builder package (internal/builder/v1beta1) based on internal/builder/v1alpha1 but with the v1beta1 API

Signed-off-by: Vincent Demeester [email protected]

/cc @afrittoli @dibyom @bobcatfish @imjasonh

Submitter Checklist

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

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.

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 4, 2020
@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
internal/builder/v1alpha1/condition.go Do not exist 100.0%
internal/builder/v1alpha1/param.go Do not exist 100.0%
internal/builder/v1alpha1/pipeline.go Do not exist 83.6%
internal/builder/v1alpha1/sidecar.go Do not exist 66.7%
internal/builder/v1alpha1/step.go Do not exist 19.0%
internal/builder/v1alpha1/task.go Do not exist 68.6%
internal/builder/v1beta1/container.go Do not exist 91.7%
internal/builder/v1beta1/owner_reference.go Do not exist 100.0%
internal/builder/v1beta1/param.go Do not exist 100.0%
internal/builder/v1beta1/pipeline.go Do not exist 83.0%
internal/builder/v1beta1/pod.go Do not exist 78.0%
internal/builder/v1beta1/resource.go Do not exist 88.9%
internal/builder/v1beta1/sidecar.go Do not exist 66.7%
internal/builder/v1beta1/step.go Do not exist 19.0%
internal/builder/v1beta1/task.go Do not exist 76.3%

@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
internal/builder/v1alpha1/condition.go Do not exist 100.0%
internal/builder/v1alpha1/param.go Do not exist 100.0%
internal/builder/v1alpha1/pipeline.go Do not exist 83.6%
internal/builder/v1alpha1/sidecar.go Do not exist 66.7%
internal/builder/v1alpha1/step.go Do not exist 19.0%
internal/builder/v1alpha1/task.go Do not exist 68.6%
internal/builder/v1beta1/container.go Do not exist 91.7%
internal/builder/v1beta1/owner_reference.go Do not exist 100.0%
internal/builder/v1beta1/param.go Do not exist 100.0%
internal/builder/v1beta1/pipeline.go Do not exist 83.0%
internal/builder/v1beta1/pod.go Do not exist 78.0%
internal/builder/v1beta1/resource.go Do not exist 88.9%
internal/builder/v1beta1/sidecar.go Do not exist 66.7%
internal/builder/v1beta1/step.go Do not exist 19.0%
internal/builder/v1beta1/task.go Do not exist 76.3%

@bobcatfish
Copy link
Collaborator

@vdemeester i think you tried to explain this to me in chat but I don't quite understand why we need 2 versions of the builders? esp. if we're going to be able to rely on having only 1 type to interact with in the tekton controller, which is my understanding of the finished state of updating the storage types.

builders are gonna be needed for v1beta1 (or… it will take ages to do 😹 ).

Or is the idea that the next step would be to delete the v1alpha1 builders?

@imjasonh
Copy link
Member

imjasonh commented May 4, 2020

I would like to take this opportunity to commit to a goal of phasing out test builders entirely, after these changes are in place. Phasing out test builders shouldn't block "real" work like updating the storage version, but since this will move them to internal packages, we should just commit to removing them, with a reasonable deadline.

If this seems reasonable I can write a real issue to track it, with justifications and timelines, and assign it to myself. If not, I'd like to convince you that it is reasonable and still do it. 😄

@afrittoli
Copy link
Member

I would like to take this opportunity to commit to a goal of phasing out test builders entirely, after these changes are in place. Phasing out test builders shouldn't block "real" work like updating the storage version, but since this will move them to internal packages, we should just commit to removing them, with a reasonable deadline.

If this seems reasonable I can write a real issue to track it, with justifications and timelines, and assign it to myself. If not, I'd like to convince you that it is reasonable and still do it. 😄

I think test code will be more transparent without the builders. It may be non-obvious in some cases how to build an object, but a good reference example should be enough to cover that.

@vdemeester
Copy link
Member Author

vdemeester commented May 5, 2020

@vdemeester i think you tried to explain this to me in chat but I don't quite understand why we need 2 versions of the builders? esp. if we're going to be able to rely on having only 1 type to interact with in the tekton controller, which is my understanding of the finished state of updating the storage types.

builders are gonna be needed for v1beta1 (or… it will take ages to do joy_cat ).

Or is the idea that the next step would be to delete the v1alpha1 builders?

@bobcatfish There is multiple answer to the "2 versions". There is 2 versions of the APIs, if we do builder for the api it make sense to have 2 version of the builder — I mean, why not, especially if we use them in tests (we are testing v1alpha1 and v1beta1 in e2e for example). But, yes the idea is the "next" step (after #2410) will be to remove the v1alpha1 builders (and in general most likely all).

I would like to take this opportunity to commit to a goal of phasing out test builders entirely, after these changes are in place. Phasing out test builders shouldn't block "real" work like updating the storage version, but since this will move them to internal packages, we should just commit to removing them, with a reasonable deadline.

If this seems reasonable I can write a real issue to track it, with justifications and timelines, and assign it to myself. If not, I'd like to convince you that it is reasonable and still do it. smile

@imjasonh Yes 👍 We may need alternative for verbose cases (a fromYaml methods or whatever), but in a gist I am fine with that.

The main goal here is:

  1. make it so that people don't depend on it (hence the internal) — we need to put a deprecation notice on test/builder so that we can remove it in a few releases.
  2. make it more easy to do Change the storage version to v1beta1 types #2410 – and more quick ; and also more easy to review.
  3. Once Change the storage version to v1beta1 types #2410 is don

I would like to take this opportunity to commit to a goal of phasing out test builders entirely, after these changes are in place. Phasing out test builders shouldn't block "real" work like updating the storage version, but since this will move them to internal packages, we should just commit to removing them, with a reasonable deadline.
If this seems reasonable I can write a real issue to track it, with justifications and timelines, and assign it to myself. If not, I'd like to convince you that it is reasonable and still do it. smile
e, the v1alpha1 builder should be only used in a few places (most likely only in test/v1alpha1)

  1. From there on we can phase out the builder

I think test code will be more transparent without the builders. It may be non-obvious in some cases how to build an object, but a good reference example should be enough to cover that.

@afrittoli So the goal is to have test readable and with the least "noise". That said, builders didn't really achieve what I had in mind initially… 😓

@vdemeester
Copy link
Member Author

The linting should be fixed 🤞

@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
internal/builder/v1alpha1/condition.go Do not exist 100.0%
internal/builder/v1alpha1/param.go Do not exist 100.0%
internal/builder/v1alpha1/pipeline.go Do not exist 83.6%
internal/builder/v1alpha1/sidecar.go Do not exist 66.7%
internal/builder/v1alpha1/step.go Do not exist 19.0%
internal/builder/v1alpha1/task.go Do not exist 68.4%
internal/builder/v1beta1/container.go Do not exist 91.7%
internal/builder/v1beta1/owner_reference.go Do not exist 100.0%
internal/builder/v1beta1/param.go Do not exist 100.0%
internal/builder/v1beta1/pipeline.go Do not exist 83.0%
internal/builder/v1beta1/pod.go Do not exist 78.0%
internal/builder/v1beta1/resource.go Do not exist 88.9%
internal/builder/v1beta1/sidecar.go Do not exist 66.7%
internal/builder/v1beta1/step.go Do not exist 19.0%
internal/builder/v1beta1/task.go Do not exist 76.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
internal/builder/v1alpha1/condition.go Do not exist 100.0%
internal/builder/v1alpha1/param.go Do not exist 100.0%
internal/builder/v1alpha1/pipeline.go Do not exist 83.6%
internal/builder/v1alpha1/sidecar.go Do not exist 66.7%
internal/builder/v1alpha1/step.go Do not exist 19.0%
internal/builder/v1alpha1/task.go Do not exist 68.4%
internal/builder/v1beta1/container.go Do not exist 91.7%
internal/builder/v1beta1/owner_reference.go Do not exist 100.0%
internal/builder/v1beta1/param.go Do not exist 100.0%
internal/builder/v1beta1/pipeline.go Do not exist 83.0%
internal/builder/v1beta1/pod.go Do not exist 78.0%
internal/builder/v1beta1/resource.go Do not exist 88.9%
internal/builder/v1beta1/sidecar.go Do not exist 66.7%
internal/builder/v1beta1/step.go Do not exist 19.0%
internal/builder/v1beta1/task.go Do not exist 76.1%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 75.6% 76.7% 1.2

This adds versions for the builder: v1alpha1 and v1beta1.

This also migrate the builder to `internal/builder` while keeping an
alias on `test/builder` for user of this package (marking it as
deprecated).

Signed-off-by: Vincent Demeester <[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
internal/builder/v1alpha1/condition.go Do not exist 100.0%
internal/builder/v1alpha1/param.go Do not exist 100.0%
internal/builder/v1alpha1/pipeline.go Do not exist 83.6%
internal/builder/v1alpha1/sidecar.go Do not exist 66.7%
internal/builder/v1alpha1/step.go Do not exist 19.0%
internal/builder/v1alpha1/task.go Do not exist 68.4%
internal/builder/v1beta1/container.go Do not exist 91.7%
internal/builder/v1beta1/owner_reference.go Do not exist 100.0%
internal/builder/v1beta1/param.go Do not exist 100.0%
internal/builder/v1beta1/pipeline.go Do not exist 83.0%
internal/builder/v1beta1/pod.go Do not exist 78.0%
internal/builder/v1beta1/resource.go Do not exist 88.9%
internal/builder/v1beta1/sidecar.go Do not exist 66.7%
internal/builder/v1beta1/step.go Do not exist 19.0%
internal/builder/v1beta1/task.go Do not exist 76.1%

@chmouel
Copy link
Member

chmouel commented May 7, 2020

Hard to review the full thing but from what I understand it is just a migration between alpha to beta until we get rid of the builders

so that sounds good to me,

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 7, 2020
Copy link
Member

@afrittoli afrittoli 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 this.
/approve

cleanup) of the tests should be as small as possible to avoid the noise. Those
builders exists to help with that.

There is currently two versionned builder supported:
Copy link
Member

Choose a reason for hiding this comment

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

NIT: There are currently two versioned builders supported:

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli

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 May 7, 2020
@vdemeester
Copy link
Member Author

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label May 7, 2020
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@tekton-robot tekton-robot merged commit 2201e1b into tektoncd:master May 7, 2020
@vdemeester vdemeester deleted the internal-builder branch May 7, 2020 15:28
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/misc Categorizes issue or PR as a miscellaneuous one. 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.

6 participants