Continuous Integration for Salesforce
What is Continuous Integration?
Continuous Integration is not a new concept in software development, but the idea has recently gained significant momentum as teams move towards new DevOps and Application Lifecycle Management (ALM) strategies.
As the name implies Continuous Integration (CI) is the process of continuously integrating code changes into a code base, rather than at the end of some fixed release cycle. The quest for CI is all about quality: if you are continuously integrating small changes to your code you are less likely to run into time consuming or bug producing merge conflicts. It’s kind of like the benefit of Google Docs’ autosave feature. It’s always better to constantly save your work rather than run the risk of having it deleted. CI is a risk mitigation strategy for software development teams. The larger the team and the more complex the code base the more important CI is.
CD unlocks the full value of the Salesforce platform by promoting both speed and trust.
What is Continuous Delivery?Another term frequently coupled with Continuous Integration is Continuous Delivery. What’s the difference? Are they the same thing?
Continuous Integration is more about constantly checking your code into a master code base. Whereas Continuous Delivery (also known as Continuous Deployment) is about actually deploying that code to production. You can practice CI without tackling CD. But it would be really hard to do CD without doing CI.
What is the benefit of Continuous Integration?CI is about risk mitigation. Smaller releases are better than larger ones because it’s easier to rollback and handle changes.
CI also provides a major competitive advantage: if you can get your features out to your users faster than your competitors, you will delight your customers.
CI makes developers happier - it’s much more exciting and rewarding to see the features you work on out in production. Code is like inventory. It’s better to ship it and get it out there rather than let it rot on the shelf.
Good code reviews are aided by a source control system that allows you to see differences between different branches in the code baseOrganizations can learn about their customers a lot faster with CI. When you get features out to your customers, you can quickly see what is working and what isn’t. Agile development has become popular and CI is a key facilitator of more agile software development.
What is the benefit of CI for Salesforce Developers?One of the best things about the Force.com platform is the ability to move fast. The Salesforce UI and Developer Console make it easy to get changes out to users fast. However, as anyone who’s had to rollback a change on Salesforce can attest, process does matter. It is important to protect yourself from risks associated with poorly reviewed code changes.
CI gives Salesforce developers the comfort of knowing that they are moving safely as they move quickly. CI requires processes like automated tests and source control which enable developers to move as fast as possible without sacrificing quality. In this sense, CI is kind of the holy grail: it says you don’t have to make a tradeoff between quality and speed. If you implement the right processes you can have both.
Therefore CI unlocks the full value of the Salesforce platform by promoting both speed and trust.
Why is CI hard for Force.com?For a number of reasons, CI has remained elusive to Salesforce developers.
Salesforce Deployments are SlowDeploying on Salesforce is a painful process. We’ve interviewed over 100 Salesforce developers and have heard first hand that it can take anywhere from 20 minutes to several hours to do a Salesforce deployment. This is the first major barrier to CI for Salesforce developers. If it takes hours to get your code into production, you’re not really delivering continuously.
With Blue Canvas you don’t have to manage Ant scripts or processes around change sets. Our push-to-deploy workflow makes deployments really easy.
Salesforce Deployments are Dangerous Without Source ControlIn addition to being slow, deploying to Salesforce is currently more dangerous than it should be. The Salesforce platform does not include any kind of native source control. So it’s unfortunately common for developers to overwrite the work of other developers when they deploy. A proper source control solution is needed in order to fix this.
Further, when a bug is pushed to production, there is no way to rollback to a previous version of the application because there is no source control.
This slows the move to CI because you have to be especially cautious about deployments. This makes teams want to move slowly and deploy less frequently. If, however, a team could be confident that their deployment would not overwrite code from another team member and that they can rollback at anytime, they would be more likely to implement and practice CD on the Force.com platform.
No Ability to DiffThe lack of source control for Salesforce developers also hinders CI because it makes it hard to do code reviews. Code reviews are an emerging best practice for software development shops of all stripes. Good code reviews are aided by a source control system that allows you to see differences between different branches in the code base. Because it’s hard to see this in Salesforce, it’s very hard to know who has changed what when. This makes it really hard to do CI because you are never sure what new changes you are delivering.
Deployment Scripts are a Pain to MaintainToday, there are two primary ways to do production deploys with Salesforce. The first is change sets. This commonly used but unpopular mechanism for deploying changes is rife with challenges. It is highly manual and cumbersome.
Teams that are looking to automate deployments today must use the Ant Migration Tool. Unfortunately, the Ant Migration Tool requires a fair amount of configuration and setup. Ongoing maintenance is expensive and time consuming.
Blue Canvas Enables Continuous Integration for SalesforceBlue Canvas does three things to allow Salesforce development teams of all sizes to pursue Continuous Delivery by addressing the aforementioned issues specific to the Salesforce platform.
Fast DeploymentsBlue Canvas uses Git to handle deployments. Git is all about speed. With Git you can simply deploy the parts of your code base that have changed and avoid the slow, expensive deploys of old. Written in C, Git is optimized for speed at its core.
Easier DeploysWith Blue Canvas you don’t have to manage Ant scripts or processes around change sets. Our push-to-deploy workflow makes deployments really easy. Deploying from one sandbox to UAT or Staging is a simple as a Git merge between two branches. Deploying to production is just a merge from UAT to the master branch of your Blue Canvas repository. We will automatically run your tests for you and report back the results, pausing the deployment if there are any failures.
Safe DeploysWith Blue Canvas you get the full power of Git natively implemented for your Salesforce deployment process. This gives you the ability to implement code reviews, rollback and handle merge conflicts without overwriting people’s work.
Interested in Continuous Integration for Salesforce? Signup for our beta.