-
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
Add support for array task results as matrix parameters #6056
Conversation
/retest |
1 similar comment
/retest |
/hold |
@@ -178,7 +178,7 @@ func ApplyTaskResults(targets PipelineRunState, resolvedResultRefs ResolvedResul | |||
pipelineTask := resolvedPipelineRunTask.PipelineTask.DeepCopy() | |||
pipelineTask.Params = replaceParamValues(pipelineTask.Params, stringReplacements, arrayReplacements, objectReplacements) | |||
if pipelineTask.IsMatrixed() { | |||
pipelineTask.Matrix.Params = replaceParamValues(pipelineTask.Matrix.Params, stringReplacements, nil, nil) | |||
pipelineTask.Matrix.Params = replaceParamValues(pipelineTask.Matrix.Params, stringReplacements, arrayReplacements, nil) |
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.
would it make sense to handle object replacements too?
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'm not sure if objects actually make sense in a matrix params context - thoughts, @jerop?
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 also don't think we should handle object results - unless we're speaking of getting a particular value from the object as an item in the matrix array, but even then I'd like to leave that out for when we have use cases and explore it in detail
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.
Thank you, never mind, it was a silly comment.
We might support objects in future there, to make it easier for a task to trigger a specific set of combinations of parameters through results, but that would be a new feature.
Given the size of the change, and considering that without the feature "feeding results to a matrix" is incomplete, I would consider this PR for a v0.44.1. v0.44 is an LTS release, and it would be a pity for it to be this close to having this functionality. |
08c0e15
to
21e8fc4
Compare
/hold cancel @afrittoli I agree - #6061 may also make sense to backport. |
21e8fc4
to
d034cd6
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.
thank you @abayer! 🙏🏾
only request is to add some details to the commit message, specifically that array results was supported after matrix was added and add a link to the section of TEP-0090 discussing this feature - https://github.com/tektoncd/community/blob/main/teps/0090-matrix.md#specifying-results-in-the-matrix
@abayer it seems some changes are needed in the validation: |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lbernick 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 |
Oh my, yes, this is a rathole. =) So the problem is that we're checking what the raw parsed type is - which will be a string, not an array, since the value is |
Ok, I have a fix for the validation that I'm fairly happy with, but the next problem is that by the time EDIT: With my validation change (basically just saying "ok, this matrix param is valid if either it's cc @jerop |
fixes tektoncd#5925 Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
d034cd6
to
513a55e
Compare
I've updated the PR with my fix for the validation issue, and with a unit test tweak to use an array result as a matrix parameter, to make it easier to dig into the problem. |
Thanks @abayer for the detailed investigation on this. So it sounds like this:
wdyt? |
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit moves the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: This is only a validation change. Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit moves the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: This is only a validation change. Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
…rameters This commit adds support for using whole array PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
…arameters This commit adds support for using whole array PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
…arameters This commit adds support for using whole array PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
…arameters This commit adds support for using whole array PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit moves the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: This is only a validation change. Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit moves the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: This is only a validation change. Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
This commit adds support for using PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: tektoncd#6056
…arameters This commit adds support for using whole array PipelineRun parameters as matrix parameter values by moving the validation for checking matrix parameter types to after parameter substitution. This is necessary for allowing whole array substitutions using the syntax $(params.foo[*]), rather than an explicit YAML array, to be used as a matrix parameter. Prior to this, validation fails because a string referencing an array type was considered a string type and this was done before the applying array replacements. Note: Whole array replacements for matrix results has not yet been implemented and will be added in a subsequent PR. This issue is described in more detail here: #6056
Changes
fixes #5925
/kind feature
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes