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

Validate configured repos #234

Merged
merged 1 commit into from
Jan 15, 2021
Merged

Validate configured repos #234

merged 1 commit into from
Jan 15, 2021

Conversation

kalafut
Copy link
Contributor

@kalafut kalafut commented Nov 13, 2020

Currently if a repo name cannot be parsed or has no provider, a panic will result, e.g.:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x178990f]

goroutine 40 [running]:
github.com/google/triage-party/pkg/hubbub.(*Engine).updateIssues(0xc000440b40, 0x1b12ec0, 0xc00003c098, 0x7ffeefbff707, 0x1, 0x7ffeefbff709, 0x1, 0x7ffeefbff6ff, 0x7, 0x0, ...)
	/Users/kalafut/dev/triage-party/pkg/hubbub/issue.go:87 +0x4ef
github.com/google/triage-party/pkg/hubbub.(*Engine).cachedIssues(0xc000440b40, 0x1b12ec0, 0xc00003c098, 0x7ffeefbff707, 0x1, 0x7ffeefbff709, 0x1, 0x7ffeefbff6ff, 0x7, 0x0, ...)
	/Users/kalafut/dev/triage-party/pkg/hubbub/issue.go:46 +0x378
github.com/google/triage-party/pkg/hubbub.(*Engine).SearchIssues.func1(0xc000592580, 0xc0000c8d80, 0xc000440b40, 0x1b12ec0, 0xc00003c098, 0xc000693440, 0xc000693400)
	/Users/kalafut/dev/triage-party/pkg/hubbub/search.go:66 +0x178
created by github.com/google/triage-party/pkg/hubbub.(*Engine).SearchIssues
	/Users/kalafut/dev/triage-party/pkg/hubbub/search.go:58 +0x438

This PR validates all URLs as soon as the config is loaded and will return a nicer error:

F1113 15:04:03.690167   53505 main.go:129] load from config.yaml: validate config: unknown provider host "abc.com"

Currently if a repo name cannot be parsed or has no provider, a panic
will result. This PR validates all URLs as soon as the config is loaded
and will return a nicer error.
Copy link
Collaborator

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tstromberg tstromberg merged commit 6d65800 into google:master Jan 15, 2021
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.

None yet

2 participants