DEV Community

Cover image for Commit Teller - The implementation
Nándor Holozsnyák
Nándor Holozsnyák

Posted on • Edited on

Commit Teller - The implementation

How will it be implemented?

As a Java developer I wanted to stick to Java, and I love the Quarkus project, so I thought I will create a CLI application that can do the job, a CLI app that can be the backend of the GitHub action.

Integration points

In the CLI application I need two integration points:

  • One to the GitHub API - It can return me the issues, pull requests and it can create me comments on any of them.
  • The other to the OpenAI, this is basically the brain of the stories, this will be able to parse, and interpret your commit messages and create the story about that.

Setup

The project will contain 2 modules:

  • One will be the core
  • And the other one will be the CLI module.

I'm just used to these setup, because if the core module contains the core "business" logic I can easily use it for other modules as well, like for a JBang script or for a Maven plugin easily.

With this setup I can "practice" the setup of multi-module projects with Quarkus. While it is probably super straightforward for other frameworks or pure Java projects, in case of Quarkus, if the developer would like to use the super power of the framework, the developer mode or the continuous testing then the core module must include the Jandex Maven plugin to make sure the mentioned stuff is working well.

Uber-JAR

I'm planning to bundle the CLI application as an Uber-JAR that will contain all the necessary dependencies for the application and anybody with Java on their system will be able to run it.

How about compiling it to native?

A few weeks ago I started another project with Quarkus and I was surprised that the native compilation is getting faster and faster, I do not say it is like lightning fast, but I was shocked that a CLI app with two modules and with a few dependencies was compiled in less than 2 minutes to native mode.

In 2019 when Quarkus was released with its GraalVM integration it was not that easy to setup the whole environment, but today the Quarkus plugins (Maven or Gradle) are super smart and even if there is no GraalVM (or Mandrel) installed on the machine, if it detects Docker it can compile it to native, and on the other hand Quarkus devs also recommend to use the Docker way, because if it is being built on your local machine, you might misses some crucial dependencies, and it may run on your system but not on others.

We will see if we can compile it to native and host it as a Docker image.

What is ready from the implementation?

Almost nothing, only a small PoC that can connect to the GitHub API and to the OpenAI's API.

Stay tuned for more and leave feedback about the project idea.

Top comments (0)