Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

At least one github account doesn't match allowed pattern #194

Closed
undeconstructed opened this issue Mar 13, 2017 · 5 comments
Closed

At least one github account doesn't match allowed pattern #194

undeconstructed opened this issue Mar 13, 2017 · 5 comments
Labels

Comments

@undeconstructed
Copy link

Hi, I've run into a github repo that doesn't match the naming rules in deduce.go: https://github.com/sean-/seed. I tried reverting to this line: https://github.com/sdboyer/gps/blob/master/deduce.go#L53, but that now produces a panic down the line - removing the requirement that user name ends with [A-Za-z0-9] fixes this example, although I don't know if that's a good enough fix for everyone. Thanks.

@sdboyer
Copy link
Owner

sdboyer commented Mar 13, 2017

Ah, good catch, thank you!

I suspect the panic was probably because the newer regex includes more capture groups that are being referenced later on. Could you provide the text of the panic, for my reference?

@sdboyer sdboyer added the bug label Mar 13, 2017
@undeconstructed
Copy link
Author

Line number is actually 461, I added the line that prints "src: <nil>"

$ dep init
src: <nil>
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x4df824]

goroutine 67 [running]:
panic(0x7ad300, 0xc420010100)
	/usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*SourceMgr).SyncSourceFor(0xc420082840, 0xc420223590, 0x22, 0x0, 0x0, 0x0, 0x0)
	/home/phil/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/source_manager.go:462 +0x204
main.getProjectData.func1(0xc420223590, 0x22, 0xc420082840)
	/home/phil/go/src/github.com/golang/dep/cmd/dep/init.go:243 +0x6c
created by main.getProjectData
	/home/phil/go/src/github.com/golang/dep/cmd/dep/init.go:268 +0xb4d

@sdboyer
Copy link
Owner

sdboyer commented Mar 14, 2017

Oh - well, #187 (which isn't yet merged into dep downstream) should have caused this to not panic, but it wouldn't have actually fixed the error. Still, that at least helps us know that the panic isn't in the deducer itself - it's at least returning out an error.

@jstemmer
Copy link
Contributor

This was fixed in #201, so this issue can be closed.

@sdboyer
Copy link
Owner

sdboyer commented Mar 30, 2017

ah thanks, i'm used to auto-closing

@sdboyer sdboyer closed this as completed Mar 30, 2017
krisnova pushed a commit to krisnova/dep that referenced this issue Apr 21, 2017
The current rules for github usernames only allow for alphanumeric
characters or single hyphens and they cannot begin or end with a hyphen.
In the past however github username rules were less strict and we need
to support these (issue sdboyer/gps#194).

Using the Google BigQuery public github dataset, I've checked the
usernames of all public commits against the currently defined regex in
deduce.go. From these results I've concluded that usernames with
multiple consecutive hyphens and usernames that end with a hyphen were
allowed in the past and do exist. Fortunately these are the only
exceptions I've found, there were no usernames that started with a
hyphen or contained any other special characters.

In addition, this change now also allows one-letter usernames.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants