Code Monkey home page Code Monkey logo

github's Introduction

github's People

Contributors

albancrommer avatar sumnerevans avatar tulir 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

github's Issues

[ENH] Support mentions

I was looking for a replacement for the github slack bot that works with Matrix and I have to say that this maubot plugin is just what I needed! Before trying this, I was using opsdroid. One of the features I was thinking of implementing is to convert github mentions into matrix mentions.

Will this be possible? I can work on it and create a PR. I was thinking that maybe someone will insight on the project could point me in the right direction where to start.

not working due to TypeError

The plugin can't load due to this exception being thrown. I'm using the official Docker container of maubot.

  File "/data/plugins/xyz.maubot.github-v0.1.0.mbp/github/bot.py", line 41, in <module>
    class GitHubBot(Plugin):
  File "/data/plugins/xyz.maubot.github-v0.1.0.mbp/github/bot.py", line 109, in GitHubBot
    async def raw_query(self, evt: MessageEvent, query: str, client: GitHubClient) -> None:
TypeError: 'staticmethod' object is not callable

Anyway to fix this? I have no idea how Python works :(

Bot does not function

Steps to reproduce issue

1.invite the bot
2. login
3. apply <owner/repo> command. !gh webhook add owner/repo
4. apply test Issue on the repo, and wait for bot to respond. (it did not respond)

Extra details

At first we tested it on an encrypted room, then later we created a temporary unencrypted room to see if anything gets fixed, it didn't fix anything.

TypeError: Object of type coroutine is not JSON serializable

hi, i see today an error after i updated maubot to version v0.3.1

is the github plugin broker in this maubot version?

[17:35:52](file:////opt/maubot/plugins/xyz.maubot.github-v0.1.1.mbp/github/webhook/aggregation.py:97)ERROR[instance/github.webhook](https://matrix.envs.net/_matrix/maubot/#/instance/github.webhook)Fatal error in aggregation handler
[17:35:52](file:////opt/maubot/plugins/xyz.maubot.github-v0.1.1.mbp/github/webhook/aggregation.py:97)ERROR[instance/github.webhook](https://matrix.envs.net/_matrix/maubot/#/instance/github.webhook)Traceback (most recent call last):
  File "/opt/maubot/plugins/xyz.maubot.github-v0.1.1.mbp/github/webhook/aggregation.py", line 101, in _start
    starter = self.aggregation_starters[self.event_type, self.event.action]
KeyError: (EventType.PUSH, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/maubot/plugins/xyz.maubot.github-v0.1.1.mbp/github/webhook/aggregation.py", line 95, in start
    await self._start()
  File "/opt/maubot/plugins/xyz.maubot.github-v0.1.1.mbp/github/webhook/aggregation.py", line 104, in _start
    await self._send()
  File "/opt/maubot/plugins/xyz.maubot.github-v0.1.1.mbp/github/webhook/aggregation.py", line 126, in _send
    await self.handler.send_message(self.event_type, self.event, self.webhook_info.room_id,
  File "/opt/maubot/plugins/xyz.maubot.github-v0.1.1.mbp/github/webhook/handler.py", line 132, in send_message
    await self.bot.client.send_message(room_id, content)
  File "/opt/maubot/lib/python3.9/site-packages/mautrix/client/encryption_manager.py", line 164, in send_message_event
    return await super().send_message_event(room_id, event_type, content, **kwargs)
  File "/opt/maubot/lib/python3.9/site-packages/mautrix/client/api/events.py", line 401, in send_message_event
    resp = await self.api.request(
  File "/opt/maubot/lib/python3.9/site-packages/mautrix/api.py", line 363, in request
    content = json.dumps(content)
  File "/usr/lib/python3.9/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type coroutine is not JSON serializable

Ability to configure branches for pushes

It would be awesome to be able to filter on only certain branches in the config either per repository or globally. GitHub doesn't seem to allow configuring this, it's either all pushes or none for the webhook.

Use case; I want pushes as notifications for the main branch but not when building something in a branch to make a pull request.

Dots in Repository Names

The bot won't accept my repository name with a dot in it. Repositories without one works fine.

Example:

!github webhook add Garados007/MaxLib.WebServer

Output:

Usage: !webhook add <owner/repo>

Support GitHub Apps

According to the GitHub Docs, GitHub Apps are preferrable to OAuth apps, as they provide, among other things, tighter authorization scopes (e.g. selecting which repos the App has access to, rather than all those the authorizing user has access to).

This document provides guidelines for how to migrate to Apps, in case that's what you decide to do.

Bot doesn't handle multi-select labelling well

When labelling multiple issues at once, bot show one issue being labelled multiple times.
An example:

GitHub

08:01 PM

[ajbura/cinny] ajbura added enhancement, enhancement, enhancement, enhancement, enhancement, enhancement, enhancement, enhancement and enhancement to issue #5: Being able to open images without having to open them in a new tab

No Releases

No releases appear to be available on this plugin. I can zip things up myself, but...

Track reactions on pull requests and pull request comments

Hi! I hope it's okay if I make a feature request here. If you can get me on the way of patching it myself (and validating), I'd be glad to.

Basically, I'd love to see this:

image

... result in reactions on GH. If I can read the code correctly, it only works on issues and issue comments at this moment.

I would patch it like this:

diff --git a/github/commands.py b/github/commands.py
index a62f915..bea95ef 100644
--- a/github/commands.py
+++ b/github/commands.py
@@ -161,6 +161,8 @@ class Commands:
             subject_id = webhook_meta["issue"]["node_id"]
         elif webhook_meta["event_type"] == "issue_comment" and webhook_meta["action"] == "created":
             subject_id = webhook_meta["comment"]["node_id"]
+        elif webhook_meta["event_type"] == "pull_request" and webhook_meta["action"] == "created":
+            subject_id = webhook_meta["comment"]["node_id"]
         else:
             return
         await client.mutate(query="addReaction(input: $input) { clientMutationId }",

... but it seems to me that webhook_meta does not have "action" as a field for PRs. I don't immediately get the code (it gets really abstract really fast), but I admit I haven't looked to deeply. If you give me some pointers, I'll patch something up tomorrow.

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.