Thursday, March 27, 2014

Points estimation with beers

This week I made a quick presentation where I work to make us rethink point estimation.



Original presentation in portuguese:

Wednesday, March 26, 2014

maven-formatter-plugin got faster

A week ago (give or take) I post about my maven-formatter-plugin fork here.

Back then, I was trying to get it faster and if possible get it using all power my computer have.

Well, it is faster now!

The eclipse luna M6 contains a formatter way faster, so I decided to make a new release and include it!

I tried it on a big project (about 3K files and 100K lines).

The format validation time drop from 24s to 16s.... 30% faster.

<plugin> <groupId>com.marvinformatics.formatter</groupId> <artifactId>formatter-maven-plugin</artifactId> <version>1.4.0.M6</version> <executions> <execution> <goals> <goal>validate</goal> </goals> </execution> </executions></plugin>

Not bad, not bad at all.

Monday, March 17, 2014

One Formatter to rule them all!

Here we use pull request every day, every time.  All work is pull request oriented (thank you so much github).

But, a multicultural environment (multi-OSes, meaning multiple encoding + multiple line endings) can be a sore sight for eyes.

Here is a example:
https://github.com/velo/querydsl/pull/3

Someone though it was a nice idea to change the code format for a class.


691 lines of code changed.  How many meaningful? ZERO! I know it is ZERO cause I made it that way, but sometimes there is a single line changed and other 690 of pure chaos!

To help, some guys came up with a maven-formatter-plugin... It works, maven build breaks if you start doing funky changes.

That helped, a lot, but we had to open console and launch maven, it wasn't good enough.  Better then nothing, but still far from reasonable.

I looked and the project felt abandoned.  And I needed it. Was time to act.  Was time to create a fork.
https://github.com/velo/maven-formatter-plugin

The forked version presents some advantages:

  1. support javascript formatting (as well java inherited from the original code)
  2. contains an m2e configurator
  3. uses eclipse kepler formmater (getting ready for luna soon)
  4. uses N threads in order to get things done faster
At this point is necessary to install the m2e configurator by hand, but still, it helps, A LOT!
Update site: http://velo.github.io/maven-formatter-plugin/p2/1.3.0

Once installed, the plugin will set eclipse formatter to the same used on maven.

We now are free from pull requests with meaningless changes.  All business now.

Enjoy!

Saturday, March 8, 2014

Getting pull request and sonar playing toghetter

One thing I really dislike is duplicate efforts!

I wanna do things once, well done and to last as long it should.

For instance, when I go to the market, I buy whatever I need for the next 2 days but not more then I would need for a week.  This way I can carry it all in a single trip, I have fresh products and don't need to get into market 3 times a day =D

Back to this post.  At my company we are ADDICTED to pull requests!  All work goes to review before it goes to production.  That has N+1 advantages that I won't explore on this post. Anyway we do it, a lot!

But then, we decided to use Sonar to point out obvious problems.
After we bought a shine new EC2 machine, we setup Sonar, set our CI to run reports once a day and then.... well, then nothing!

We kept falling into same issues sonar was supposed to help us to flush out.

But why?  The sonar report was there, to everyone to see!  Nobody saw it =/
But why?  Cause sonar was some other place people don't go!

If there was a way to make sonar report to be written at github, on our pull requests.

Googling lead me to nothing.
Was time to get my hands dirty.
And so it begun!

https://github.com/velo/sonar-pull-request-integration

After 2 weekends working on it I was ready to show to my co-workers.
Live at https://github.com/velo/querydsl/pull/1/

Everybody got really excited with this.  So I decided to try this on some really pull request we did on our every day work.  Well, was kinda failure, lots of bugs on my tool.  But after a few hours fixing then SUCCESS!!!

We now adopted this feature under the company organization and are maintaining it since.
https://github.com/ContaAzul/sonar-pull-request-integration

To execute this plugin use the following command:
$ mvn com.contaazul.sonarpullrequestintegration:sonar-github-pull-request-maven-plugin:publish -Dsonar.branch=hazelcast -Dgithub.pullRequestId=1 -Dgithub.repositoryOwner=velo -Dgithub.repositoryName=querydsl -Dgithub.oauth2=**********

Hope it is useful to others.