Clever / microplane

A CLI tool to make git changes across many repos, especially useful with Microservices.
https://medium.com/always-a-student/mo-repos-mo-problems-how-we-make-changes-across-many-git-repositories-293ad7d418f0
Apache License 2.0
368 stars 45 forks source link

SIGSEV when sync status of multiple repos #114

Open Moser-ss opened 3 years ago

Moser-ss commented 3 years ago

When I am syncing more than 60 repositories I am getting this error message

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

goroutine 31 [running]:
github.com/Clever/microplane/sync.GithubSyncPush(0x14d88f0, 0xc0000ba008, 0xc0000b8360, 0x12, 0xc0000bbf00, 0x9, 0x0, 0x0, 0xc0000bbf0a, 0x6, ...)
    github.com/Clever/microplane/sync/syncGithub.go:40 +0x316
github.com/Clever/microplane/cmd.syncPush(0xc0000b8360, 0x12, 0xc0000bbf00, 0x9, 0x0, 0x0, 0xc0000bbf0a, 0x6, 0x0, 0x0, ...)
    github.com/Clever/microplane/cmd/sync.go:87 +0x385
github.com/Clever/microplane/cmd.syncOneRepo(0xc0000b8360, 0x12, 0xc0000bbf00, 0x9, 0x0, 0x0, 0xc0000bbf0a, 0x6, 0x0, 0x0, ...)
    github.com/Clever/microplane/cmd/sync.go:58 +0x278
github.com/Clever/microplane/cmd.parallelizeLimited.func1(0xc0000965f0, 0x14d88f0, 0xc0000ba008, 0xc0000a5f80, 0x1476c08, 0xc0000b8360, 0x12, 0xc0000bbf00, 0x9, 0x0, ...)
    github.com/Clever/microplane/cmd/helpers.go:48 +0x111
created by github.com/Clever/microplane/cmd.parallelizeLimited
    github.com/Clever/microplane/cmd/helpers.go:43 +0x198 
Moser-ss commented 3 years ago

After some debugging, I saw the root of the problem. One of my PRs has the property merge_commit_sha as null. Also, I found this article mention that the property is deprecated. And this property is used in several place So I think we need to rethink how to use that property