-
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
Only have one set of examples and test that they are valid #109
Conversation
oo i broke building! |
62cf6c3
to
affcf9a
Compare
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.
One comments, but looks good :)
/approve
Needs a rebase though 👼
|
||
```bash | ||
kubectl apply -f examples/pipelines | ||
kubectl apply -f examples/ |
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.
Should we use ko
here ? (like on some other knative
projects ?)
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.
@vdemeester we could but I'm not sure we need to since there's nothing to build - even ko
under the hood I think still calls out to kubectl
(i think?) - but maybe there are some other benefits I'm missing?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bobcatfish, 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:
Approvers can indicate their approval by writing |
resourcesVersion: | ||
- resourceRef: | ||
name: kritis-resources-git | ||
version: 4da79b91e8e37ea441cfe4972565e2184c1a127f | ||
params: | ||
- name: 'makeTarget' | ||
type: 'string' |
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.
Type
does not exist here
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.
whoops, thanks for catching that!
@@ -57,27 +57,14 @@ type Task struct { | |||
// Inputs are the requirements that a task needs to run a Build. | |||
type Inputs struct { | |||
// +optional | |||
Sources []Source `json:"resources,omitempty"` | |||
Resources []TaskResource `json:"resources,omitempty"` |
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.
nice!
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.
Can we also fix:
examples/pipeline_params.yaml
- has a field
token
that doesn't exist in the type definition
examples/invocations/kritis-pipeline-run.yaml
- using
prevTask
andnextTask
that are no longer part of the type definition
I think now that #86 is merged I should probably fix the conditions as well 🤔 |
good call!
ah yeah that's right - I think we're still going to need something to represent the order the tasks executed in 🤔 but i'll remove this till we figure it out! |
We ended up in a state where we had both an `examples` dir and a `samples` dir, and neither were tested, so both were slightly out of sync with each other and the actual types. This was b/c: - When we used kubebuilder, we generated our types from an original set of examples - previously these were in `config/samples` and they ended up in `samples`. We used the validation tests generated by kubebuilder to test these, but when we removed kubebuilder we removed the tests - Before presenting the API to the Build CRD working group, we wanted to have some more complex, real world examples, which @tejal29 created from the `kritis` project and the k8s guestbook example This commit makes sure that all of the functionality demonstrated in `samples` is in `examples`, and removes `samples`. This included: - Fixing `passedConstraints` to be plural as the types expected - Including references to the `PipelineParams` in the `TaskRun` example (removing the duplicated list of result endpoints, since we'll be getting this from the references instead) - Fixing clusterBindings to refer to the actual names of the clusters involved It also adds a step to the integration tests to deploy the examples, which will fail if they do not match the expected schema. At this point they are torn down immediately after creation, but in #108 we can expand this to actually test that they are working. Also had to make some tweaks to the types: - actually including `ClusterBindings` in the `Pipeline` - Using names which include `Resource` instead of `Source`, which we moved away from in #39 Fixes #20
None of these fields are in our current spec, so let's remove them for now. As far as `nextTask` and `prevTask` are concerned, we're still going to need some way to represent the order the Tasks actually executed in while the Pipeline was running (maybe? or would we infer this from the Pipeline?) but we can remove them for now.
Now that #95 has gone in, we have better valiation and it revealed a few more issues in our examples. Now the volume mounting example is probably almost right, not sure until we actually try to use it (and implement templating)
We don't yet have validation implemented for our Runs, but as of #86 we are using the same Conditions as Knative Build: just `Succeeded` (where unknown means running, true means it finished successfully and false means it finished but failed)
affcf9a
to
739b486
Compare
Should be ready for another look @pivotal-nader-ziada @vdemeester ! |
|
||
kubectl delete -f examples/invocations | ||
kubectl delete -f examples/pipelines | ||
kubectl delete -f examples/ |
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.
one advantage of using IDE, it adds new line :)
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 wonder if i need to turn an extension on or something 🤔
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.
/lgtm /hold
// the Task definition, and when provided as an Input, the Name will be the | ||
// path to the volume mounted containing this Resource as an input (e.g. | ||
// an input Resource named `workspace` will be mounted at `/workspace`). | ||
type TaskResource struct { |
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.
nice!
…v0.56.1 feat: upgrade tekton to v0.56.1
We ended up in a state where we had both an
examples
dir and asamples
dir, and neither were tested, so both were slightly out ofsync with each other and the actual types.
This was b/c:
of examples - previously these were in
config/samples
and they endedup in
samples
. We used the validation tests generated by kubebuilderto test these, but when we removed kubebuilder we removed the tests
have some more complex, real world examples, which @tejal29 created
from the
kritis
project and the k8s guestbook exampleThis commit makes sure that all of the functionality demonstrated in
samples
is inexamples
, and removessamples
. This included:passedConstraints
to be plural as the types expectedPipelineParams
in theTaskRun
example(removing the duplicated list of result endpoints, since we'll be
getting this from the references instead)
involved
It also adds a step to the integration tests to deploy the examples,
which will fail if they do not match the expected schema. At this point
they are torn down immediately after creation, but in #108 we can expand
this to actually test that they are working.
Also had to make some tweaks to the types:
ClusterBindings
in thePipeline
Resource
instead ofSource
, which wemoved away from in Initial design ideas for Source #39
Fixes #20