-
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
parameterize pipelineTask displayName
#7273
parameterize pipelineTask displayName
#7273
Conversation
The following is the coverage report on the affected files.
|
displayName
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.
this is only applying the replacements on the pipeline task display name, do we want to do the same for pipeline display name? this can be done in future work, just want to understand if it's intentional to not do it for pipelines
please update the docs for displayname in pipelinetasks:
Line 93 in 97184c3
- [`displayName`](#specifying-a-display-name) - a user-facing name of this `Task` within the context of this `Pipeline`. |
@@ -42,7 +42,7 @@ spec: | |||
default: "1" | |||
tasks: | |||
- name: sum-two-numbers | |||
displayName: Calculate the first two numbers | |||
displayName: "Calculate the first two numbers $(params.a)" |
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.
why just passing params a here? Can we have:
displayName: "Calculate the first two numbers $(params.a) + $(params.b)"
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.
yes, we can but the resulting string is not normalized/evaluated and will be displayed as:
"Calculate the first two numbers 1 + 2"
@@ -52,7 +52,7 @@ spec: | |||
- name: b | |||
value: "$(params.b)" | |||
- name: sum-with-third-number | |||
displayName: Sum with the third number | |||
displayName: Sum with the third number - $(tasks.sum-two-numbers.results.sum) |
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.
how about
Sum $(tasks.sum-two-numbers.results.sum) with the third number $(params.c)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Yongxuanzhang 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 |
d883472
to
708345c
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Yes, this PR is only replacing We could definitely extend this support to pipeline and task names if there is a use case.
I have updated the documentation, PTAL 🙏 |
Allow specifying parameters or task results in a displayName. Specifying task results in a displayName does not introduce a resource dependency. Pipeline authors have to specify resource dependency using runAfter or task params. Signed-off-by: Priti Desai <[email protected]>
708345c
to
51a86a4
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest |
/lgtm |
@chmouel: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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
Does this also work within Matrixes? If so can we close off #7082 ? |
This works with matrix but not as expected by #7082. The way we have matrix designed and implemented by creating a list of taskRuns as part of a single pipelineTask, doesn't help to identify different instances of matrix using For example:
The I think we might have to go with your proposed design of having |
Having As discussed on Slack, ideally the resolved displayName with param / results references replaced would be made available somewhere for all consuming clients (Dashboard, tkn, OpenShift console, etc.) so they don't have to duplicate the effort of resolving it themselves. This could potentially be in |
I will take this discussion to the issue #7082 so that we can track the history. |
Changes
Allow specifying parameters, task results, or context variables in a
displayName
.Specifying task results in a
displayName
does not introduce a resource dependency. Pipeline authors have to specify resource dependency usingrunAfter
or taskparams
./kind feature
Fixes #7200
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