Giter Club home page Giter Club logo

ghb0t's People

Contributors

azillion avatar github-actions[bot] avatar jacobbednarz avatar jessfraz avatar mathroc avatar toc-me[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghb0t's Issues

Trying to retrieve default branch segfaults

Running a build from master I reliably hit this shortly after startup (v0.4.7 works fine):

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

goroutine 1 [running]:
main.handleNotification(0x715ce0, 0xc00007c300, 0xc0000ee280, 0xc000504100, 0xc0001b2010, 0x6, 0x1c, 0xc0003be000)
	/go/src/github.com/genuinetools/ghb0t/main.go:185 +0x208
main.getNotifications(0x715ce0, 0xc00007c300, 0xc0000ee280, 0xc0001b2010, 0x6, 0x1, 0x14, 0x0, 0x0)
	/go/src/github.com/genuinetools/ghb0t/main.go:144 +0x1ab
main.main.func2(0x715ce0, 0xc00007c300, 0xc00008c010, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/genuinetools/ghb0t/main.go:112 +0x401
github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli.(*Program).run(0xc000104000, 0x715da0, 0xc00007ede0, 0xc00008c000, 0x2, 0x2, 0x4c15f0, 0xc00008a2a0)
	/go/src/github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli/cli.go:179 +0x281
github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli.(*Program).Run(0xc000104000)
	/go/src/github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli/cli.go:89 +0x67
main.main()
	/go/src/github.com/genuinetools/ghb0t/main.go:120 +0x287

main.go:185 being:

 			defaultBranch := *notification.Repository.DefaultBranch 

Looking at the JSON returned from the /notifications endpoint by hand it looks like there isn't a default_branch key for the repository and it's not actually listed in the notification docs, so I'm not quite sure where that field is meant to come from.

Don't delete a GitHub default branch

In the absence of a contribution guide, I've opened an issue here because I'd like to experiment with ghb0t at my organization. Many of our repositories have a different default branch, which in addition to (or instead of) our usage of master we would not wish to ever have deleted under any circumstances.

I'd like to try my hand at making that change, or if it was something already in your plans, maybe help with. Cheers!

Panic SIGSEGV

When running as a deployment on Kubernetes v1.14.2 I am getting a segfault in under a minute.

time="2019-05-24T10:16:36Z" level=info msg="Bot started for user chris-short."
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x665d3d]          

goroutine 1 [running]:                                                          
main.handleNotification(0x76e740, 0xc0000464c0, 0xc00009e280, 0xc000200580, 0xc0001e3ef0, 0xb, 0x0, 0x0)                                                    
    /go/src/github.com/genuinetools/ghb0t/main.go:185 +0x23d                
main.getNotifications(0x76e740, 0xc0000464c0, 0xc00009e280, 0xc0001e3ef0, 0xb, 0x1, 0x14, 0x0, 0x0)                                                            
    /go/src/github.com/genuinetools/ghb0t/main.go:144 +0x1ae
main.main.func2(0x76e740, 0xc0000464c0, 0xc0000101a0, 0x0, 0x0, 0x0, 0x0
    /go/src/github.com/genuinetools/ghb0t/main.go:112 +0x3f9 github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli.(*Program).run(0xc0000b4000, 0x76e800, 0xc000010d20, 0xc000010180, 0x3, 0x3, 0x4a87dd, 0x70a507)
    /go/src/github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli/cli.go:179 +0x253 github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli.(*Program).Run(0xc0000b4000)                           
    /go/src/github.com/genuinetools/ghb0t/vendor/github.com/genuinetools/pkg/cli/cli.go:89 +0x61                                                 
main.main()
    go/src/github.com/genuinetools/ghb0t/main.go:120 +0x34b

If I can provide more info lmk, please.

Delete ancient branches on start up

I have a lot of ancient merged branches in basically all my repos because I never bothered to delete them. It looks like this tool follows the notification stream, but doesn't actually go and clean up old branches. It would be great if it could do that as well.

I suspect that it would require a much larger number of API calls, so maybe it should be optionally enabled by a flag.

snap not published in the Ubuntu store

Hello again @jessfraz !

I was wondering if you had a chance to look into snaps. I was checking the store and saw that you haven't published the package, which could be pretty useful now if you have a couple of minutes.

We just released a new build service. It should be really simple to set up automated delivery there with a couple of clicks: https://build.snapcraft.io/

Please try it whenever you have a chance, and let me know what do you think.

pura vida.

Document required scopes for the token

It would be nice to document which scopes are required for the github token. Scoping the token is a must in my case since I am planning to run this on a Kubernetes cluster.

Build error

huitseeker@sleipnir➜huitseeker/tmp/ghb0t(master)» make               [13:28:03]
+ clean
+ build
# _/home/huitseeker/tmp/ghb0t
./main.go:92: not enough arguments in call to client.Users.Get
	have (string)
	want ("context".Context, string)
./main.go:130: not enough arguments in call to client.Activity.ListNotifications
	have (*github.NotificationListOptions)
	want ("context".Context, *github.NotificationListOptions)
./main.go:162: not enough arguments in call to client.PullRequests.Get
	have (string, string, int)
	want ("context".Context, string, string, int)
./main.go:180: not enough arguments in call to client.Git.DeleteRef
	have (string, string, string)
	want ("context".Context, string, string, string)
make: *** [Makefile:12: build] Error 2

Sounds like an update of github.com/google/go-github/github. Observed at 1807aa3 with go version go1.8 linux/amd64

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.