-
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
Add the step name in taskrun status #657
Conversation
Thanks for the PR @skeeey, but would you mind adding some test to cover your new change |
/ok-to-test |
/retest |
@pivotal-nader-ziada thanks for your review, I add test case to make sure the step name in the step state, but the integration test failed, I cannot locate where the error occurs, it seems to be an env problem. would you help me to have a look? |
@skeeey yeah there is some weirdness on the CI / integration tests, I'm looking into it 😉 |
/test pull-tekton-pipeline-integration-tests |
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.
Can you add some tests cases ? TestUpdateStatusFromPod
with containers's name being named with the different prefixes
@vdemeester I enhance the test cases:
the message
|
The 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.
@skeeey ah looking at the build failure, it's kinda my fault 😅
taskrun_test.go:105: -got, +want: {[]v1alpha1.StepState}[0].Name:
-: "exit"
+: ""
{[]v1alpha1.StepState}[1].Name:
-: "hello"
+: ""
{[]v1alpha1.StepState}[2].Name:
-: "world"
+: ""
{[]v1alpha1.StepState}[3].Name:
-: "nop"
+: ""
You're gonna have to update the test/taskrun_test.go
expectedState
array to add the Name
field in there 🙇♂️
Also, can you squash your commit ? 👼
/check-cla |
@vdemeester I try to squash my commits, but it failed 😅, so I reset my branch and force push it ... I correct the e2e test case, but the integration test |
@skeeey sorry for being a pita but there is stiil a need to squash 😅 Ping me on knative's slack (#build-pipeline) if you need help for squashing them 😉 🤗 |
@vdemeester thanks, I make all commits to one commit |
@vdemeester @pivotal-nader-ziada is anything pending in this PR? |
|
||
// TrimContainerNamePrefix trim the container name prefix to get the corresponding step name | ||
func TrimContainerNamePrefix(containerName string) string { | ||
return strings.TrimPrefix(containerName, containerPrefix) |
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.
are you removing the prefix "build-step" but keeping the random string in the end of the name?
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.
@pivotal-nader-ziada indeed, the random string in the end is still there, we should trim it too
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.
@pivotal-nader-ziada @vdemeester yes, this method only trims the build-step
prefix, for this case, the method is used to trim the build step name, the build step name consists of build-step
prefix and the task step name, the task step name is defined by user, there should be no random string in it unless user defined it, 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.
@skeeey the pod actually get a random suffix at the end of the name — and are limited in size. I think we should actually use the pod labels to get the task name (see below an extract of a describe on a pod)
Name: build-push-run-pod-04cde6
Namespace: default
Priority: 0
PriorityClassName: <none>
Node: minikube/192.168.122.229
Start Time: Tue, 02 Apr 2019 12:17:01 +0200
Labels: tekton.dev/task=build-push-kaniko
tekton.dev/taskRun=build-push-run
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.
@vdemeester I'm confused :-), why we need a task
name?in this case, we want to add the step name to each step that is in the taskrun
status, and in fact, each task
step corresponds to a container in a pod, we can get the container name from ContainerStatus
directly, and the container name consists of build-step
prefix and the task
step name, I think we can trim the build-step
prefix to get the actual step name, is my understand 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.
@skeeey lol sorry, I messed up 😂 You're 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.
@skeeey right so we just need to trim the last 7 characters of the pod name then (to get a clean step name 👼 )
added a question about the name trimming? but @vdemeester had comments after I reviewed so will wait for him to take a look and decide |
@vdemeester any more comments? |
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.
@vdemeester I rebased the PR, for second problem, Can we limit the length of the step name when users apply their task (additional, we may also need to valid the step name, the name should be consisted of |
I think/hope we no longer will have step names that are too long but I might be missing something @vdemeester ! I also want to throw out two wildcard suggestions:
(BUT I think we should also merge this as-is and iterate so @skeeey isn't stuck for too much longer. @skeeey it looks like a rebase is required again 😓 ) |
I think this is looking pretty good - will leave for @vdemeester to make the final call on! (I think today is a holiday for him tho... 😇 ) |
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: skeeey, 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 |
Changes
refer to #549
Add a step name to
taskrun
status to help user to trace their steps statusSubmitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.
Test
apply the following
task
Then apply a
taskrun
to trigger thistask
, we can watch the each step status, like: