Replies: 3 comments 1 reply
-
Btw, this is a common use-case probably. Wanting to Would it make sense to include a facility in the extension itself? |
Beta Was this translation helpful? Give feedback.
-
The way the extension makes it cute uses code generation and this is doable because it's an extension. A Quarkus extension contains some build time components and can be used to alter the build and generate code. I think the way you do it is good enough and I wouldn't overthink it. It's worth going the extension way when you're building something more general purpose and it's actually a good idea to streamline things for a lot of use cases.
I agree on that. But while the feature might be common, the way people will interact with each bot is actually quite specific. For our build reporting stuff, I actually created a library with the feature. Feature that can be reused in different GitHub Apps or even GitHub Actions. See https://github.com/quarkusio/build-reporter . It might be a good idea at some point to create some sort of library of reusable components. |
Beta Was this translation helpful? Give feedback.
-
@gsmet thanks!
Can this be applied to commands too? I'd really like to extract some of them to a common library. |
Beta Was this translation helpful? Give feedback.
-
I have implemented a very simple command:
which is useful when a user wants to restart a set of checks.
The command implementation is the following:
A possible observer could be:
Now, it's all good, it works. But, is there a way to make it more elegant like it's done in this extension?
I see on the README diagram that CDI events used, but how is the
@Observes*
annotation masked?An end result I'd appreciate could be:
Beta Was this translation helpful? Give feedback.
All reactions