-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Migrate PipelineResource in their own package… 📦 #1773
Migrate PipelineResource in their own package… 📦 #1773
Conversation
The following is the coverage report on pkg/.
|
/test pull-tekton-pipeline-integration-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for taking on all this finicky work 🙏
This doesn't change yet the current webhook and controller, and does
not expose PipelineResource.resource.tekton.dev (current exposed are
PipelineResource.tekton.dev).
I think it makes a lot of sense to move the code, but I'm a bit confused by why we want to add a new API group - looking at our other types, and even looking at triggers types such as trigger bindings they are still in the tekton.dev
group (or maybe this is a mistake and the group should be different?), so I don't quite understand why we want pipelineresources to be an exceptional case 🤔
cmd/webhook/main.go
Outdated
v1alpha1.SchemeGroupVersion.WithKind("Task"): &v1alpha1.Task{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("ClusterTask"): &v1alpha1.ClusterTask{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("TaskRun"): &v1alpha1.TaskRun{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("PipelineRun"): &v1alpha1.PipelineRun{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("Condition"): &v1alpha1.Condition{}, | ||
v1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &v1alpha1.PipelineResource{}, | ||
// resourcev1alpha1.SchemeGroupVersion.WithKind("PipelineResource"): &resourcev1alpha1.PipelineResource{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe accidentally included? Or if this is the line that exposes the API and we want to uncomment it later, maybe a comment above with an issue number explaining?
}) | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like some of these files are duplicated vs. moved? e.g. would https://github.com/tektoncd/pipeline/blob/master/pkg/apis/pipeline/v1alpha1/pipelineresource_validation_test.go still exist after this PR?
Right, on The main problem I've got, so far, is that I did not manage to make the codegenerator(s) work with two distinct package serving the exact same api group (the clients are from one package only making the thing useless). I am still trying to figure out how to do that, as it would definitely simplify that pull request. That said, I think we may discuss |
Ah okay, so in that case maybe we should have I'm still not sure it would make sense to put resources in it's own group 🤔 on the other hand that might fit well with some of the plans @sbwsg and I have been scheming 😈
I think it'd be better if we could get this to work, esp. if the main problem is that the tool doesn't work. If you want to write up an issue and get any of the rest of us to take a stab at it just say the word!! happy to help :D |
fe89773
to
1ffb260
Compare
494f369
to
fe3b432
Compare
@bobcatfish should be fixed now, no more different apiGroup. |
fe3b432
to
cd085c2
Compare
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
cd085c2
to
a2467c4
Compare
The following is the coverage report on pkg/.
|
a2467c4
to
0c4f9cd
Compare
The following is the coverage report on pkg/.
|
0c4f9cd
to
3dde233
Compare
The following is the coverage report on pkg/.
|
3dde233
to
c9d4361
Compare
The following is the coverage report on pkg/.
|
c9d4361
to
4d617cb
Compare
The following is the coverage report on pkg/.
|
4d617cb
to
3600fe0
Compare
The following is the coverage report on pkg/.
|
@bobcatfish @sbwsg this should be ready for review 👼 |
/hold cancel |
This is mainly done to separate the `PipelineResource` from the rest of the API *and* remove the dependency cycle that we get by keeping `PipelineResource` in alpha. This update the code generation to generate a different set of clients, informers, clientsets, … for `resource`, although it is exposed in the same apiGroup. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
3600fe0
to
30b421b
Compare
The following is the coverage report on pkg/.
|
bash ${REPO_ROOT_DIR}/hack/generate-knative.sh "injection" \ | ||
github.com/tektoncd/pipeline/pkg/client github.com/tektoncd/pipeline/pkg/apis \ | ||
"pipeline:v1alpha1,v1alpha2" \ | ||
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt | ||
GOFLAGS="${OLDGOFLAGS}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to add some comments around the enw lines in this script explaining what they do? and/or explain in the commit message? iirc from the previous review, it was not obvious what you had to do to make this work without a different apigroup, might be useful to record how this ended up working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this comes from #1783.. forgot to mention that 😂 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to update comments on the bash …
calls though, to explain why there is 2 indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk! happy for that to be in follow up PR :)
/lgtm thanks again for all your hard work @vdemeester 🙏 😭 🙇♀ |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bobcatfish 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 |
Changes
Extracts PipelineResource in their own package while still being exposed in
tekton.dev
. This is require to support embedded PipelineResource inv1alpha2
with PipelineResource still being alpha (akav1alpha1
).pkg/apis/resource/v1alpha1
package which holdsPipelineResource
struct and related.pkg/client/resource
package (in addition to thepkg/client
package) for thePipelineResource
generated clients, lister, … code.… and API group (resource.tekton.dev
). This is mainly done toseparate the
PipelineResource
from the rest of the API and removethe dependency cycle that we get by keeping
PipelineResource
inalpha.
This doesn't change yet the current webhook and controller, and does
not expose
PipelineResource.resource.tekton.dev
(current exposed arePipelineResource.tekton.dev
).We can expose this and support this once we expose
v1alpha2
(orv1beta1
). We will need to auto-convertPipelineResource.tekton.dev
to
PipelineResource.resource.tekton.dev
, the easiest way would be tohave a controller handling that.
This comes from this comment #1725 (comment) 👼 .
This is an experiment, seeing if it make sense. Without this, it is very difficult to support embedded PipelineResource in
v1alpha2
(or I am missing something really obvious 😝 )/hold
/cc @bobcatfish
Signed-off-by: Vincent Demeester vdemeest@redhat.com
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:
cmd
dir, please updatethe release Task to build and release this image.
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.