jenkins-x-plugins / jx-pipeline

a small binary plugin for working with Jenkins X pipelines
Apache License 2.0
8 stars 25 forks source link

fix: only update stage message when steps exist in pipeline activity #504

Closed ankitm123 closed 1 year ago

ankitm123 commented 1 year ago

Signed-off-by: ankitm123 ankitmohapatra123@gmail.com

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

ankitm123 commented 1 year ago

versionstream tests fail with this message (build controller logs in e2e tests):

E1009 20:53:15.758183       1 runtime.go:78] Observed a panic: runtime.boundsError{x:0, y:0, signed:true, code:0x0} (runtime error: index out of range [0] with length 0)
goroutine 97 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x22bc8c0?, 0xc000198d38})
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/runtime/runtime.go:74 +0x99
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc000dc9c30?})
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/runtime/runtime.go:48 +0x75
panic({0x22bc8c0, 0xc000198d38})
    /usr/local/go/src/runtime/panic.go:838 +0x207
github.com/jenkins-x-plugins/jx-pipeline/pkg/pipelines.addTaskRunsMessage(0xc000c6af00, 0xc0004f12f0)
    /go/pkg/mod/github.com/jenkins-x-plugins/jx-pipeline@v0.5.9/pkg/pipelines/pipelines.go:383 +0x1ea
github.com/jenkins-x-plugins/jx-pipeline/pkg/pipelines.ToPipelineActivity(0xc000c6af00, 0xc0004f12f0, 0x1)
    /go/pkg/mod/github.com/jenkins-x-plugins/jx-pipeline@v0.5.9/pkg/pipelines/pipelines.go:349 +0xbe5
github.com/jenkins-x-plugins/jx-build-controller/pkg/cmd/controller/tekton.(*Options).OnPipelineRunUpsert.func1()
    /workspace/source/pkg/cmd/controller/tekton/tekton.go:171 +0x21a
github.com/jenkins-x-plugins/jx-build-controller/pkg/cmd/controller/tekton.(*Options).retryUpdate(0x23a95e0?, {0x28f80a0, 0xc00005a020}, 0xc0007ebbc8, {0x28fdc18, 0xc0008db520}, 0x5)
    /workspace/source/pkg/cmd/controller/tekton/tekton.go:201 +0x75
github.com/jenkins-x-plugins/jx-build-controller/pkg/cmd/controller/tekton.(*Options).OnPipelineRunUpsert(0xc00068a900, {0x28f80a0, 0xc00005a020}, 0xc000c6af00, {0xc0004cfe20, 0x2})
    /workspace/source/pkg/cmd/controller/tekton/tekton.go:194 +0x127
github.com/jenkins-x-plugins/jx-build-controller/pkg/cmd/controller/tekton.(*Options).onPipelineRun(0x10000c0005df420?, {0x2417ec0?, 0xc000c6af00?}, {0xc0004cfe20, 0x2})
    /workspace/source/pkg/cmd/controller/tekton/tekton.go:127 +0xb4
github.com/jenkins-x-plugins/jx-build-controller/pkg/cmd/controller/tekton.(*Options).Start.func2({0x406478?, 0xc000abe840?}, {0x2417ec0?, 0xc000c6af00})
    /workspace/source/pkg/cmd/controller/tekton/tekton.go:98 +0x51
k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnUpdate(...)
    /go/pkg/mod/k8s.io/client-go@v0.22.15/tools/cache/controller.go:238
k8s.io/client-go/tools/cache.(*processorListener).run.func1()
    /go/pkg/mod/k8s.io/client-go@v0.22.15/tools/cache/shared_informer.go:775 +0x137
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x11?)
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/wait/wait.go:155 +0x3e
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc0001e0738?, {0x28d93a0, 0xc000654cc0}, 0x1, 0xc000b070e0)
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/wait/wait.go:156 +0xb6
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x0?, 0x3b9aca00, 0x0, 0x0?, 0xb705e0?)
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/wait/wait.go:133 +0x89
k8s.io/apimachinery/pkg/util/wait.Until(...)
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/wait/wait.go:90
k8s.io/client-go/tools/cache.(*processorListener).run(0xc00063ba00?)
    /go/pkg/mod/k8s.io/client-go@v0.22.15/tools/cache/shared_informer.go:771 +0x6b
k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/wait/wait.go:73 +0x5a
created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start
    /go/pkg/mod/k8s.io/apimachinery@v0.22.15/pkg/util/wait/wait.go:71 +0x85
panic: runtime error: index out of range [0] with length 0 [recovered]
    panic: runtime error: index out of range [0] with length 0
codecov[bot] commented 1 year ago

Codecov Report

Base: 37.33% // Head: 37.36% // Increases project coverage by +0.03% :tada:

Coverage data is based on head (0073599) compared to base (89593c6). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #504 +/- ## ========================================== + Coverage 37.33% 37.36% +0.03% ========================================== Files 44 44 Lines 5944 5947 +3 ========================================== + Hits 2219 2222 +3 Misses 3382 3382 Partials 343 343 ``` | [Impacted Files](https://codecov.io/gh/jenkins-x-plugins/jx-pipeline/pull/504?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jenkins-x-plugins) | Coverage Δ | | |---|---|---| | [pkg/pipelines/pipelines.go](https://codecov.io/gh/jenkins-x-plugins/jx-pipeline/pull/504/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jenkins-x-plugins#diff-cGtnL3BpcGVsaW5lcy9waXBlbGluZXMuZ28=) | `77.18% <100.00%> (+0.21%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jenkins-x-plugins). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jenkins-x-plugins)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

jenkins-x-bot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: babadofar

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: - ~~[OWNERS](https://github.com/jenkins-x-plugins/jx-pipeline/blob/main/OWNERS)~~ [babadofar] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
msvticket commented 1 year ago

Could this be a fix to jenkins-x/jx#8420?

ankitm123 commented 1 year ago

Could this be a fix to jenkins-x/jx#8420?

Not sure honestly, but unlikely 🤔