Monthly Archives: September 2014

Yeoman grunt-ngmin to grunt-ng-annotate save massive time on your grunt build.


If you have build your skeleton app from yeoman using the angularjs-generator and you created it before August 3rd 2014  you are running ngmin task.

Ngmin has been deprecated and you are told this every time you do an npm install on the project.

Git Issue that resolves this for new generated projects from yeoman

Why to migrate.

ng-min is deprecated so it is no longer supported.

ng-min is slow.  For a mature medium-sized angularjs app ng-min was taking 50 seconds of the build time.  Running with ng-annotate instead it now takes only 2 seconds to do the same thing.

Now the uglify task takes the most time of the build at 8 seconds against the 2 seconds needed for the ngannotate task.

A savings of 48 seconds a build.  

Built Machine spec:

OSX 10.9.5 with 3.2 GHz with 24 GB of ram.  No modifications have been made to the memory settings for grunt or node.

Continue reading

Jenkins Fixing SCM Sync with Git and Failing with Delete Jobs

I have encountered this several times where if you try and change a job name along with any configuration for a job Git will get into a bad state and the SCM will start throwing up errors like:

delete Jobs/OLD_JOB_NAME 

The only thing I have found is to fix this is to follow the following steps:

You will have to have admin rights and the ability to restart your jenkins.

  1. recreate the OLD_JOB_NAME
  2. change the system configuration scm sync to none.
  3. restart the jenkins.  via your_jenkins_server/restart
    1. change the system configuration scm sync to git.
  4. Ensure that the configuration is now syncing correctly  and you do not have any more errors.
  5. delete OLD_JOB_NAME again.
  6. If this still does not work you can try downgrading the plugin and repeating the steps again.


You may lose all your job configurations after you reenable the SCM sync so you will have to make a small change to each job name such as changing the description by a single letter.



Saving csv files from a Nodejs project

Update: package available on bower.  bower -S FileSaver.

I am requesting a csv from another service and I wanted to be able to prompt the customer to save the csv for use later.  I managed to get it to save the csv but the filename could not be set so it was not useful.  I found the following library to help out with this.


Angularjs Custom Form Validation

update: 9/9/14 added the ng-learn link which has  a flushed out example. If you are doing this you will need to change you test cases and include all the things like you were testing a directive.

If you want to set an input value to be invalid before submission then this is a good resource.

$scope.yourForm.nameOfElement.$setValidity( ‘reason’,  false );

E.G.: You want to add an error to your start date in a search form.

$scope.searchForm.startDate.$setValidity( ‘date’, false );

To see a more fully explained example please see:

Click the launch demo button.  Then click the script.js and the spec.js to see the full example.

Managed Script plugin and SCM sync on Jenkins

If you are using  and the

You will have to add a Manual synchronization includes: 


to get it to save the managed files configuration.  Otherwise all your managed script files you share across jobs will be lost if you lose the jenkins server and have to rebuild it.