Skip to content
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

fix(pipeline): validate presence of tag on tag events to avoid panic #529

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

ecrupper
Copy link
Contributor

@ecrupper ecrupper commented Feb 8, 2024

Due to how the environment is set up, the exec pipeline command needs to have a tag value on a tag event.

$ vela exec pipeline --pipeline-type go --event tag
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/go-vela/types/library.(*Build).Environment(0xc0006d7560, {0x2cc080e, 0x9}, {0x2cb70f5, 0x4})
	/Users/Z004X4Y/go/pkg/mod/github.com/go-vela/[email protected]/library/build.go:198 +0x31dd
github.com/go-vela/server/compiler/native.environment(0xc000606968?, 0x0, 0xc0002b81a0, 0x0)
	/Users/Z004X4Y/go/pkg/mod/github.com/go-vela/[email protected]/compiler/native/environment.go:326 +0xaec
github.com/go-vela/server/compiler/native.(*client).EnvironmentBuild(0xc0002204b0)
.....

Changed to:

$ vela exec pipeline --pipeline-type go --event tag 
FATA[0000] no tag provided for tag event  

@ecrupper ecrupper requested a review from a team as a code owner February 8, 2024 19:05
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (08b96be) 82.23% compared to head (21b602a) 82.24%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #529      +/-   ##
==========================================
+ Coverage   82.23%   82.24%   +0.01%     
==========================================
  Files         147      147              
  Lines        3602     3605       +3     
==========================================
+ Hits         2962     2965       +3     
  Misses        473      473              
  Partials      167      167              
Files Coverage Δ
action/pipeline/validate.go 86.20% <100.00%> (+0.49%) ⬆️

@ecrupper ecrupper merged commit ddb971f into main Feb 9, 2024
16 of 17 checks passed
@ecrupper ecrupper deleted the fix/pipeline/validate-tag-exec branch February 9, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants