Back to the article list

10 Nov 2013

Continuous Quality Feedbacks for your Projects

We recently added branches support in SensioLabsInsight. Have a look at the new "Analyze" button and notice how you can now run an analysis on a different branch/reference than the default one (set in your project configuration):

And when computing the violation diff, SensioLabsInsight smartly guesses the "previous" analysis, even if you are using sha1 references instead of branch names like 1.0.

Those new features are very useful if you want to continuously check the evolution of a project quality as it lets you run analyses on all branches of a project and even for pull requests in an independent way. The branch names for the analyzed commit are displayed on the analysis page:

And triggering an analysis automatically every time you push some code is really easy thanks to our API and our PHP SDK.

If you are using Github, go the Account page, and under the "API/SDK" tab, there is a special section about Github at the bottom. Copy the webhook URL and add it as a "Services Hook" on the Github settings page for all projects you want to continuously analyze with SensioLabsInsight:

If you are using Jenkins or any other continuous integration platform, you can trigger an analysis by using the following URL pattern: https://XXX:YYY@insight.sensiolabs.com/api/projects/ZZZ/analyses.

where XXX is your user id, YYY is your API token, and ZZZ is the project id. How do you know the values for a specific project? Again, the API page gives you everything you need to get started fast. Select the project you want to analyze in the select box, and copy/paste the URL it gives you below:

You can then POST on this URL via Curl:

curl -X POST -H "Accept: application/vnd.com.sensiolabs.insight+xml" "https://XXX:YYY@insight.sensiolabs.com/api/projects/ZZZ/analyses"

Happy quality!

comments powered by Disqus