DEV Community

Cover image for Introducing Git branches tracking on MoonCode
Friedrich WT
Friedrich WT

Posted on

Introducing Git branches tracking on MoonCode

I’ve been building MoonCode, an application for code stats monitoring (files, projects, programming languages used, …) for the past few months. I wrote about it in a previous blog post. And just recently, a new feature got pumped out. The Git branches of your projects are now taken in account. To take advantage of that feature, you just need to keep working like before, switching between branches if needed and the extension will immediately pick up. This is only applicable for version-controlled projects.

On the dashboard, for each of your version-controlled projects, you can now filter the stats of the project per branch(es).

Feature overview on a project:

MoonCode branching feature overview

MoonCode branching feature one branch selected

MoonCode branching feature two branches selected

This doesn’t mean that the code tracking is disabled for non version-controlled projects, it will still work like before. Non version-controlled projects have no Git branches so of course there is no branches filter there.

For the implementation of this feature, most of the work happened in the api layer. Of course there was some work involved to display the branches dropdown on the dashboard, but this is marginal compared to the api and extension. On that latter, I had to include the current branch in the data sent to the api, but the global structure didn’t change that much. But for the api, it was mostly about updating the database schema to count the branches in, adding new modules, updating the existing endpoints to receive the data from the extension (branches included) on one hand and take the branches in account on the analytics side (dashboard endpoints) on the other hand.

So, that’s all for this blog post, I’ll be sharing new updates as I add them.

Cheers 🥂🥂!

Top comments (0)