-
Notifications
You must be signed in to change notification settings - Fork 250
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
Generate steps name when none has been provided #611
Generate steps name when none has been provided #611
Conversation
0a58595
to
86a614b
Compare
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
86a614b
to
9fef44b
Compare
The following is the coverage report on pkg/.
|
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
it may be better to start counting from 1 instead of 0
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.
As far as I remember, the index in the name of the step is the index of it in the array and it starts at 0
because of go 👼 (so an unamed step at the 3rd step, would be named step-unamed-2
)
9fef44b
to
7170505
Compare
The following is the coverage report on pkg/.
|
7170505
to
1e35846
Compare
// AutoStepName when our stepName is empty return a genrated name as generated | ||
// on pipeLine | ||
func AutoStepName(stepName string) string { | ||
if stepName != "" { |
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 do this because I could not find a way to do this nicely in builtin gotemplate....
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 making sure .. so we want to print something like ..
- A named step
- unnamed-2
- another-named-step
- unnamed-4
- right?
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 saw that the test confirms it and it makes sense!
The following is the coverage report on pkg/.
|
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.
/hold
We should have a test with an unamed step in the middle of two named step 👼
1e35846
to
51ff027
Compare
Sure! done... /hold cancel |
The following is the coverage report on pkg/.
|
51ff027
to
f56567e
Compare
The following is the coverage report on pkg/.
|
676d2ae
to
95a01e3
Compare
The following is the coverage report on pkg/.
|
The following is the coverage report on pkg/.
|
95a01e3
to
4f2da22
Compare
The following is the coverage report on pkg/.
|
pkg/formatted/k8s.go
Outdated
return stepName | ||
} | ||
unnamedStep := fmt.Sprintf("unnamed-%d", stepCounter) | ||
atomic.AddUint64(&stepCounter, 1) |
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:
unnamedStep := fmt.Sprintf("unnamed-%d", stepCounter)
atomic.AddUint64(&stepCounter, 1)
if stepName != "" {
return stepName
}
return unnamedStep
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danielhelfand, vdemeester 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 |
Closes tektoncd#593 Signed-off-by: Chmouel Boudjnah <[email protected]>
4f2da22
to
eb2805f
Compare
The following is the coverage report on pkg/.
|
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
Let's generate the step name if the user has not provided one, like what is done
pipeline (which would shows up in tr)
Before:
After:
Closes #[593]
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make docs
andmake man
if needed.make check
See the contribution guide
for more details.
Release Notes