sfdx-hardis configuration

Type: object

Configuration file definition for sfdx-hardis Salesforce DX plugin

No Additional Properties

Allowed org types

Type: array of enum (of string)

Types of orgs allowed for config & development. If not set, sandbox and scratch are allowed by default

No Additional Items

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "sandbox"
  • "scratch"

Example:

[
    "sandbox"
]

Auto-Cleaning types

Type: array of enum (of string)

When saving a sfdx-hardis task, the list of cleanings will be automatically applied to sfdx sources

No Additional Items

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "caseentitlement"
  • "checkPermissions"
  • "dashboards"
  • "datadotcom"
  • "destructivechanges"
  • "flowPositions"
  • "localfields"
  • "listViewsMine"
  • "minimizeProfiles"
  • "productrequest"
  • "sensitiveMetadatas"
  • "systemDebug"
  • "v60"

Example:

[
    "dashboards",
    "datadotcom",
    "destructivechanges"
]

Auto-Remove User Permissions on profiles

Type: array of string

When saving a sfdx-hardis task, these permissions will be removed from profiles

No Additional Items

Each item of this array must be:


Example:

[
    "EnableCommunityAppLauncher",
    "FieldServiceAccess",
    "OmnichannelInventorySync"
]

Auto-Retrieve when pull

Type: array of string

When calling hardis:scratch:pull, if you define metadatas (named or not), they will also be retrieved using force:source:retrieve

No Additional Items

Each item of this array must be:


Examples:

[
    "CustomApplication"
]
[
    "CustomApplication:MyApp1",
    "CustomApplication:MyApp2"
]

Minimum apex test coverage %

Type: number Default: 75.0

Minimum percentage of apex code coverage accepted


Examples:

80.0
95.0

Available projects

Type: array of string

List of business projects that are managed in the same repository. Will be used to build git branch name when using hardis:work:new

No Additional Items

Each item of this array must be:


Example:

[
    "sales_cloud",
    "service_cloud",
    "community"
]

Available target branches

Type: array of string

List of git branches that can be used as target for merge requests

No Additional Items

Each item of this array must be:


Example:

[
    "develop",
    "develop_next"
]

New branches prefixes choices

Type: array Default: [{"title": "Feature", "value": "feat", "description": "New feature, evolution of an existing feature... If you don't know, just select Feature"}, {"title": "Debug", "value": "fix", "description": "A bug has been identified and you are the right person to solve it !"}]

When calling hardis:work:new, you can override the default branch prefixes. Input title, value and description for each of them

No Additional Items
Example:

[
    {
        "title": "Feature",
        "value": "feat",
        "description": "New feature, evolution of an existing feature... If you don't know, just select Feature"
    },
    {
        "title": "Debug",
        "value": "fix",
        "description": "A bug has been identified and you are the right person to solve it !"
    }
]

Clean XML Patterns

Type: array of object

List of patterns to automatically clean XML files

No Additional Items

Each item of this array must be:

Type: object

Clean XML pattern and xpaths

No Additional Properties

Glob pattern

Type: string

Glob pattern to identify XML files to clean


Example:

"/**/*.flexipage-meta.xml"

XPath list

Type: array of string

XPaths to identify elements to remove

No Additional Items

Each item of this array must be:


Example:

[
    "//ns:flexiPageRegions//ns:name[contains(text(),'dashboardName')]"
]

Example:

[
    {
        "globPattern": "/**/*.flexipage-meta.xml",
        "xpaths": [
            "//ns:flexiPageRegions//ns:name[contains(text(),'dashboardName')]"
        ]
    },
    {
        "globPattern": "/**/*.layout-meta.xml",
        "xpaths": [
            "//ns:relatedLists//ns:relatedList[contains(text(),'RelatedSolutionList')]"
        ]
    }
]

Commands Pre-Deployment

Type: array of object

List of commands to run before a deployment

The following properties are required:

  • id
  • label
  • command
No Additional Items

Each item of this array must be:

Command

Type: object

Command definition

No Additional Properties

Id

Type: string

Identifier of the command (can be any string)

Label

Type: string

Label of the command (what does it do ?)

Command

Type: string

Command line to run


Example:

[
    {
        "id": "knowledgeUnassign",
        "label": "Remove KnowledgeUser right to the user who has it",
        "command": "sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json"
    },
    {
        "id": "knowledgeAssign",
        "label": "Assign Knowledge user to desired username",
        "command": "sf data update record --sobject User --where \"Username='deployment-user@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json"
    }
]

Commands Post-Deployment

Type: array of object

List of commands to run after a deployment

No Additional Items

Each item of this array must be:

Command

Type: object

Command definition

No Additional Properties

Id

Type: string

Identifier of the command (can be any string)

Label

Type: string

Label of the command (what does it do ?)

Command

Type: string

Command line to run

Context

Type: enum (of string) Default: "all"

Context when the command must be run

Must be one of:

  • "all"
  • "check-deployment-only"
  • "process-deployment-only"

Examples:

"all"
"check-deployment-only"
"process-deployment-only"

Skip if error

Type: boolean Default: "false"

Do not run the command if there is a deployment error


Example:

[
    {
        "id": "knowledgeUnassign",
        "label": "Remove KnowledgeUser right to the user who has it",
        "command": "sf data update record --sobject User --where \"UserPermissionsKnowledgeUser='true'\" --values \"UserPermissionsKnowledgeUser='false'\" --json"
    },
    {
        "id": "knowledgeAssign",
        "label": "Assign Knowledge user to desired username",
        "command": "sf data update record --sobject User --where \"Username='admin-user@myclient.com'\" --values \"UserPermissionsKnowledgeUser='true'\" --json"
    }
]

Custom commands

Type: array of object

List of custom commands for VsCode SFDX-Hardis extension

No Additional Items

Each item of this array must be:

Type: object

Custom command definition

No Additional Properties

Id

Type: string

Identifier of the menu (can be any string)

Label

Type: string

Label of the menu

Label

Type: array of object

List of commands of the menu

No Additional Items

Each item of this array must be:

Type: object

Custom command definition

No Additional Properties

Id

Type: string

Identifier of the command (can be any string)

Label

Type: string

Label of the command that will appear in menu

Icon

Type: string

Icon (can be any of svg icons of this list: https://github.com/hardisgroupcom/vscode-sfdx-hardis/tree/master/resources

Tooltip

Type: string

Text that will appear when user will hover the command

Command

Type: string

Command line to run when clicking on the menu

Help url

Type: string

URL for help page of the command


Example:

[
    {
        "id": "custom-menu",
        "label": "Custom commands",
        "commands": [
            {
                "id": "generate-manifest-xml",
                "label": "Generate manifest",
                "icon": "file.svg",
                "tooltip": "Generates a manifest package.xml using local sfdx source files",
                "command": "sf project generate manifest --source-path force-app --name myNewManifest"
            },
            {
                "id": "list-all-orgs",
                "label": "List all orgs",
                "icon": "salesforce.svg",
                "tooltip": "List all orgs that has already been authenticated using sfdx",
                "command": "sf org list --all"
            }
        ]
    },
    {
        "id": "custom-menu-2",
        "label": "Another custom menu",
        "commands": [
            {
                "id": "echo",
                "label": "Echo something",
                "icon": "user.svg",
                "tooltip": "Useless commands just to show that we can use not sfdx commands too",
                "command": "echo \"Something\""
            }
        ]
    }
]

Custom commands position

Type: enum (of string) Default: "first"

Position of custom commands in the menu (first or last)

Must be one of:

  • "first"
  • "last"

Examples:

"first"
"last"

Custom Org Colors

Type: object

Custom colors set by VsCode SFDX Hardis

Additional Properties of any type are allowed.

Type: object

Custom plugins

Type: array of object

List of additional plugins that will be displayed in VsCode SFDX-Hardis Dependencies panel

No Additional Items

Each item of this array must be:

Plugin

Type: object

Plugin definition

No Additional Properties

Name

Type: string

Name of the plugin npm package


Examples:

"mo-dx-plugin"
"shane-sfdx-plugins"

Name

Type: string

Url of plugin documentation


Examples:

"https://github.com/msrivastav13/mo-dx-plugin"
"https://github.com/mshanemc/shane-sfdx-plugins"

Example:

[
    {
        "name": "mo-dx-plugin",
        "helpUrl": "https://github.com/msrivastav13/mo-dx-plugin"
    },
    {
        "name": "shane-sfdx-plugins",
        "helpUrl": "https://github.com/mshanemc/shane-sfdx-plugins"
    }
]

Data packages

Type: array of object

List of data packages

No Additional Items

Each item of this array must be:

Type: object

Data package

No Additional Properties

SFDMU Data project path

Type: string

Path to SFDMU project

SFDMU Data project path

Type: boolean

Path to SFDMU project

Defaut package installation key

Type: string

When generating a new package version protected with password, use this value as default package installation key


Examples:

"hardis"
"myPassword"
"dFGGF43656YfdFDG{{{dhgfh:::;FSEDSFd78"

Default pull/merge request target org

Type: string Default: "developpement"

When creating a new sfdx-hardis task, this git branch is used as base to create the feature/debug sub branch. The merge request will later have this branch as target.


Examples:

"developpement"
"dev_lot2"
"hotfixes"

Deployment plan

Type: object

Deployment plan that will be performed during deployments. Can be based on packageXmlFile for sources or on dataPath for sfdmu data deployments


Example:

{
    "packages": [
        {
            "label": "Import EmailTemplate records",
            "dataPath": "scripts/data/EmailTemplate",
            "order": -21
        },
        {
            "label": "Deploy EmailTemplate",
            "packageXmlFile": "manifest/splits/packageXmlEmails.xml",
            "order": -20
        },
        {
            "label": "Deploy Flow-Workflow",
            "packageXmlFile": "manifest/splits/packageXmlFlowWorkflow.xml",
            "order": 6
        }
    ]
}

List of packages to deploy

Type: array of object

During deployment, main package.xml will be split into these packages. Can also contain data packages

The following properties are required:

  • label
  • order
No Additional Items

Each item of this array must be:

Type: object

Source or data package to deploy

No Additional Properties

Path to SFDMU data project to deploy

Type: string

Example:

"scripts/data/EmailTemplate"

Source or data package label

Type: string

Examples:

"Deploy EmailTemplate"
"Import EmailTemplate records"

Execution order in deployment plan

Type: number

Examples:

-20
13
50

Path to package.xml file to use for deployment

Type: string

Example:

"manifest/splits/packageXmlEmails.xml"

Wait after install (seconds)

Type: number

Delay to wait before installing the next package


Examples:

10
20

Example:

[
    {
        "label": "Import EmailTemplate records",
        "dataPath": "scripts/data/EmailTemplate",
        "order": -21
    },
    {
        "label": "Deploy EmailTemplate",
        "packageXmlFile": "manifest/splits/packageXmlEmails.xml",
        "order": -20
    }
]

Dev Hub org alias

Type: string Default: ""

Dev Hub alias, usually DevHub_ProjectName


Examples:

"DevHub_MyClientMyProject"
"DevHub_GoogleGmail"
"DevHub_AppleIWatch"

Dev Hub Username

Type: string Default: ""

Dev Hub username, used to authenticate to DevHub from CI jobs


Examples:

"cicd-user@myclient.com"
"scratch-user@google.fr"
"scratch-user@apple.fr"

Extends remote configuration URL

Type: string

You can base your local sfdx-hardis configuration on a remote config file. That allows you to have the same config base for all your projects


Example:

"https://raw.githubusercontent.com/worldcompany/shared-config/main/.sfdx-hardis.yml"

Initial Permission Sets

Type: array

When creating a scratch org, Admin user will be automatically assigned to those permission sets

No Additional Items

Each item of this array must be:

Type: object or string

Permission Set or Permission Set Group

No Additional Properties

Name

Type: string

Permission Set or Permission Set Group name


Example:

[
    "MyPermissionSet",
    "MyPermissionSetGroup",
    "MyPermissionSetGroup2"
]

Example:

[
    "MyPermissionSet",
    "MyPermissionSetGroup"
]

Installed Packages

Type: array of object

Defines the list of packages installed on the project. Use

No Additional Items

Each item of this array must be:

Salesforce package

Type: object

Salesforce package info (managed, unlocked or unmanaged)

No Additional Properties

(unused) PackageId

Type: string

Example:

"0A35r000000GveVCAS"

Subscriber Package Id

Type: string

Example:

"033b0000000Pf2AAAS"

Subscriber Package Name

Type: string

Example:

"Files Attachment Notes"

Subscriber Package NameSpace

Type: string or null

Example:

"fan_astrea"

Subscriber Version Id (IMPORTANT)

Type: string

Example:

"04t0o000003nRWAAA2"

Subscriber Version Name

Type: string

Example:

"Summer2021"

Subscriber Version Number

Type: string

Example:

"1.22.0.2"

Install during deployments

Type: boolean Default: false

If true, during deployments this package will be installed in target org if not installed yet


Examples:

true
false

Install on scratch orgs

Type: boolean Default: false

If true, this package will be installed when creating a new scratch org with sfdx-hardis


Examples:

true
false

Package installation key

Type: string

Installation key for key-protected package


Examples:

"MyInstallationKey"
"4FzkMzUSwFfP#@"

Example:

[
    {
        "Id": "0A30N000000ALWrSAO",
        "SubscriberPackageId": "033b0000000Pf2AAAS",
        "SubscriberPackageName": "Declarative Lookup Rollup Summaries Tool",
        "SubscriberPackageNamespace": "dlrs",
        "SubscriberPackageVersionId": "04t0N000000IyYrQAK",
        "SubscriberPackageVersionName": "2.11",
        "SubscriberPackageVersionNumber": "2.11.0.1",
        "installOnScratchOrgs": false,
        "installDuringDeployments": true,
        "installationkey": "MyInstallationKey"
    },
    {
        "Id": "0A35r000000GveVCAS",
        "SubscriberPackageId": "0330o000000B3vIAAS",
        "SubscriberPackageName": "Files Attachment Notes",
        "SubscriberPackageNamespace": "fan_astrea",
        "SubscriberPackageVersionId": "04t0o000003nRWAAA2",
        "SubscriberPackageVersionName": "Summer2021",
        "SubscriberPackageVersionNumber": "1.22.0.2",
        "installOnScratchOrgs": true,
        "installDuringDeployments": true
    }
]

Install packages during deployment checks

Type: boolean Default: false

When calling deployment check command, installs any package referred within installedPackages property


Example:

true

Instance URL

Type: string Default: ""

Salesforce instance URL used by CI for deployment or backups


Examples:

"https://myclient.force.com"
"https://google.force.com"
"https://apple.force.com"

List views to set to Mine

Type: array of string Default: []

List of ListView items to set to Mine after a delivery (that does not accept value 'Everything')

No Additional Items

Each item of this array must be:

Metadata to retrofit

Type: array of string

List of metadata to retrieve for retrofit job

No Additional Items

Each item of this array must be:


Example:

[
    "CustomField",
    "Layout",
    "PermissionSet"
]

Monitoring commands

Type: array of object

List of monitoring commands to run with command hardis:org:monitor:all

No Additional Items

Each item of this array must be:

Type: object

Monitoring command

No Additional Properties

Key

Type: string

Unique identifier of the monitoring command. Can be used with monitoringDisable

Title

Type: string

Title of the command (will appear in logs)

Command

Type: string

Bash command to run

Frequency

Type: string

daily or weekly


Example:

[
    {
        "title": "Detect calls to deprecated API versions",
        "key": "LEGACYAPI",
        "command": "sf hardis:org:diagnose:legacyapi",
        "frequency": "weekly"
    },
    {
        "title": "My custom command",
        "key": "MY_CUSTOM_KEY",
        "command": "sf my:custom:command",
        "frequency": "daily"
    }
]

Monitoring Allowed Sections Actions

Type: object

Override list of Setup Audit Trail elements that won't be considered as suspect by monitoring tools

Additional Properties of any type are allowed.

Type: object

Disabled monitoring commands

Type: array

List of commands to skip during monitoring jobs

No Additional Items

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "AUDIT_TRAIL"
  • "LEGACY_API"
  • "LINT_ACCESS"
  • "UNUSED_METADATAS"
  • "METADATA_STATUS"
  • "MISSING_ATTRIBUTES"
  • "UNUSED_LICENSES"
  • "RELEASE_UPDATES"

Example:

[
    "METADATA_STATUS",
    "UNUSED_METADATAS"
]

Monitoring usernames to exclude

Type: array of string

List of usernames to exclude while running monitoring commands

No Additional Items

Each item of this array must be:


Example:

[
    "deploymentuser@cloudity.com",
    "mc-cloud-user@cloudity.com"
]

MsTeams WebHook Url (ALL)

Type: string Default: ""

Url of the Ms Teams channel Web Hook that can be used to send ALL notifications


Example:

"https://my.msteams.webhook.url"

MsTeams WebHook Url (CRITICAL)

Type: string Default: ""

Url of the Ms Teams channel Web Hook that can be used to send CRITICAL notifications


Example:

"https://my.msteams.webhook.url"

MsTeams WebHook Url (SEVERE)

Type: string Default: ""

Url of the Ms Teams channel Web Hook that can be used to send SEVERE notifications


Example:

"https://my.msteams.webhook.url"

MsTeams WebHook Url (WARNING)

Type: string Default: ""

Url of the Ms Teams channel Web Hook that can be used to send WARNING notifications


Example:

"https://my.msteams.webhook.url"

MsTeams WebHook Url (INFO)

Type: string Default: ""

Url of the Ms Teams channel Web Hook that can be used to send INFO notifications


Example:

"https://my.msteams.webhook.url"

Disabled notification types

Type: array

List of notifications types to skip sending

No Additional Items

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "AUDIT_TRAIL"
  • "APEX_TESTS"
  • "BACKUP"
  • "DEPLOYMENT"
  • "LEGACY_API"
  • "LINT_ACCESS"
  • "UNUSED_METADATAS"
  • "METADATA_STATUS"
  • "MISSING_ATTRIBUTES"
  • "UNUSED_LICENSES"
  • "RELEASE_UPDATES"

Example:

[
    "METADATA_STATUS",
    "UNUSED_METADATAS"
]

Package-No-Overwrite path

Type: string Default: ""

Path to a custom package-no-overwrite XML file (used in smartDeploy command)


Examples:

"manifest/package-no-overwrite-main.xml"
"manifest/package-no-overwrite-custom.xml"

Scratch org pool configuration

Type: object

Configuration allowing to generate and fetch scratch orgs from scratch org pool


Example:

{
    "maxScratchOrgsNumber": 10,
    "storageService": "kvdb.io"
}

Min scratch org remaining days

Type: number Default: 25

When pool scratch org is less than this number, it is deleted and another one is created

Maximum number of scratch orgs

Type: number

Maximum number of active scratch orgs in the scratch org pool

Maximum number of scratch orgs to create once

Type: number

Maximum number of scratch orgs to create in one CI job

Storage service for scratch org pool

Type: string

Remote service allowing to store scratch org pool details

Production branch name

Type: string Default: ""

Name of the git branch corresponding to production environment


Examples:

"master"
"main"
"production"

Project Name

Type: string Default: ""

Identifier for the project (can be the client and project)


Examples:

"MyClientMyProject"
"GoogleGmail"
"AppleIWatch"

Retrofit branch name

Type: string Default: ""

Name of the git branch where retrofit merge requests targets to


Examples:

"preprod"
"dev"
"maintenance"

Retrofit ignored files

Type: array of string

When calling hardis:org:retrieve:sources:retrofit, list of files to ignore (discard just after retrieve)

No Additional Items

Each item of this array must be:


Example:

[
    "force-app/main/default/applications/MyAppIWantToManageInProduction.app-meta.xml",
    "force-app/main/default/flexipages/MyFlexipageWithDashboards.flexipage-meta.xml"
]

Selected tests to run (list or regex)

Type: string Default: ""

WARNING: Use with caution, only in branch scoped config ! Can be a list of test classes if testLevel=RunSpecifiedTests, or a regex if testLevel=RunRepositoryTests


Examples:

"MyTestClass1,MyTestClass2"
"^(?!FLI|fli|BatchableCodeSolvaTest|BatchableRemoveCodeSolvaTest|HelperNovaxelApiTest).*"

Scratch org init apex scripts

Type: array of string

Apex scripts to call after scratch org initialization

No Additional Items

Each item of this array must be:


Example:

[
    "scripts/apex/init-scratch.apex",
    "scripts/apex/init-custom-settings.apex"
]

Duration of Scratch Org

Type: number Default: 30

Defines the lifespan of the scratch org in number of days, from 1 to 30

Value must be greater or equal to 1 and lesser or equal to 30

SFDMU can modify

Type: string Default: ""

Instance host name to allow SFDMU to deploy data in a production org


Example:

"myproject.force.com"

Skip code coverage check

Type: boolean Default: false

WARNING: Use with caution, only in branch scoped config ! Do not check code coverage for a deployment

Skip Minimize Profiles

Type: array of string

These profiles will not be reformatted by command hardis:project:clean:minimizeprofiles

No Additional Items

Each item of this array must be:


Example:

[
    "MyClient Customer Community Login User",
    "MyClientPortail Profile"
]

Skip update .forceignore file

Type: boolean Default: false

Defines if sfdx-hardis will propose to upgrade local .forceignore file

Skip update .gitignore file

Type: boolean Default: false

Defines if sfdx-hardis will propose to upgrade local .gitignore file

Target Username

Type: string Default: ""

Salesforce username used by CI for deployment or backups


Examples:

"deployments@myclient.com"
"deployments@google.fr"
"deployments@apple.com"

Test Coverage not blocking

Type: boolean Default: false

Does not make the deployment job fail if apex tests code coverage is failing

Test level for deployments

Type: enum (of string) Default: "RunLocalTests"

WARNING: Use with caution, only in branch scoped config ! You can override default test level for deployments for special use cases, for example when you have SeeAllData=true you can use RunRepositoryTests associated with a regex in runtests option

Must be one of:

  • "NoTestRun"
  • "RunSpecifiedTests"
  • "RunRepositoryTests"
  • "RunRepositoryTestsExceptSeeAllData"
  • "RunLocalTests"
  • "RunAllTestsInOrg"

Examples:

"RunRepositoryTests"
"RunSpecifiedTests"

Use Delta Deployment

Type: boolean Default: false

Defines if sfdx-hardis will deploy in delta from minor to major branches

Use Smart Deployment Tests

Type: boolean Default: false

Define if smart deployment tests will be activated and run test classes only if necessary (see more in hardis:project:deploy:smart documentation

Linter ignore permission set or/and profile

Type: string Default: ""

Ignore profiles or permission sets


Examples:

"Profile"
"Profile:ProfileA"
"PermissionSet"
"PermissionSet:PermissionSetA, Profile:ProfileA"