Back to the article list

11 Apr 2014

Branch Analysis Made Easier

Many Insight users analyze non-master branches. The support for such analyses was clunky, and we've just released an update to make it easier.

Choose The Branch From The Analyze Button

Whenever you need to analyze another branch than the default one, click on the left part of the "Analyze" button to reveal the branch choice input. Then type the name of the branch you want, and click on "Analyze".

The branch dropdown is present on all occurrences of the "analyze" button.

See Non-Master Branch Analyses In The List

Every analysis made on a branch different than the default one shows the branch name close to the project name. That way, you can immediately spot those non-master analyses, which is especially useful if you're using a SCM hook to analyze all pushes to the master repository, including on feature branches. You can set the default branch for a project in the project settings if it's not master.

By the way, did you notice that the name of the person who triggered the analysis is displayed above the project name? That way, you can know when a collaborator, or the API, launched an analysis for you.

The mention of the branch is also displayed in the full report sidebar, where you can see the title of the last commit in the analyzed branch.

Detection Of Parent Analysis

Each analysis is compared to its "parent" analysis to determine if there are new violations (red arrows), or fixed violations (green arrows). Determining the parent of an analysis in the master branch is easy: it's the last analysis on the master branch. But how about when you analyze another branch?

We've implemented an algorithm using the git history, to find the first ancestor of the analyzed branch already analyzed by Insight. This helps you figure out the real quality evolution of a branch:

  • If this is the first analysis in the branch, the analysis is compared to the latest analysis on master
  • otherwise, the analysis is compared to the previous analysis on the same branch

Ignore Branches In SCM Hook

If you use a SCM hook on GitHub, you may not want to have your project analyzed each time you push to the gh-pages. The default project configuration has been updated to take gh-pages into account, using a new setting called ignore_branches:

    - gh-pages

You can add more branches to ignore so that some pushes to your projects don't automatically trigger an Insight analysis.

We're still working on the branch analysis feature - make sure you come back in the next weeks to see the changes!

comments powered by Disqus