-
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
simplifying matrix combinations #6312
simplifying matrix combinations #6312
Conversation
Skipping CI for Draft Pull Request. |
230ed74
to
7f695cb
Compare
@EmmaMunley this is still WIP but just opened it up for an early review and to unblock your efforts, thanks! |
7f695cb
to
70949c5
Compare
70949c5
to
9a79d28
Compare
@@ -8658,11 +8714,7 @@ The names of the <code>params</code> must match the names of the <code>params</c | |||
<h3 id="tekton.dev/v1beta1.Param">Param | |||
</h3> | |||
<p> | |||
<<<<<<< HEAD |
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 am surprised to see this kind of github tags 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.
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.
#6210
I think we should prioritize this issue-- I will hopefully have some time to look at it
d96db68
to
8c29357
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
8c29357
to
f9c07ed
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
f9c07ed
to
50e272d
Compare
The following is the coverage report on the affected files.
|
50e272d
to
1eb5dc7
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
@@ -8658,11 +8714,7 @@ The names of the <code>params</code> must match the names of the <code>params</c | |||
<h3 id="tekton.dev/v1beta1.Param">Param | |||
</h3> | |||
<p> | |||
<<<<<<< HEAD |
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.
#6210
I think we should prioritize this issue-- I will hopefully have some time to look at it
Name: name, | ||
Value: ParamValue{Type: ParamTypeString, StringVal: value}, | ||
// sortCombination sorts the given Combination based on the param names to produce a deterministic ordering | ||
func (c Combination) sortCombination() ([]string, Combination) { |
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 curious-- would it make sense to sort in tests instead?
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.
Storing the sorted combinations guarantees the same order and its deterministic - sorted based on param names.
We could sort in tests (matrix_types_test.go
and pipelinerun_test.go
) instead (also means sorting will be necessary in any tests we add in future) but I could not figure out how to sort params
in &taskRuns.Items[i]
without making it complicated, please feel free to suggest any fix.
if d := cmp.Diff(expectedTaskRun, &taskRuns.Items[i], ignoreResourceVersion, ignoreTypeMeta); d != "" { |
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.
ok, sorting the params here sounds fine. I was a bit worried about people coming to depend on this functionality even if we don't guarantee it. Maybe we could just note in the docs that param ordering is not guaranteed?
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.
the ordering is only for the internal data structure combinations
([]Params
) which is not exposed to the users.
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 ok, nvm!
Hey @jerop and @lbernick, @EmmaMunley is waiting for this PR, will appreciate if we can expedite the review 🙏 |
I am pair programming with @EmmaMunley to support |
np! feel free to use the "request review" button (I do tend to check emails from GH) or DM me when you need another round |
1eb5dc7
to
e3164f6
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
e3164f6
to
42d941d
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.
one small change requested, happy to merge after it and lee's comment is addressed ,thanks @pritidesai 🙏🏾
Matrix combinations is created in [][]Param format which is very hard to process with matrix.Include. The parameters value can change in a combination or a new combination can be added based on matrix.Include.Params. Its easy to compare and work with map[string]string instead of []Param. Signed-off-by: pritidesai <[email protected]>
42d941d
to
c561322
Compare
thanks @jerop, both yours and @lbernick's comments addressed, thanks! |
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
🎉
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop, 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 |
Thank you Priti for making these changes! This is a big help with moving forward with the FanOut() matrix for include parameters and helped unblocked my PR building on top of this: #6341 |
Changes
Matrix combinations is created in
[][]Param
format which is very hard to process with matrix.Include. The parameters value can change in a combination or a new combination can be added based onmatrix.Include.Params
.Its easy to compare and work with map[string]string instead of []Param.
Now, this combination can be directly consumed while processing
matrix.Include
as demonstrated here: https://play.golang.com/p/Hy48eFFtlVo/kind cleanup
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