-
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
Concise Yaml for pipeline declaration. #138
Comments
One way to address this is removing |
Before this change, Tasks were retrieving the Resources to use by looking for PipelineResources with exactly the name that the Resource is declared with in the Task. This means that the Resource binding in Pipelines (and TaskRuns) was doing absolutely nothing. Instead, we now map bound Resources inside of TaskRuns. The name of a Resource declared in a Task is a _parameter_, which we fulfill by providing the _key_ aka parameter of the Task, and the corresponding Resource reference we should use for that _key_. This allows us to use the same Task with different Resources without having to change the Task or the Resource. This was not caught by any tests because the tests were co-incidentally using the same name for the Resources and the Resource key/name/parameter in the Task. Now the tests use different names. This came up while creating example yaml for #89 - as soon as I tried to use two different git resources (one upstream, one my fork) I realized that the mapping was not working. This also partially addresses tektoncd#138 by removing the `Name` field from the bindings, which is not required.
I took a quick look through our example yaml and these are the things I noticed that we might not need:
At the moment it also looks like |
Before this change, Tasks were retrieving the Resources to use by looking for PipelineResources with exactly the name that the Resource is declared with in the Task. This means that the Resource binding in Pipelines (and TaskRuns) was doing absolutely nothing. Instead, we now map bound Resources inside of TaskRuns. The name of a Resource declared in a Task is a _parameter_, which we fulfill by providing the _key_ aka parameter of the Task, and the corresponding Resource reference we should use for that _key_. This allows us to use the same Task with different Resources without having to change the Task or the Resource. This was not caught by any tests because the tests were co-incidentally using the same name for the Resources and the Resource key/name/parameter in the Task. Now the tests use different names. This came up while creating example yaml for #89 - as soon as I tried to use two different git resources (one upstream, one my fork) I realized that the mapping was not working. This also partially addresses tektoncd#138 by removing the `Name` field from the bindings, which is not required.
Before this change, Tasks were retrieving the Resources to use by looking for PipelineResources with exactly the name that the Resource is declared with in the Task. This means that the Resource binding in Pipelines (and TaskRuns) was doing absolutely nothing. Instead, we now map bound Resources inside of TaskRuns. The name of a Resource declared in a Task is a _parameter_, which we fulfill by providing the _key_ aka parameter of the Task, and the corresponding Resource reference we should use for that _key_. This allows us to use the same Task with different Resources without having to change the Task or the Resource. This was not caught by any tests because the tests were co-incidentally using the same name for the Resources and the Resource key/name/parameter in the Task. Now the tests use different names. This came up while creating example yaml for #89 - as soon as I tried to use two different git resources (one upstream, one my fork) I realized that the mapping was not working. This also partially addresses tektoncd#138 by removing the `Name` field from the bindings, which is not required. This addresses part of #64 by adding templating from outputs.
At @dlorenc's talk at Devops World/Jenkins World (augh awkward long conference names), and in discussions he and I had during the conference, he advocated for the idea that the Build Pipeline YAML is the "machine code" (for lack of a better term), which can be generated either via an editor or through transformation from another syntax. I'm intending down the road to add support for transforming Jenkins Declarative Pipeline syntax into Build Pipeline YAML, e.g. I mention this because I think it is important to have the canonical representation be clearly unambiguous and useful for transformation from/to other forms, and for utilization in whatever implementation of Build Pipeline. That said, the particular cases cited above do seem to not create any ambiguity if they were removed, so hey. =) |
That's an interesting point @abayer , so I think this would imply that the users of the YAML are the tools generating it, and the APIs consuming it, but not actually the end users of the Pipeline itself, is that accurate? (+ @tejal29 ) |
Well, optionally - it may be better to think of it as end users may be writing the YAML directly, but an implementation/utilization of Build Pipeline may use a different syntax (like I mentioned, in my specific case, I'm thinking about migration paths for existing Jenkins users of its Declarative Pipeline syntax) that "transpiles" down to the standard YAML. My thinking is heavily influenced by the idea of Build Pipeline as a spec as much as an implementation - I'm focused on the authoring experience (admittedly from the Jenkins perspective currently) and absolutely adore the idea of a standard definition of what a Pipeline can do that you can expect to have working on any implementation of the Build Pipeline "spec", with at the very least the same conceptual model and building blocks across the board. |
Note to self: Also need to update user study in @tejal29 's branch and decide where to put user study. |
@abayer i agree with your view that the yaml should be as unambiguous as it can and if it leads to very very long config, we can create tools for better user experience. |
yes, but we need to support both consumers (real users and tool) until we provide a tool which does that. |
To clarify my thoughts a little further - we'll basically have two classes of users here (I think this is true for basically all Kubernetes yamls today): the users interfacing with Kubernetes directly and the users interfacing with higher level tooling built on top of Kubernetes. In the long term we'll likely have way more of the second class of user - people using this through other systems. In the short term, we don't have any of those systems yet :) I think we need to make sure the system is designed for both use-cases. YAML isn't a great user experience no matter how simple we make it, so we should expect and design for systems built on top. But that's not an excuse to make this overly verbose and complicated now, otherwise no one will be able to understand it enough to build something on top. |
Before this change, Tasks were retrieving the Resources to use by looking for PipelineResources with exactly the name that the Resource is declared with in the Task. This means that the Resource binding in Pipelines (and TaskRuns) was doing absolutely nothing. Instead, we now map bound Resources inside of TaskRuns. The name of a Resource declared in a Task is a _parameter_, which we fulfill by providing the _key_ aka parameter of the Task, and the corresponding Resource reference we should use for that _key_. This allows us to use the same Task with different Resources without having to change the Task or the Resource. This was not caught by any tests because the tests were co-incidentally using the same name for the Resources and the Resource key/name/parameter in the Task. Now the tests use different names. This came up while creating example yaml for #89 - as soon as I tried to use two different git resources (one upstream, one my fork) I realized that the mapping was not working. This also partially addresses tektoncd#138 by removing the `Name` field from the bindings, which is not required. This addresses part of #64 by adding templating from outputs.
Before this change, Tasks were retrieving the Resources to use by looking for PipelineResources with exactly the name that the Resource is declared with in the Task. This means that the Resource binding in Pipelines (and TaskRuns) was doing absolutely nothing. Instead, we now map bound Resources inside of TaskRuns. The name of a Resource declared in a Task is a _parameter_, which we fulfill by providing the _key_ aka parameter of the Task, and the corresponding Resource reference we should use for that _key_. This allows us to use the same Task with different Resources without having to change the Task or the Resource. This was not caught by any tests because the tests were co-incidentally using the same name for the Resources and the Resource key/name/parameter in the Task. Now the tests use different names. This came up while creating example yaml for #89 - as soon as I tried to use two different git resources (one upstream, one my fork) I realized that the mapping was not working. This also partially addresses #138 by removing the `Name` field from the bindings, which is not required. This addresses part of #64 by adding templating from outputs.
In the interests in keeping our spec as lean and simple as it can possibly be, at the moment there is no reason why our Results config needs to have a name, so let's remove it. This is the last unnecessary field we have in our yamls that I'm aware of, so this fixes tektoncd#138
In the interests in keeping our spec as lean and simple as it can possibly be, at the moment there is no reason why our Results config needs to have a name, so let's remove it. This is the last unnecessary field we have in our yamls that I'm aware of, so this fixes tektoncd#138
In the interests in keeping our spec as lean and simple as it can possibly be, at the moment there is no reason why our Results config needs to have a name, so let's remove it. This is the last unnecessary field we have in our yamls that I'm aware of, so this fixes tektoncd#138
In the interests in keeping our spec as lean and simple as it can possibly be, at the moment there is no reason why our Results config needs to have a name, so let's remove it. This is the last unnecessary field we have in our yamls that I'm aware of, so this fixes tektoncd#138
In the interests in keeping our spec as lean and simple as it can possibly be, at the moment there is no reason why our Results config needs to have a name, so let's remove it. This is the last unnecessary field we have in our yamls that I'm aware of, so this fixes #138
Expected Behavior
user should be able to write minimal lines of yaml to declare a pipeline.
Actual Behavior
we end up writing a number of redundant fields like "name" in inputSourceBindings might not be required.
Steps to Reproduce the Problem
Additional Info
The text was updated successfully, but these errors were encountered: