Git Product home page Git Product logo

github-migrator's Issues

Fails when /hooks returns 404

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!

panic: runtime error: invalid memory address or nil pointer dereference

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

fails due to deleted Github user

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.