Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for defining command callbacks, for issue/PR comments containing @ the github app #15

Open
joshuadavidthomas opened this issue Nov 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@joshuadavidthomas
Copy link
Owner

A nice to have feature would be the ability to @ reply the github app that django-github-app is installed on with a command and have the event router handle that appropriately. I'm thinking about how you can @ Dependabot to rebuild or recreate a PR, I can see how that would be super useful to have built-in to the library -- as opposed to someone building out all of that on their own.

Part of the reason I wrapped gidgethub.routing.Router and providing our own event method for registering webhook handlers in the first place was to support extending in a way that would provide a seamless API.

from django_github_app.routing import GitHubRouter

gh = GitHubRouter()

@gh.command("recreate")
async def recreate_pr(event, gh, *args, **kwargs): ...

So someone commenting on a PR with @user-github-app recreate would trigger this callback.

Could also see use in being able to scope it to either PR or issues as well:

from django_github_app.routing import GitHubRouter

gh = GitHubRouter()

@gh.command("recreate", scope="pr")
async def recreate_pr(event, gh, *args, **kwargs): ...

@gh.command("recreate", scope="issue")
async def recreate_issue(event, gh, *args, **kwargs): ...

Unsure about that wording of scope, but settling on that can come later.

@joshuadavidthomas joshuadavidthomas added the enhancement New feature or request label Nov 18, 2024
@joshuadavidthomas joshuadavidthomas added this to the v1.0.0 milestone Nov 18, 2024
@joshuadavidthomas joshuadavidthomas removed this from the v1.0.0 milestone Nov 18, 2024
@joshuadavidthomas joshuadavidthomas moved this to Backlog in v1.0.0 Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

1 participant