quarkiverse / quarkus-github-app

Develop your GitHub Apps in Java with Quarkus.
https://docs.quarkiverse.io/quarkus-github-app/dev/index.html
Apache License 2.0
60 stars 27 forks source link

A list of repository events are throwing java.lang.IllegalStateException #587

Closed kacamific closed 3 months ago

kacamific commented 3 months ago

Hi,

for the following events:

void transferred(@Repository.Transferred GHEventPayload.Repository repository) void renamed(@Repository.Renamed GHEventPayload.Repository repository) void unarchived(@Repository.Unarchived GHEventPayload.Repository repository) void privatized(@Repository.Privatized GHEventPayload.Repository repository) void publicized(@Repository.Publicized GHEventPayload.Repository repository)

there is the following exception ex: Caused by: java.lang.IllegalStateException: Parameter subscribing to a GitHub 'release' event must be of type 'org.kohsuke.github.GHEventPayload$Release' or 'io.quarkiverse.githubapp.GitHubEvent'. Offending method: com.gitrealm.bot.RepositoryListener#void renamed(org.kohsuke.github.GHEventPayload$Repository repository)

It looks like the mapping is done with the @Release(Renamed.NAME) instead of @Repository(Renamed.NAME)

gsmet commented 3 months ago

You're absolutely right, I fixed them here: https://github.com/quarkiverse/quarkus-github-app/pull/588 .

I must admit my work is mostly focused on in-repository events so I missed this one.

Thanks for reporting. Once merged, I'll release a bugfix release right away.

kacamific commented 3 months ago

@gsmet thanks for your super fast reaction!

gsmet commented 3 months ago

2.4.1 is available on Maven Central with the fix.