[SalesForce] Salesforce DX daily limits

As a package developer scratch orgs look like a great solution for automated CI testing and Salesforce has even done some great demos using Github and TravisCI to show automatically testing code using the DX CLI. However, in reviewing the details of DX, it looks like the limit is currently set to 50 orgs a day. If we want to test pull requests against 5 different org configurations, this limits us to 10 test runs a day. On a moderately sized team, this is going to be a tough limit to deal with. Has anyone had any success in working around this limit (or heard of any planned limit increases in the future). My initial thoughts are:

  • Get Salesforce to increase the limit (does not seem likely since this is a very young feature)
  • Reuse scratch orgs for a period of time (this would require a good way to clean them and some savvy CI build code)
  • Run fewer tests (not going to go over well the first time a bug for a specific org configuration slips through)

Best Answer

The limits are discussed in the new winter release document here You can set the expiration time of scratch orgs that seems to be least resistance path on this.

enter image description here

Looks like for Unlimited its 200 and this is a substantial number .But I agree that with CI builds there is huge possibility of hitting this .

Here is what I am thinking in terms of using this for CI

The developer will create the scratch org and alias it .We can use the maximum time of the scratch org to set its expiration .Every developer will be strictly advised to set maximum time as 30 days thats the max.

sfdx force:org:create -f config/project-scratch-def.json  30

As a best practice we can set these to sprint duration .

Yes the limitation really makes me think that we should not be creating scratch orgs on every commit and instead have an environment variable for each git branch that has the scratch org alias or username for the flow .

Related Topic