DEV Community

Cover image for Commit Teller - Your personal story teller for your work
Nándor Holozsnyák
Nándor Holozsnyák

Posted on • Updated on

Commit Teller - Your personal story teller for your work

What I built

A new tool has been built that is able to tell a story about your project based on the commit history of your branches, pull requests.

The story can extended along the way and it can be attached to the pull request/issue that is being closed.

Category Submission:

Wacky Wildcard

App Link

https://github.com/rodnansol/commit-teller-action

Screenshots

Pull request before executing the action

Successful run

The steps

The result

Some other example results, the tool was run on older pull requests, and because of that the author of the comments are myself, and not the github-action bot.

Smaller ones:

https://github.com/rodnansol/spring-configuration-property-documenter/pull/53#issuecomment-1557572266
https://github.com/rodnansol/spring-configuration-property-documenter/pull/53#issuecomment-1557572266

https://github.com/rodnansol/spring-configuration-property-documenter/pull/60#issuecomment-1557576442
https://github.com/rodnansol/spring-configuration-property-documenter/pull/60#issuecomment-1557576442

https://github.com/rodnansol/spring-configuration-property-documenter/pull/45#issuecomment-1557578982
https://github.com/rodnansol/spring-configuration-property-documenter/pull/45#issuecomment-1557578982

And it definitely can do longer ones, in this case the configuration parameters were the following:

COMMIT_TELLER_OPENAI_TEMPERATURE=0.8
COMMIT_TELLER_OPENAI_MAX_TOKEN=2048

COMMIT_TELLER_STORY_TEMPLATE='Write me a story about the following commits. \n
  The story can be only 1536 characters long. \n
  The story should be based on the commit messages, and it should have the following characteristics:'
COMMIT_TELLER_STORY_CHARACTERISTICS='documentation like, funny'
Enter fullscreen mode Exit fullscreen mode

https://github.com/rodnansol/spring-configuration-property-documenter/pull/53#issuecomment-1557591882

https://github.com/rodnansol/spring-configuration-property-documenter/pull/53#issuecomment-1557591882

Description

The GitHub action utilizes a CLI application that is able to read the commit messages for an given pull request and based on it, it can build a story, that can be descriptive, funny, happy, you name the mood of it. The CLI application uses the GitHub API and of course, the nowadays overhyped OpenAI. It connects to OpenAI via their public API (so an API key is needed) and it will translate your commit messages into a beautiful story.

The CLI application was built with Quarkus, as a Java developer I wanted to use a framework that can help me move fast and I have confidence and fun with that. I definitely did!

Link to Source Code

Permissive License

Apache

Background (What made you decide to build this particular app? What inspired you?)

OpenAI's ChatGPT shocked the world (you decide if it happened in a positive or in a negative way for you) and developers, companies are already utilizing their features and enhancing their productivity. There are people who are creating content with that, and I thought... Wait a minute, how about an app that can integrate OpenAI's API and it can summarize me commit messages for pull request. There are million projects out there, and you might not know its story, maybe you want to dig deeper and get to know every small detail of it, so how about a tool that can help your with that?

Don't you like writing documentation? Then write detailed commit messages and use the tool for it! It will not be a full-blown documentation for your API, but if you are just playing with your skills and thoughts this one will help your to have visibility for other people if they are interested in your work.

The characteristics, the OpenAI model and many more can be configured, so you have the ability to have your own story behind your commits :) 🎉

How I built it (How did you utilize GitHub Actions or GitHub Codespaces? Did you learn something new along the way? Pick up a new skill?)

As a Quarkus fan, I'm using this Java framework whenever I can, and for CLI apps this is my go to choice.

But why a CLI app?

Because with that I can use it not just in a GitHub action but on my laptop as well, but it definitely gives us wacky questions, why would you like to run it on your laptop? 🧐

First things first, I just made the new Quarkus project, from the template that I have been already setup for CLI applications in my brand new organization called Rodnan Sol on GitHub (Do not forget to follow me here 🧑‍💻!)

After the CLI app was ready I made a new repository which contains the setup/configuration for the GitHub action as well.

The setup was easy as the app requires a GitHub token, but GitHub actions always have one implicitly setup for you, but their permission can be changes, this is something I learnt during this time I was making the action setup. This is cool because the token can be narrowed down to the least required list of permissions, so if your action does not have manage repositories you can definitely turn those off, and if they get leaked during the action's lifetime, it could cause no harm to you and your repositories.

Additional Resources/Info

Top comments (0)