10 Salesforce Open-source Projects for DevOps Engineers
The other day I read this great article from SalesforceBen titled 23 Salesforce Apps Professionals Can't Live Without. It's a great article, and many of the apps there are indeed incredibly useful!
I decided to take inspiration from that (thank you, Ben and team!) and create a spinoff that focuses on Salesforce open-source projects that have a focus on Salesforce DevOps.
Let's get started.
1. HappySoup's core module
No bias here :)
HappySoup.io is powered by sfdc-soup, a JavaScript module that provides a very simple API to extract dependencies from many metadata types.
Here's an example of how to use it
let standardField = {
name:'Opportunity.StageName',
type:'StandardField',
id:'Opportunity.StageName',
}
let soupApi = sfdcSoup(connection,standardField);
let usageResponse = await soupApi.getUsage();
let dependencyResponse = await soupApi.getDependencies();
fs.writeFileSync('examples/usage.json',JSON.stringify(usageResponse.usageTree));
fs.writeFileSync('examples/dependencies.json',JSON.stringify(dependencyResponse.dependencyTree));
How it works
sfdc-soup
uses the MetadataComponentDependency
API to extract at least 60% of the dependencies. The rest are extracted "manually" by using the Metadata and Tooling APIs.
sfdc-soup
is also used by DX@scale, a project that is also on this list.
2. SFDX-Hardis
SFDX-Hardis was created by Nicolas Vuillamy, CTO of Cloudity and open-source genius.
The project is 2 fold:
1) A wrapper around many sfdx commands. This wrapper provides a ton of added functionality, such as better error messages, code coverage enforcement, etc.
2) Many of the tasks in the wrapper can be called using the vscode extension, which pretty much converts vscode into a fully fledge release management software for Salesforce.
It's quite amazing!
How it works
SFDX-Hardis is actually a Salesforce CLI plugin. You can see here how many of the standard sfdx
commands have been wrapped in order to provide additional functionality on top of them.
You can learn more about SFDX-Hardis in this video by DevOps expert Vernon Keenan
3. NebulaLogger
NebulaLogger is an amazing logging framework for Salesforce created by Jonathan Gillespie. To be honest, I've never used it, but after spending some time going through the documentation, I wish I had used this in my previous projects.
If you are thinking of creating a custom object and a specialized apex class to store your system.debug()
entries in the Salesforce DB, stop that! This framework has so many amazing features that you'll simply be playing catch up.
How it works
The framework provides methods for Apex, LWC, and Flows to log information. You'd use this instead of system.debug
if you want to persist the logs.
There's support for multi-transaction logging, which is useful for async apex, such as batch apex.
The app can be installed as either an unmanaged or managed package.
4. OrgCheck
OrgCheck was created by Salesforce Architect Vincent Finet. This amazing app provides end-to-end visualization of your Salesforce metadata, with a specific focus on identifying areas with technical debt, such as unused fields, roles without users, etc.
The app was recently absorbed by Salesforce Labs and it's also on the appexchange! You can see a quick overview on this video
How it works
The app is pretty much a fullstack app built on top of Salesforce. It uses LWC on the front end, jsforce on the "backend" (technically still the front end), and a module-based architecture.
Here's an image of how it is built
5. Salto
Believe it or not, Salto is partially open-source. Salto is a commercial DevOps solution for Salesforce and other business applications, providing a single solution for your entire tech stack.
On the Salesforce side, it provides impact analysis/"where is this used" (via its free-forever tier), metadata deployments, CPQ deployments, Git integration, and metadata visualization.
How it works
Salto's core CLI is open-source. The CLI is what powers the SaaS application (which is closed-source and what customers actually purchase), much like HappySoup.io uses sfdc-soup
behind the scenes.
The CLI is available for anyone to use. I wrote an article explaining how developers can use the Salto CLI to, for example, turn off all validation rules by using environment variables.
What is amazing about Salto being open-source is you can see the pull requests created by the engineering team as they can collaborate on features. And you can literally see the code that is used by many Salto customers.
For example, here's a PR showing how the engineering team implemented a change related to feed history tracking
I really love this level of transparency!
6. sfpowerscripts by DX@Scale
DX@Scale is a set of practices and open-source tools for modular development on the Salesforce platform.
One of its open-source tools is sfpowerscripts, a Salesforce CLI plugin with custom functionality to create scratch orgs, deploy package dependencies, and much more.
How it works
Too complex for me to explain :) I recommend reading their docs if you are interested in modular development for Salesforce.
7. Salesforce Productivity Burst
SPB was created by Raffaele Preziosi as a VSCode extension that provides different utilities for Salesforce.
One of my favorite ones is the "go to salesforce" button, which allows you to open an sfdx file in the Salesforce org that the project is connected to.
How it works
As mentioned above, it's a VSCode extension. Here we can see the code that it uses to implement the "go to Salesforce" feature
It's a combination of parsing the xml
files from the sfdx project and calling the Tooling API to get the Id of the metadata record in question.
8. sfdx-git-delta
This is one of my favorites. sfdx-git-delta is a Salesforce CLI plugin that allows you to deploy the delta (i.e, the changes) of 2 git branches so that you don't have to deploy the entire branch
How it works
The plugin provides a CLI command that you should call by providing 2 git commit hashes, like this
sfdx sgd:source:delta --to "HEAD" --from "HEAD~1" --output "."
The differences between the commits will be put in a delta
folder. You can then point your sfdx force:source:deploy
command to that delta folder.
The code uses Git behind the scenes, and it looks quite complex. I know I wouldn't try to replicate this manually!
9. source-deploy-retrieve
SDR is a Salesforce CLI plugin owned by Salesforce, which powers the metadata retrieval and deployment capabilities of the Salesforce CLI.
I recommend reading the docs just to get an understanding of how the CLI does a few things behind the scenes. It's all very interesting (and complicated; I don't understand half of it :) )
10. God
Ok, not god, but js-force is what powers many of these other projects; it is a state-of-the-art JavaScript library created by Shinichi Tomita for interacting with the Salesforce API.
Without it, many of these projects wouldn't exist or wouldn't be as good as they are. It would be an insult not to include it in this list.
Conclusion
That's it for now! I'm sure there are many apps that I missed. If you know of one worth mentioning, let me know!