We’re Here to Help!!

Find A Solution, Learn Best Practices & Get Support 24x7

Enabling CI, Source Code Analysis and Git Integration in Flosum

Follow

Flosum comes with a lot of rich features that can be enabled as per need. 

Continuous Integration

One of the major pain points of Salesforce deployments is the Big Bang integration of features towards the end of the release cycle. This leads to code merge problems, issues of code coverage and the execution of Apex tests.

Flosum mitigates this by providing the framework for Continuous Integration and Testing. It removes the painful surprises by committing more often and building the changes and testing it in real-time to ensure a high degree of quality, transparency and predictability. Further details about this can be found here

Source Code Analysis  

Source Code Analysis is an essential tool for quality software development. Since Flosum stores all the Salesforce related code of your Org, it makes sense to integrate it with a Code Analysis tool to ensure the quality of your code. Further details about this can be found here.  

Git Integration

Flosum provides a bi-directional integration with Git at both branch and repository level. If a new branch is added in Flosum it will get added to Git also. If components are added or changed in this branch they will be automatically reflected in Git. Further details about this can be found here

 Below we have the steps to set up the above features in Flosum. 

 Continuous Integration can be done in Flosum using native salesforce code only or using external code hosted on Heroku. The next steps are for how you would do it using Heroku. If you do not want to use Heroku for CI, please go here to set that up. Do ensure you have at least version 2.283 of Flosum before you do the below steps. 

 

  1. If you would like to set up Git Integration and do not have a Git Repository, this link shows you how to set one up. 
  2. Then setup Heroku using these instructions
  3. Open the Settings tab in your Flosum org. 
  4. Scroll down to the External Service Settings sectionExternalServerSettings.png
  5. Please input the Username/Password to Heroku application that were set in the Config Variables in Heroku app (do not confuse it with Heroku account credentials)
  6. AccessPoint – this is the URI of Heroku application, one can find it on the Heroku dashboard

Below we have steps to set up CI, Source Code Analysis and Git Integration after the above steps have been completed. Feel free to jump to any of the sections that you are interested in. 

CI Setup 

1. Scroll down in the Settings page to the Repository section

2. Select the repository for which you would like to enable CI. You will get the below screen. 

RepoSettingsPagev2.png

 

3. Check the checkbox for "Deploy changes in Repository" if you would like to auto deploy your code when it is added to the selected Repository. 

4. Check the checkbox for "Deploy changes in Branches" if you would like to auto deploy your code when it is added to any branch associated with the repository. 

5. Select the checkbox "Use External Service for Deployment". This ensures the Heroku service is called to do the deployment. 

6. Add Orgs to the Selected Organizations list that you would like to deploy automatically to. 

7. Select the "Pipeline Deployment style". If "Continue on Failure" is selected, then the deployments will be tried on all the selected orgs even if it fails in some of the orgs. If "Stop on Failure" is selected, then the deployments start from the top of the selected list of orgs and stop at whatever org it fails to deploy successfully. 

8. Use the "Run Tests on Deployment" drop down list to select the type of tests to run on each org when deploying. 

9. Click the Save button in that Repository section. 

 

Source Code Analyzer Setup

1. Scroll down in the Settings page to the Source Code Analyzer section

SCAPic.png

2. Select the "Make code review in each commit to branch

3. Select the component types to Review

4. Click the Save button in the Source Code Analyzer section. 

 

Git Integration Setup

1. Create a Repository in Flosum that corresponds to a git master branch or decide on a pre-existing Repository that will correspond to the Git master branch.

2. Go to EditRepositorySettings VF page and click preview

3. Go to the Git credentials section. Click the "New" button

4. Fill in the relevant fields like host of where your Git repository is hosted(e.g. bitbucket.org), path to the repository(e.g. FlosumMSingh/flosumgittest), the Flosum repository(from Step 1) with which it will be connected and your Git username / password. Mark this connection as the active one.

5. Create a branch in Flosum associated with the Repository created in Step 1.

6. Add some components to this branch in Flosum.

7. In the branch, you will see a link titled "View Sync jobs". By clicking on it you can follow the progress of the sync to git.

8. Log into your git repository. After a few minutes, you should see a branch corresponding to the new Flosum branch created in Step 5. The components you added to the branch in Step 6, should show up in Git.

9. Open, edit and save one or more of the components within Git.

10. In a few minutes, if you reload the "View Sync Jobs" page of step 7, you should see a process corresponding to the transfer of code from Git to Flosum. (Note: Steps 7 and 10 are for tracking purposes only. If you never did them, the transfer would still happen as per schedule.)

11. If you will check the branch in Flosum, you should see a new version of the changed components. You can open the components to check the code changes.

12. Now let's say we commit some of these components from the branch to the Repository in Flosum.

15. After some time, if we check the master branch in Git, the changes should be there.

16. If we add or change some files in the git master branch, they should show up in the Flosum Repository as a new version.

Print Friendly and PDF
Was this article helpful?
0 out of 0 found this helpful

Comments