Gearset’s repo dependency cleaner deletes Salesforce metadata with missing dependencies from your repo, because anything with a missing dependency cannot be deployed to a Salesforce org.
The repo dependency cleaner runs only when you deploy to a Git branch and your deployment includes a destructive change. This prevents you from leaving an item with a missing dependency, if you deleted the item on which it depends from the repo. You’ll be able to see any deletions in your version control system; they will be part of the same commit as the deployment.
The cleaner doesn’t delete everything with a missing dependency. It looks for the metadata types that most easily end up with missing dependencies, such as a profile’s permissions for an object, where the object is not actually in the repo. In this case, the cleaner would delete the permissions because they are undeployable without the object.
These are the metadata types the repo dependency cleaner looks at, to make sure there are no missing dependencies:
These are the metadata types that will be deleted if they have missing dependencies:
Profiles (and permission sets for API v40 and older)
Apex class permissions
Although the repo dependency cleaner is triggered by certain deployments, it does not only look at items related to that deployment package. The cleaner looks at the metadata types listed above, across your entire repo. Metadata deployed to source control with another tool besides Gearset - or deployed to source control with Gearset but years ago - might include items with missing dependencies. If so, this undeployable metadata will be deleted by the cleaner.
Can I turn off the repo dependency cleaner?
You might want to turn off the repo dependency cleaner if you deliberately deploy items with missing dependencies through source control. For example, if you have lots of managed packages in your orgs, you might want to deploy the permissions for managed packages’ objects and classes but not deploy the objects and classes themselves. The repo dependency cleaner would delete these permissions, because the items on which they depend are not in the repo.
By default, Gearset’s repo dependency cleaner is enabled. To disable or enable the cleaner, go to
My account >
Source control and use the toggle under
Repo dependency cleaner. This is a team-wide setting, so it applies to all repos deployed to by everyone in your team.
If you do decide to disable the cleaner, and then re-enable it in future, note that it will still delete the items you sought to protect originally, as soon as you deploy a destructive change to that repo. Only re-enable the cleaner once you are sure that items with missing dependencies no longer need to be stored in your repo.
Want more information?
Check out our repo dependency cleaner blog post here.