-
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
TEP-0118: Add validation for matrix pipeline context parameter variables #6238
TEP-0118: Add validation for matrix pipeline context parameter variables #6238
Conversation
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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 @EmmaMunley! it looks like your commit message/PR description describe the changes to context variable validation, but not param type validation. Can you update them to reflect all the changes in this PR?
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
f5a07ad
to
ee1fcb1
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
ee1fcb1
to
58a9d3b
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
58a9d3b
to
b2fed33
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
…les include Matrix.Include.Params [TEP-0090: Matrix] introduced `Matrix` to the `PipelineTask` specification such that the `PipelineTask` executes a list of `TaskRuns` or `Runs` in parallel with the specified list of inputs for a `Parameter` or with different combinations of the inputs for a set of `Parameters`. To build on this, Tep-0018 introduced Matrix.Include, which allows passing in a specific combinations of `Parameters` into the `Matrix`. This commit validates that matrix pipeline context parameter variables including include params are used appropriately. Note: This is still in preview mode. Other forms of validation and implementation logic will be added in subsequent commits.
b2fed33
to
8a721b3
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
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.
@EmmaMunley - Thanks for breaking this up into small PRs!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop 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 |
@@ -184,13 +184,25 @@ func validatePipelineContextVariables(tasks []PipelineTask) *apis.FieldError { | |||
var paramValues []string | |||
for _, task := range tasks { | |||
var matrixParams []Param | |||
var includeParams []Param |
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.
Just having a discussion in other PR #6180, we could introduce a new type and use that instead of []Param
:
type Params []Param
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.
Not a blocker for this PR though!
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.
Hey @EmmaMunley, please make sure to follow up on this once PR #6180 is resolved.
for _, param := range append(task.Params, matrixParams...) { | ||
paramValues = append(paramValues, param.Value.StringVal) | ||
paramValues = append(paramValues, param.Value.ArrayVal...) | ||
} | ||
|
||
if task.Matrix.MatrixHasInclude() { | ||
for _, param := range append(task.Params, includeParams...) { | ||
paramValues = append(paramValues, param.Value.StringVal) | ||
} | ||
} |
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.
We could leverage a common function retrieving values from params:
Also at this point in the execution, it must be safe to rely on this member function Params.extractParamValuesFromParams
which is collecting values from an objects as well since we have a validation upfront for limiting such usage.
/lgtm Thank you @EmmaMunley 👍 Also, please highlight the changes in the PR description since it's a part of a bigger effort. This PR validates that matrix pipeline context parameter variables including include params are used appropriately. |
[TEP-0090: Matrix] introduced `Matrix` to the `PipelineTask` specification such that the `PipelineTask` executes a list of `TaskRuns` or `Runs` in parallel with the specified list of inputs for a `Parameter` or with different combinations of the inputs for a set of `Parameters`. To build on this, Tep-0018 introduced Matrix.Include, which allows passing in a specific combinations of `Parameters` into the `Matrix`. **This commit adds isolated functionality testing for valid and invalid matrix context as a follow up to tektoncd#6238.** Note: This is still in preview mode. Implementation logic will be added in subsequent commits.
[TEP-0090: Matrix] introduced `Matrix` to the `PipelineTask` specification such that the `PipelineTask` executes a list of `TaskRuns` or `Runs` in parallel with the specified list of inputs for a `Parameter` or with different combinations of the inputs for a set of `Parameters`. To build on this, Tep-0018 introduced Matrix.Include, which allows passing in a specific combinations of `Parameters` into the `Matrix`. **This commit adds isolated functionality testing for valid and invalid matrix context as a follow up to tektoncd#6238.** Note: This is still in preview mode. Implementation logic will be added in subsequent commits.
[TEP-0090: Matrix] introduced `Matrix` to the `PipelineTask` specification such that the `PipelineTask` executes a list of `TaskRuns` or `Runs` in parallel with the specified list of inputs for a `Parameter` or with different combinations of the inputs for a set of `Parameters`. To build on this, Tep-0018 introduced Matrix.Include, which allows passing in a specific combinations of `Parameters` into the `Matrix`. **This commit adds isolated functionality testing for valid and invalid matrix context as a follow up to tektoncd#6238.** Note: This is still in preview mode. Implementation logic will be added in subsequent commits.
[TEP-0090: Matrix] introduced `Matrix` to the `PipelineTask` specification such that the `PipelineTask` executes a list of `TaskRuns` or `Runs` in parallel with the specified list of inputs for a `Parameter` or with different combinations of the inputs for a set of `Parameters`. To build on this, Tep-0018 introduced Matrix.Include, which allows passing in a specific combinations of `Parameters` into the `Matrix`. **This commit adds isolated functionality testing for valid and invalid matrix context as a follow up to tektoncd#6238.** Note: This is still in preview mode. Implementation logic will be added in subsequent commits.
[TEP-0090: Matrix] introduced
Matrix
to thePipelineTask
specification such that thePipelineTask
executes a list ofTaskRuns
orRuns
in parallel with the specified list of inputs for aParameter
or with different combinations of the inputs for a set ofParameters
.To build on this TEP-0018 introduced Matrix.Include, which allows passing in a specific combinations of
Parameters
into theMatrix
.This PR validates that matrix pipeline context parameter variables including include params are used appropriately.
Note: This is still in preview mode. Other forms of validation and implementation logic will be added in subsequent commits.
/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