• 
      

    Request the events/permissions of GitHub webhook handlers on app creation.

    Review Request #15337 — Created Sept. 24, 2026 and updated

    Information

    Review Board
    release-9.x

    Reviewers

    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 the pull_requests permission 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
    Request the events/permissions of GitHub webhook handlers on app creation.
    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. This also removes the `pull_requests` permission from the defaults since it will be pulled in by Power Pack's pull request integration handler. In the future we may want to think of some UI that 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.
    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 …

    david david

    Maybe worth defining this as a set? That further simplifies default_events

    david david

    This test exercises the case of a new permission, and de-duplication of an existing one, but not a handler that …

    david david

    Might be good to also use frozenset for all these.

    david david

    Oh, I commented about this in /r/15335. Let's move this into that change.

    david david
    david
    1. 
        
    2. reviewboard/hostingsvcs/github/views.py (Diff revision 1)
       
       
       
       
       
       
       
       
      Show all issues

      We should make sure this is sorted. The results from get_events() are not in a stable order (because it's a set), 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)
      
    3. Show all issues

      Maybe worth defining this as a set? That further simplifies default_events

    4. Show all issues

      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?

    5. 
        
    maubin
    david
    1. 
        
    2. Show all issues

      Might be good to also use frozenset for all these.

    3. Show all issues

      Oh, I commented about this in /r/15335. Let's move this into that change.

    4. 
        
    maubin
    Review request changed
    Commits:
    Summary ID
    Request the events/permissions of GitHub webhook handlers on app creation.
    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. This also removes the `pull_requests` permission from the defaults since it will be pulled in by Power Pack's pull request integration handler. In the future we may want to think of some UI that 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.
    4e963c7f5735cc239d9b773ab26a35a8cf229ee8
    Request the events/permissions of GitHub webhook handlers on app creation.
    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. This also removes the `pull_requests` permission from the defaults since it will be pulled in by Power Pack's pull request integration handler. In the future we may want to think of some UI that 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.
    4cd1c643631f8a8a036d5f7987c88fce8cc8ecdf

    Checks run (2 succeeded)

    flake8 passed.
    JSHint passed.
    david
    1. Ship It!
    2.