-
Bug
-
Resolution: Done
-
Critical
-
None
-
None
-
5
-
False
-
None
-
False
-
-
-
Pipelines Sprint Crookshank 15
Description of problem:
When a tag is deleted on gitlab repository, "Tag Push Hook" is sent on PAC and it has zero commit because it is delete hook, and thus controller is crashing while parsing event payload.
panic: runtime error: index out of range [-1] goroutine 93840 [running]:github.com/openshift-pipelines/pipelines-as-code/pkg/provider/gitlab.(*Provider).ParsePayload(0xc001004480, {0xc000f6a000?, 0x579?}, 0xc000d08844?, 0x1000000000005?, {0xc0004c8b00, 0x579}) github.com/openshift-pipelines/pipelines-as-code/pkg/provider/gitlab/parse_payload.go:68 +0x120fgithub.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEventPayload(0xc001222660, {0x2cb7c58, 0xc0003534a0}, 0xc00070f180) github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/sinker.go:30 +0x97github.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*sinker).processEvent(0xc001222660, {0x2cb7c58, 0xc0003534a0}, 0x0?) github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/sinker.go:54 +0x137github.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*listener).Start.listener.handleEvent.func2.1() github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/adapter.go:199 +0x2ccreated by github.com/openshift-pipelines/pipelines-as-code/pkg/adapter.(*listener).Start.listener.handleEvent.func2 in goroutine 93837 github.com/openshift-pipelines/pipelines-as-code/pkg/adapter/adapter.go:198 +0x9d7
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
1. Setup gitlab with Pipelines as Code (docs).
2. Create a tag on your gitlab repository whether using gitlab UI or git cli.
3. delete that tag (using gitlab UI or git cli).
you will get panic in Pipelines as Code controller.
Actual results:
Expected results:
Reproducibility (Always/Intermittent/Only Once):
Acceptance criteria:
Definition of Done:
Build Details:
Additional info (Such as Logs, Screenshots, etc):