Giter Club home page Giter Club logo

supybot-github's Introduction

Build Status MIT License Read the Docs

supybot-github is a plugin for the python-based IRC bot Supybot (and its forks Limnoria and Gribble).

Its purpose is to announce commits and other important notifications from a Github repository on an IRC channel, using Github's post commit hooks.

Getting started

See the Getting Started page on Read the Docs

Screenshot

GitHub Actions Integration

The GitHub Actions infrastructure doesn't have a webhooks, so instead there is a GitHub Actions Integration available on the marketplace.

Todo

Check out the Github issue tracker.

supybot-github's People

Contributors

allejo avatar blast007 avatar fasterit avatar kongr45gpen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

supybot-github's Issues

Configuration variables

Configuration of the plugin should be done in three stages: global, channel, repository-type-module. Repository overrides channel, which overrides global. Thankfully, supybot already provides support for channel-based config vars, we only need to code the repo ones. Type is the type of the post-receive hook (e.g.: push, gollum, pull-request, etc) and module is a name specified on the post-receive hook. Here's some examples of repository-dependent variable categories:

  1. repo-*-* (Adjust variables for the repo repository)
  2. octocat-*-sample (Adjust variables for the octocat repository when the hook URL looks something like host:port/passcode/sample)
  3. *-gollum-* (Adjust variables for all wiki edits which are not overriden)
  • Global variables
  • Channel-dependent variables
  • Repository-dependent variables
  • Type-dependent variables
  • Module-dependent variables

The plugin should have the following configuration variables (not in a specific order):

  • channel (obviously cannot be channel-based)
  • port (the server port)
  • address (the server binding address)
  • passcode (a passcode which can be used to ensure that hook updates come from the right place)
  • theme (the theme to use)
  • notify (notify instead of privmsg)
  • hidePush (hide user pushed ... commits message)
  • shortURL (use git.io to shorten the commit/compare URLs)
  • fullcommits (show full commit message, instead of just the title)
  • colors
  • commitnewline (start commit message on a new line)
  • theme (string representing the format in which messages should be sent)
  • brackets (the type of brackets to show)
  • showOwner (whether to show the name of the owner of the repo - can be never, fork or always
  • port
  • showMergedCommits
  • showSuccessfulBuildMessages (whether to show successful build messages - can be never, change or always)
  • disallowConfigOverride
  • disallowChannelOverride
  • allowArbitraryMessages
  • hideURL
  • showMilestone
  • tagShowCommitMsg
  • preventIssueNameSmap
  • showIssueEdits
  • showPendingStatuses
  • alwaysShowForcedPushes

Python 3.8.3 support?

WARNING 2020-06-13T16:44:30 Failed to load Github: This plugin may be incompatible with your current Python version. If this error is appearing with stock Supybot plugins, remove the stock plugins directory (usually ~/Limnoria/plugins) from 'config directories.plugins'.

Any idea why it's not loading for python 3.8.3?

Allow to configure the IP address the plugins binds to

Hi,

great plugin, however I have a request. I want to be able to configure the IP address which the plugins binds to.

currently I hack the source like this

diff --git a/plugin.py b/plugin.py
index cbcd7d5..ac199a7 100644
--- a/plugin.py
+++ b/plugin.py
@@ -79,7 +79,7 @@ class Github(callbacks.Plugin):
         self.__parent = super(Github, self)
         self.__parent.__init__(irc)
         server_class = BaseHTTPServer.HTTPServer
-        self.httpd = server_class(('', self.port), RequestHandler.GithubHandler)
+        self.httpd = server_class(('127.0.0.1', self.port), RequestHandler.GithubHandler)
         t = threading.Thread(target=self.ServerStart, args=(self.httpd,))
         t.daemon = False
         t.start()

But is far from clean and elegant

Support different types of post-receive hooks

  • push - Any git push to a Repository (commits, branches and tags are fully supported)
  • issues - Any time an Issue is opened or closed.
  • issue_comment - Any time an Issue is commented on.
  • commit_comment - Any time a Commit is commented on.
  • pull_request - Any time a Pull Request is opened, closed, or synchronized (updated due to a new push in the branch that the pull request is tracking).
  • pull_request_review - Any time a Pull Request Review is acted upon.
  • pull_request_review_comment - Any time a Commit is commented on while inside a Pull Request review (the Files Changed tab).
  • gollum - Any time a Wiki page is updated.
  • watch - Any time a User stars the Repository.
  • download - Any time a Download is added to the Repository.
  • fork - Any time a Repository is forked.
  • fork_apply - Any time a patch is applied to the Repository from the Fork Queue.
  • member - Any time a User is added as a collaborator to a non-Organization Repository.
  • public - Any time a Repository changes from private to public.
  • team_add - Any time a team is added or modified on a Repository.
  • release - Any time a release is published
  • status - Any time a Repository has a status update from the API
  • page_build - Any time a Pages site is built or results in a failed build.
  • ping - Any time a new Github hook is created
  • create - Represents a created repository, branch, or tag.
  • delete - Represents a deleted branch or tag.
  • deployment - Represents a deployment.
  • deployment_status - Represents a deployment status.
  • label - Any time a label is edited

supybot-github also supports the following third-party services:

Support IPv6

Github has recently added two IPv6 networks to their hook servers. So they will at some point start using them.

Setting config supybot.plugins.Github.address :: or (::0) fails with a nice backtrace:

ERROR 2021-08-25T16:12:46 Failed to load Github:
Traceback (most recent call last):
  File "/limnoria/.local/lib/python3.9/site-packages/supybot/plugins/Owner/", line 190, in _loadPlugins
    plugin.loadPluginClass(irc, m)
  File "/limnoria/.local/lib/python3.9/site-packages/supybot/", line 153, in loadPluginClass
    cb = module.Class(irc)
  File "/limnoria/.local/lib/python3.9/site-packages/supybot/utils/", line 102, in __init__
    original__init__(self, *args, **kwargs)
  File "/limnoria/limnoria/plugins/Github/", line 85, in __init__
    self.httpd = server_class((self.address, self.port), RequestHandler.GithubHandler)
  File "/usr/lib/python3.9/", line 452, in __init__
    self.server_bind()
  File "/usr/lib/python3.9/http/", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.9/", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno -2] Name does not resolve
ERROR 2021-08-25T16:12:46 Exception id: 0x75898

Would be nice to support "::" or "::0" to get a dual stack listening socket.
And probably there should be an address6 to bind to if address (address4?) is a qualified IPv4, similarly to what limnoria does for the supybot.servers.http.hosts4 and supybot.servers.http.hosts6 config values.

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.