itchyny / github-migrator Goto Github PK
View Code? Open in Web Editor NEWGitHub repository migrator
License: MIT License
GitHub repository migrator
License: MIT License
For some reason this returns 404:
https://api.github.com/repos/bergie/passport-saml/hooks?
The URL is correct, but either there are no hooks or my API token doesn't have permission to see them so the URL is 404.
Either way, github-migrator
crashes at this point.
Instead, it should treat the case the same as "no hooks" and proceed from there.
I think this is really a bug in the Github API design, though. Returning "403 Forbidden" in this case seems more appropriate, or "204 No Content".
Thanks!
To reproduce, try importing the bergie/passport-saml
repo to another empty repo on Github.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x69a399]
goroutine 1 [running]:
github.com/itchyny/github-migrator/migrator.groupEventsByCreated(0xc00008eea0, 0x4, 0x4, 0xc0002351c0, 0x702a60, 0xc0002351a0)
/home/mark/RAgit/github-migrator/migrator/builder_events.go:75 +0x1b9
github.com/itchyny/github-migrator/migrator.(*builder).buildImportEventComments(0xc0004a1980, 0xc0000fb280, 0x4, 0x4, 0x6d54c0, 0xc0002771c0)
/home/mark/RAgit/github-migrator/migrator/builder_events.go:15 +0x92
github.com/itchyny/github-migrator/migrator.(*builder).buildImportComments(0xc0004a1980, 0xc000182870, 0x9dd528, 0x0, 0x0, 0xc000130e38)
/home/mark/RAgit/github-migrator/migrator/builder.go:151 +0x72
github.com/itchyny/github-migrator/migrator.(*builder).build(0xc0004a1980, 0x0, 0x77, 0x77)
/home/mark/RAgit/github-migrator/migrator/builder.go:71 +0x1c7
github.com/itchyny/github-migrator/migrator.(*migrator).buildImport(0xc00020fd60, 0xc0004b4340, 0xc0003a5cc0, 0xc0000fafe0, 0x4, 0x4, 0xc00008eea0, 0x4, 0x4, 0xc00012e270, ...)
/home/mark/RAgit/github-migrator/migrator/builder.go:43 +0x190
github.com/itchyny/github-migrator/migrator.(*migrator).migrateIssue(0xc00020fd60, 0xc0004b4340, 0xc0004a1d20, 0x0, 0x0, 0x0, 0x0)
/home/mark/RAgit/github-migrator/migrator/issues.go:136 +0x8d8
github.com/itchyny/github-migrator/migrator.(*migrator).migrateIssues(0xc00020fd60, 0x0, 0x0)
/home/mark/RAgit/github-migrator/migrator/issues.go:42 +0x1bc
github.com/itchyny/github-migrator/migrator.(*migrator).Migrate(0xc00020fd60, 0x14, 0x7fff11f4f169)
/home/mark/RAgit/github-migrator/migrator/migrator.go:71 +0x2fa
main.run(0xc000114160, 0x2, 0x2, 0x44316a, 0x971fe0)
/home/mark/RAgit/github-migrator/main.go:31 +0x96
main.main()
/home/mark/RAgit/github-migrator/main.go:17 +0x6c
Example commit which triggers it:
node-saml/passport-saml@3ba0158
Example of what output looks like when the the failure is triggered:
===> GET: https://api.github.com/users/Herbert%20Voj%C4%8D%C3%ADk
<=== 404 Not Found: GET: https://api.github.com/users/Herbert%20Voj%C4%8D%C3%ADk
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x698452]
goroutine 1 [running]:
github.com/itchyny/github-migrator/migrator.(*builder).buildImageTag(0xc0000a9980, 0x0, 0x23, 0xc0001dbf08, 0x0)
/home/mark/RAgit/github-migrator/migrator/builder.go:240 +0x42
github.com/itchyny/github-migrator/migrator.(*builder).buildUserActionBody(0xc0000a9980, 0x0, 0x74fd1a, 0x27, 0x0, 0x0, 0x0, 0x0)
/home/mark/RAgit/github-migrator/migrator/builder.go:234 +0x75
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.