-
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-0107: propagate results to embedded task spec #7100
TEP-0107: propagate results to embedded task spec #7100
Conversation
/kind feature |
/hold |
The following is the coverage report on the affected files.
|
1155c16
to
9f28178
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/assign |
9f28178
to
39bfe9f
Compare
/hold cancel |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
docs/pipelineruns.md
Outdated
Metadata: | ||
... | ||
Spec: | ||
Task Spec: |
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.
nit: the yaml seems to need some formatting: apiVersion, taskSpec and etc.
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.
done~
stringReplacements[fmt.Sprintf("tasks.%s.results.%s", taskName, res.Name)] = res.Value.StringVal | ||
case v1.ResultsTypeArray: | ||
arrayReplacements[fmt.Sprintf("tasks.%s.results.%s", taskName, res.Name)] = res.Value.ArrayVal | ||
case v1.ResultsTypeObject: |
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.
Wondering what is propagation for ResultsTypeObject?
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 put the ResultsTypeObject into stringReplacements
In the following way:
for k, v := range res.Value.ObjectVal {
stringReplacements[fmt.Sprintf("tasks.%s.results.%s.%s", taskName, res.Name, k)] = v
}
@@ -497,6 +497,21 @@ func (pt *PipelineTask) extractAllParams() Params { | |||
return allParams | |||
} | |||
|
|||
func (pt *PipelineTask) GetVarSubstitutionExpressions() ([]string, bool) { |
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.
Shall we add some more docString for this since it is an exported func?
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.
added
GetVarSubstitutionExpressions extract all values between the parameters "$(" and ")" of steps and sidecars
var allExpressions []string | ||
if pt.TaskSpec != nil { | ||
for _, step := range pt.TaskSpec.Steps { | ||
stepExpressions, _ := step.GetVarSubstitutionExpressions() |
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.
Could you help me to understand why is the bool return value needed here? It seems that this is implying whether the expressions is of len 0, but the actual returned values are unused.
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 returned bool value is indeed not used. I modified the function and only returned expressions.
39bfe9f
to
07e1121
Compare
98f857f
to
fa87932
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
fa87932
to
7cb7b9c
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
e80923b
to
2539118
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
… reference 2. propagate results to embedded task spec Part of work on issue tektoncd#7086 Signed-off-by: chengjoey <[email protected]>
2539118
to
9be1652
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Thanks! @chitrangpatel , it worked |
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 @chengjoey 🎉
[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 |
/lgtm |
PR tektoncd#7100 introduced a flaky test. When comparing the pipelineRuns and TaskRuns, the results were not sorted. As a result, `cmp.Diff` throws an error sometimes when the order does not match. This PR sorts the TaskRunResults by providing a sort function to `cmp.Diff`. After the fix, running this 20 times consecutively, no flakes were found.
PR #7100 introduced a flaky test. When comparing the pipelineRuns and TaskRuns, the results were not sorted. As a result, `cmp.Diff` throws an error sometimes when the order does not match. This PR sorts the TaskRunResults by providing a sort function to `cmp.Diff`. After the fix, running this 20 times consecutively, no flakes were found.
Changes
Part of work on issue #7086 , passing-results
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes