DEV Community

Cover image for My Progress #GitHubHack23
Mateus Abelli
Mateus Abelli

Posted on • Edited on

My Progress #GitHubHack23

26/04 - First idea

I received an email from DEV in the morning and was happy to read about a new Hackathon that had just begun. My initial thoughts went wild, so many possibilities and ideas but only one was left.

A GitHub Action called diffcool and the tag line would be something like “Because diff should be cool not difficult”. I loved this project! but when the time to think of a more practical concept for production came, I hit a wall. My cool project, the way I imagined it suddenly didn’t quite fit on the category that I wanted to participate in.

It was a though hour to circle around new ideas, even ChatGPT wasn’t being helpful. I needed something unique. After researching previous Hackathons, other GH Actions and refining my thoughts using my previous failure. I came up with a new idea, this is going to fit and it’s going to awesome.

27/04 - Initial steps with GraphQL

I thought that going through pages and pages of documentation would be a pain, but GitHub provides such an awesome tool called Explorer, from this I managed to quickly learn how to query and assemble pieces of information needed for my project.

I managed to get my first feature from drawings and imagination to a more practical concept through a few GraphQL queries, it doesn’t work yet but those queries being integrated together could really turn my feature into reality.

28/04 - My first Action

I completed the practical concept for most of the features, on some of them I resorted to use the good an old git command, I hope it’s not too tricky to combine API calls with “local” commands during the Action workflow run.

After planning for a while (not done yet) it was time to get to know how it was to build the actual GitHub Action. I’ve found this awesome video by Tug on Dev! that really simplified the entire process of creating the action and testing it, the development felt surprisingly simple.

01/05 - Interesting turn of events

After looking for more learning resources I’ve found another great video by glitch.stream on YouTube, this time it was full course on Actions with CI/CD pipelines but I had to skip some of this stuff to focus more on how the runners worked, and also to avoid falling again into tutorial hell.

I finally started the actual development of my own Action and since I’ve exposed to so many different ways to build and consume then, I ended up with bash. It’s not what I’ve been planning to use, but it seems very flexible to use, it’s so flexible that I’ve managed to integrate the gh CLI for GraphQL queries and also run a bit of JavaScript with node inside a single Bash script file.

04/05 - It works

From a bit more than a week ago to today I can finally say “It works”. There’s nothing polished yet but with lots of trial and error the core functionality is there.

I’m building a Pull Request Tracker, with 3 planned features, the main one is for checking if there are other PR with the same files, the second one is for checking if there are conflicts in between them and the last one is for checking if there are duplicated hunks among those files.

This is a markdown mock of the contents of the comment that this Action is going to produce

Checks PR Tracker Status
☑️ 3 pull request(s) found with the same file(s)
0 conflict(s) detected among them
0 similar hunk(s) spotted

07/05 - Features development

From my previous report I was left with the check pulls feature done, yesterday I implemented the check conflicts and today it was the check hunks. I definitely moved way faster than when I was pushing the first feature, because this time there is a base do build on top of.

The check conflicts feature basically clones the repo then uses the gh cli command to checkout into the PRs and does a "dry run" of the git merge command to check if there are conflicts in between those branches.

The check hunks is giving a bit more of trouble because it needs to reference the files and from the files their diffs to extract the hunks and compare them. It's giving false positives at the moment so I had to temporarily disable it.

This is a screenshot the current state of the project:

Image description

17/05 - v0.0.1-alpha

I did it, yesterday I published the very first version of this project to the GitHub Actions marketplace. It was a long road but this project has finally gone live to the world.

The development so far has not changed a lot from my previous report, I did make some refactoring specially on the comment module, now it's responsible for actually composing the comments with data exported from the other shell modules, instead of receiving a pre-baked comment.

I've just posted the official release post for the Hackathon and I'll be doing a few more tests and updating the code. I hope this project attracts people and be helpful for them.

https://github.com/mateusabelli/pr-tracker


Thanks for reading. Have a nice day!

Top comments (3)

Collapse
 
abhixsh profile image
Abishek Haththakage

Motivated from this.

Collapse
 
darkterminal profile image
Imam Ali Mustofa

Amazing story dude... keep it up!

Collapse
 
mateusabelli profile image
Mateus Abelli

Thank you, yes I will!