Request the events/permissions of GitHub webhook handlers on app creation.
Review Request #15337 — Created Sept. 24, 2026 and updated
When creating a GitHub App, we send a manifest listing the events and
permission the app requires, and we display these to the admin creating
the app. This change includes the events and permissions of any
registered webhook handlers into the manifest and admin display.We now have public constants for the built in events and permissions
required by core Review Board, making it easy to see and reference these
in docs. This also removes thepull_requestspermission from the
defaults since it will be pulled in by Power Pack's pull request
integration handler.In the future we should probably leverage the "needs attention" GitHub
App state in our admin UI to lets admins know to update their app
settings on GitHub whenever new webhook handlers are registered that
require events/permissions that haven't been granted yet.
- Ran unit tests.
- Created a GitHub app while having a handler that requires certain
events and permissions.
| Summary | ID |
|---|---|
| 4cd1c643631f8a8a036d5f7987c88fce8cc8ecdf |
| Description | From | Last Updated |
|---|---|---|
|
We should make sure this is sorted. The results from get_events() are not in a stable order (because it's a … |
|
|
|
Maybe worth defining this as a set? That further simplifies default_events |
|
|
|
This test exercises the case of a new permission, and de-duplication of an existing one, but not a handler that … |
|
|
|
Might be good to also use frozenset for all these. |
|
|
|
Oh, I commented about this in /r/15335. Let's move this into that change. |
|
-
-
We should make sure this is sorted. The results from
get_events()are not in a stable order (because it's aset), and so this can switch around things in the app manifest, the UI, and tests.That can simplify things too:
default_events = sorted( (set(DEFAULT_GITHUB_APP_EVENTS) | handler_registry.get_events()) - GITHUB_APP_AUTO_DELIVERED_EVENTS) -
-
This test exercises the case of a new permission, and de-duplication of an existing one, but not a handler that raises the permission level of a built-in handler. Can we have it require 'contents': 'write' so we cover that part?
- Commits:
-
Summary ID 0e9a3f815b7aa8b9cf91b3d14cfc99bfa5f10649 4e963c7f5735cc239d9b773ab26a35a8cf229ee8 - Depends On:
-
- Diff:
Revision 2 (+394 -60)
Checks run (2 succeeded)
flake8 passed.JSHint passed.