DEV Community

Cover image for How to improve the efficiency of git commits in a remote team ?
Lenny Zeitoun
Lenny Zeitoun

Posted on

How to improve the efficiency of git commits in a remote team ?

Why this article

As we dive further into 2022, I thought it was a good time to make a recap of 2021 in terms of tools and technologies that I've put in place as a CTO in a growing (startup) agency.

Covid-19 has, for sure, been a rough time. People had to re-think their infrastructures, how they work, how they communicate and more basically, how they interact and stay organized while being in quarantine. But because of that, it brought new challenges and thus, new opportunities to startup like ours.

Communication is the key

When it comes to organization in a team, most of the time, problems come from a lack of (efficient) communication.
For example, when managing multiple projects at once or working with developers around the world using different technology stacks, you are required to be as thorough as possible in order to keep track of what have been/need to be done. Here starts the problem, even though you can be extremely organized (I've, myself, been using dozen of apps for this kind of purpose, I'll publish an article later on my thoughts & findings), if only one link in the chain lacks rigor, the entire organization is compromised !

My take on 'cutting the man in the middle'

As logical as it is, when you need to rely on someone else, you become dependent on his skills and organizational system, thus, if he misses to keep in touch with you about his latest achievements (egc: push on a git repo to fix a bug, new feature, pull request...), there is an impact on the time it takes to accomplish common actions (code review, merging features).

schema representing what a feature integration

Here is a schema representing what a feature integration looks like with the given problematic

When I understood that I could not control how other human being manage their time and organization, I asked myself 'What can I do to fix this ?', the answer was pretty obvious, I needed to create kind of a bot, acting as an intermediary between me and the developers.
Well, as you can see, it's not so much about cutting the man in the middle but replacing the man by the bot !

Here is a schema with optimized workflow

Here is the schema representing the optimized workflow using the bot I created as a replacement for the human (report) interaction

Creating the perfect assistant

The following list contains (mostly) all the informations I'm looking for when one of our developers make a commit:

  • User making the commit
  • Commit date (localized)
  • Get a clear report on what have been done.
  • Which type of modifications we are looking at (feature integration, bug fix...).
  • Which files have been edited.
  • Number of modifications, number of changes (additions/deletions)

Github action workflow

With these informations, I can do the technical review efficiently, mainly because I know what I'm looking at and what I need to pay attention to.
Based on these criteria, I started building my Github action and this is the workflow I've come to:

  • A developer makes a commit to one of our repos, triggering the Github action.
  • The action processes the infos extracted from the commit
  • It then generates a comment on the given commit with the following infos:

Github action example commit's comment

  • At the same time, it triggers an event for sending an email to the repositories' designated maintainers that looks like that:

Mail received from the Github action on new commit

As you can see, with this process, we receive live the infos we need from the developers without the need of a human report.

Conclusion

Not only did it halve the time needed for technical code review, but it completely eliminated the need to ask developers to "Don't forget to send your report".
You are pleased to use it in your projects, I'm sure that it will help you or your team to be more productive hence having the time for the things that matter the most.
For all configuration options and parameters available for the Github action, you are welcome to take a look at the repository (link below).
Hope you enjoy !
Leave a star on the repo if you find it helpful (and drop a comment on this article to tell me what you think about it)
See you next time !

The repository: Git-Push-metadata-action

GitHub logo ZeitounCorp / Git-Push-metadata-action

Github action that should execute when a new push happens on a repository, should alert the maintainer by mail with the number of files modified, number of modifications, full date (DD/MM/YYYY @ time)

Git-Push-metadata-action

Github action that should execute when a new push happens on a repository, should alert the maintainer by mail with the number of files modified, number of modifications, full date (DD/MM/YYYY @ time) and the commit message

How to use it

  • Open an existing repository or create a new one
  • Add the action to your workflow (inside .github/workflows/)
  • Create the GitHub Secrets required for running the action (Settings > Secrets > Actions > New repository secret)
  • Enjoy detailed notifications on your repository when a new push happens !

Action configuration file (.yaml)

name: Git commit metadata annotation
on: push

jobs:
  annotate-pr:
    runs-on: ubuntu-latest
    name: Annotates commits with metadata
    steps:
      # - uses: hmarr/debug-action@v2 uncomment to debug
      - name: Annotate Commit
        uses: ZeitounCorp/Git-Push-metadata-action@main
        with:
          owner: ${{ github.repository_owner }} # Owner of the repository
          repo: ${{
…
Enter fullscreen mode Exit fullscreen mode

A little bit more about me:

I'm Lenny, (ex) software engineer, now CTO in a growing startup (called Tsohar) focused on Consulting for helping people to develop and grow their ideas into a reliable, rewarding and profitable business.
Here are some links to my networks:

Top comments (0)