Code Monkey home page Code Monkey logo

como's Introduction

Why?

It started as a fun-project - and still is: One day we discussed at internezzo how we can give away an award to our employees for e.g. "the committer of the month" (hence the name "CoMo").

CoMo fetches the meta data of commits from Git repositories, stores them in the database, aggregates them and renders some stats per person (this part and some trending stuff will be added soon).

The main screen looks like this:

Screenshot of CoMo in action

The stats can be integrated in a radiator screen within one's office to publicly promote the most active employee. To show different tool's output and "flip" through those pages one after each other, we've additionally built a small wrapper called "radiate"

But it goes even further: There's a command controller that can be run e.g. once a day to fetch a list of all repositories from a remote server via the Gitweb frontend. This eases it a lot for us as newly added repositories will be detected automatically by CoMo.

Regarding the repositories: Remote repositories will be cloned the first time, then just the changes will be pulled down to the local clone to save bandwith and processing time. For repos that are located locally (URL begins with file://), no clone is made, their log get's directly read from the original repo location.

Does it make sense?

Well, basically one can create a ton of smallish commits and he'll be the winner every month. That's true and of course a fact. CoMo is really more about the fun. But if you and your team is running via a code-review system (e.g. Gerrit) before committing to your master branch, the number of "merged-to-master"-changes get's more relevant of course (and you'll directly see those black sheeps that try to cheat with small commits)

Feature list

  • Automatically fetch a list of repositories from a Gitweb-Frontend (can be run e.g. daily to detect new repos)
  • Extracts the commit's meta-data for each repository
    • only extracts the latest n days to save resources (configurable)
    • only extracts stuff that hasn't been extracted yet (e.g. the new commits since the last extraction run)
  • Aggregates the extracted data
  • Automatically elects the winners based on the aggregated data
  • Sends a notification e-mail to the ceremony master upon electing a new award (so he can hand over the physical award to the winner)
  • Everything can be automated via cronjobs
    • cronjobs are built in a way that they can be fired regularly and will just exit as soon as nothing is to do
    • they have a "be quiet" flag
  • Shows several big-screen optimized views:
    • the last month's winner(s)
  • If the committer's e-mail address has a gravatar image, this one will be shown - or a fallback pixel-image if there's no portrait

Configuration options

  • maxDaysToFetchFromGitLogHistory: 100

    Defines how far back in the git log we're going to extract the commits (to avoid extracting and aggregating data for e.g. 10 years of commits and then just electing the award for the last month or so).

  • cacheBasePath: %FLOW_PATH_DATA%Temporary/

    Sets the base directory to be used for the local cloning of the remote repositories before the data can be extracted.

  • whoGetsCredits: author

    Defines who'll get the credits, this is defaulting to the author which usually is the one that created the change and often is the same person that commits the change. The whole thing is configurable for situations where you want to credit the committer instead.

    Allowed values: "author" and "committer"

    Sinces v1.2.0

  • sendNotificationMailsForCoderOfTheMonth: FALSE

    Whether to send mails to the ceremony master upon election of a new coder of the month

  • sendNotificationMailsForTopicAwardWinner: FALSE

    Whether to send mails to the ceremony master upon election of a new topic award winner

  • ceremonyMasterEmail: [email protected]

    The e-mail address of the ceremony master (get's notifications upon newly elected awards)

  • senderEmail: [email protected]

    The sender e-mail address

  • senderName: CoMo

    The sender name of the mails

Getting it set-up

To get the system up and running, of course you need to have a TYPO3 Flow setup and install this package into it (it's on packagist as mrimann/como. Then you need to execute the following commands on the commandline - or even better run them via crontab to let the system do the work on it's own:

Adding new repositories

A list of repositories to monitor is kept in the database. If you run a server that hosts your Git repositories and have a Gitweb-Frontend installed, CoMo can actually get a list of all repos e.g. once daily and automatically add new repositories that have been created so they get monitored, too.

./flow help repodetectorgitweb:fetchrepos

This will show you all the options on how to use this command.

Processing the data

There are two commands that do the whole data-processing-stuff. Just execute the following two commands to get stuff processed:

./flow metadataextractor:processrepositories
./flow dataaggregator:processcommits

Electing the Coder of the Month

Based on the now processed (aggregated) data, CoMo can now elect the Coder of the Month if you execute the following command:

./flow election:electlastmonth

This will elect the coder of the month for the last calendar month (since the current month is not over yet, it can't be elected yet).

How to contribute?

Feel free to file new issues if you find a problem or to propose a new feature. If you want to contribute your time and submit a code change, I'm very eager to look at your pull request!

In case you want to discuss a new feature with me, just send me an e-mail.

Want to make me happy?

Here's a list of things to make me happy and that will keep me doing stuff like this in the future :-)

License

Licensed under the permissive MIT license - have fun with it!

como's People

Contributors

mrimann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

como's Issues

Config option for date range

In case there's a very "old" repo being checked, we should avoid to extract every single commit from the last 10 years - and then just use the last 1 to 6 months for the aggregation + awards.

Show the number of commiters last month

On the base screen view, we have a sentences like "there were X commits within Y of the Z monitored repos last months".

This could be extended by "... made by n different commiters"

Commands fail don't persist changes during one request

Repository::add(), Repository::update() and Repository::delete() don't persist changes. They are only written to the backend when PersistenceManagerInterface::persistAll() is called (which happens automatically after each request).

Because changes are not persisted explicitly during loops in the controllers - for example here https://github.com/mrimann/CoMo/blob/master/Classes/Mrimann/CoMo/Command/DataAggregatorCommandController.php#L50 the aggregated data can be incorrect.

Possibility to exclude certain commiters

The Code-Review-System for example shouldn't get any credits or even an award -> add an option to exclude certain users from getting an award (but still collect their data)

exec function PHP error

metadataextractor:processrepositories function sends 'Only variables can be passed by reference' in MetaDataExtractorCommandController.php at line 183
"exec ('git pull', NULL, $pullResult);"

Show a trend for the upcoming awards

Ideally we'd show the top 3 per category - with a trend indicator per person, showing the difference in ranking compared to the last (elected) month.

Depends on: #7

just index the master branch

Currently, also feature and maintenance branches (ok, every branch) are integrated into the aggregation of data

Show the upcoming (expected) award winners

This should be short-reloading to show, who would be the next award winner, in case the election would be held now.

Idea is to show that in the right column of the page

Show a random commit of the day

Would be nice to show a randomly picket commit of the day, showing the following data:

  • Project-Name
  • commit-message
  • Author details
    (but no code)

Add a general status screen

Showing e.g.

  • a pie chart of the commits of the last vs. current month (split by type).
  • a trend line of the number of commits from the last 6 or 12 months

Dashboard: Show the number of different committers

Currently the sentence is something like::

Last month we've seen 323 commits within 42 of the 199 monitored repositories. 

It would be cool to also mention by how many different committers those commits were produced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.