Supersonic, Subatomic GitHub

Jason Lee

Principal Software Engineer

Red Hat -

About Me

What we'll cover

  • What is a GitHub App
  • Why use Java?
  • Why use Quarkus?
  • Building an app

GitHub Applications

  • "GitHub Apps can do things on GitHub like open issues, comment on pull requests, and manage projects. They can also do things outside of GitHub based on events that happen on GitHub."
  • Example use cases:
    • Validate Issue, comment, or PR format/details
    • Control CI/CD jobs
    • Interact with issue tracker
    • Send messages via SMS, email, chat, etc.

Why use Java?

  • Mature, battle-tested language
  • Great global community
  • Immense number of libraries, frameworks, etc
  • It's not Javascript. :)

Why use Quarkus?

  • Leverages existing Java/JVM knowledge
  • Full CDI integration
  • Easily unit testable
  • Native compilation

Building a GitHub App

  • Register the app with GitHub
  • Install the application in a playground project
  • Code the Quarkus app
  • Profit

Register the app with GitHub

  • Visit
  • Only required fields (for an app of this size)
    • Application name
    • Homepage URL
    • Webhook URL
      • Your app is probably behind a firewall, so we'll need a proxy. More in a minute...
    • Webhook secret (optional)
      • Not really needed at this point either, but a good idea
      • ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'
      • Keep a copy of this

Notes on the Webhook URL

  • Your app is probably behind a firewall, so we'll need a proxy.
  • Smee to the rescue:
  • Click on Start a new channel
  • Make a copy of the Webhook Proxy URL
  • Quarkus GitHub App connects to automatically in dev mode

Register the app with GitHub (cont)

  • Repository Permission
    • Issues
    • Pull requests
  • Subscribe to events
    • Issues
    • Issue comment
    • Pull request

Final steps on GitHub

  • Click Create GitHub App
  • Create a private key
    • In the Private keys section, click on Generate a private key and save it
  • Install the app
    • Click the Install App link in the left nav
    • Select an account into which to install the application
    • Select the desired repository

Code the Quarkus app

  • Create the application using the Quarkus CLI
  • Create .env file
  • Fire it up
                            $ quarkus dev

Respond to your first event

  • Simple Java methods with annotated parameters


  • Your app can be configured per-repository (e.g., .github/bot-config.yml)
  • Formats supported
    • JSON
    • YAML
    • Text
  • Automatic deserialization and injection supported

Configuration (cont)

  • Definition
  • Injection


  • JUnit and Mockito are your friends
  • Example

Testing (cont)

  • Add the following dependencies:
  • Create test/resources/bot-config.yml
  • Create test/resources/issue-opened.json

Testing (cont)

Use the Replay UI to capture event details - http://localhost:8080/replay

replay ui

Thank You!

preso qr