Skip to content

Improve DevEx for event handlers #719

@lppedd

Description

@lppedd

I find myself in a situation where creating a class to handle GitHub events results in multiple inspection warnings in IntelliJ IDEA.
Take for example this screenshot:

Image

This works perfectly. Quarkus wires up PullRequestMilestoneCheck and injects the constructor dependencies, and this GitHub extension does its job.
However, the class and all its methods are marked as unused, there is no IDE navigation to the injected beans, and it is unclear which bean scope the extension assigns to the class.

This could be improved by:

  1. mandating the container class be annotated with @Singleton or @ApplicationScoped. Transitively avoids an explicit open.
  2. moving event annotations to the method level

Image

@Opened
@Reopened
@Edited
@Synchronize
fun onPullRequestEvent(payload: GHEventPayload.PullRequest) {
  //
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions