sfdx-hardis configuration

Type: object

Configuration file definition for sfdx-hardis Salesforce DX plugin

No Additional Properties

Type: array of enum (of string)

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

Each item of this array must be:

Type: enum (of string)

Must be one of:

  • "sandbox"
  • "scratch"

Example:

[
    "sandbox"
]

Type: array of enum (of string)

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

Each item of this array must be:

Type: enum (of string)

Must be one of:

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

Example:

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

Type: array of string

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

Each item of this array must be:


Example:

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

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

Each item of this array must be:


Examples:

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

Type: number Default: 75.0

Minimum percentage of apex code coverage accepted


Examples:

80.0
95.0

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

Each item of this array must be:


Example:

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

Type: array of string

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

Each item of this array must be:


Example:

[
    "develop",
    "develop_next"
]

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


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 !"
    }
]

Type: array of object

List of patterns to automatically clean XML files

Each item of this array must be:

Type: object

Clean XML pattern and xpaths

No Additional Properties

Type: string

Glob pattern to identify XML files to clean


Example:

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

Type: array of string

XPaths to identify elements to remove

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')]"
        ]
    }
]

Type: array of object

List of custom commands for VsCode SFDX-Hardis extension

Each item of this array must be:

Type: object

Custom command definition

No Additional Properties

Type: string

Identifier of the menu (can be any string)

Type: string

Label of the menu

Type: array of object

List of commands of the menu

Each item of this array must be:

Type: object

Custom command definition

No Additional Properties

Type: string

Identifier of the command (can be any string)

Type: string

Label of the command that will appear in menu

Type: string

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

Type: string

Text that will appear when user will hover the command

Type: string

Command line to run when clicking on the menu

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": "sfdx force:source:manifest:create --sourcepath force-app --manifestname myNewManifest"
            },
            {
                "id": "list-all-orgs",
                "label": "List all orgs",
                "icon": "salesforce.svg",
                "tooltip": "List all orgs that has already been authenticated using sfdx",
                "command": "sfdx force: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\""
            }
        ]
    }
]

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"

Type: object

Custom colors set by VsCode SFDX Hardis

Additional Properties of any type are allowed.

Type: object

Type: array of object

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

Each item of this array must be:

Type: object

Plugin definition

No Additional Properties

Type: string

Name of the plugin npm package


Examples:

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

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"
    }
]

Type: array of object

List of data packages

Each item of this array must be:

Type: object

Data package

No Additional Properties

Type: string

Path to SFDMU project

Type: boolean

Path to SFDMU project

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"

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"

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
        }
    ]
}

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

Each item of this array must be:

Type: object

Source or data package to deploy

No Additional Properties

Type: string

Example:

"scripts/data/EmailTemplate"

Type: string

Examples:

"Deploy EmailTemplate"
"Import EmailTemplate records"

Type: number

Examples:

-20
13
50

Type: string

Example:

"manifest/splits/packageXmlEmails.xml"

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
    }
]

Type: string Default: ""

Dev Hub alias, usually DevHub_ProjectName


Examples:

"DevHub_MyClientMyProject"
"DevHub_GoogleGmail"
"DevHub_AppleIWatch"

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"

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"

Type: array

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

Each item of this array must be:

Type: object or string

Permission Set or Permission Set Group

No Additional Properties

Type: string

Permission Set or Permission Set Group name


Example:

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

Example:

[
    "MyPermissionSet",
    "MyPermissionSetGroup"
]

Type: array of object

Defines the list of packages installed on the project. Use

Each item of this array must be:

Type: object

Salesforce package info (managed, unlocked or unmanaged)

No Additional Properties

Type: string

Example:

"0A35r000000GveVCAS"

Type: string

Example:

"033b0000000Pf2AAAS"

Type: string

Example:

"Files Attachment Notes"

Type: string or null

Example:

"fan_astrea"

Type: string

Example:

"04t0o000003nRWAAA2"

Type: string

Example:

"Summer2021"

Type: boolean Default: false

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


Examples:

true
false

Type: boolean Default: false

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


Examples:

true
false

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
    }
]

Type: boolean Default: false

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


Example:

true

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"

Type: array of string Default: []

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

Each item of this array must be:

Type: array of string

List of metadata to retrieve for retrofit job

Each item of this array must be:


Example:

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

Type: array of object

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

Each item of this array must be:

Type: object

Monitoring command

No Additional Properties

Type: string

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

Type: string

Title of the command (will appear in logs)

Type: string

Bash command to run

Type: string

daily or weekly


Example:

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

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

Type: array

List of commands to skip during monitoring jobs

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"

Example:

[
    "METADATA_STATUS",
    "UNUSED_METADATAS"
]

Type: array of string

List of usernames to exclude while running monitoring commands

Each item of this array must be:


Example:

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

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"

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"

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"

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"

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"

Type: array

List of notifications types to skip sending

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"

Example:

[
    "METADATA_STATUS",
    "UNUSED_METADATAS"
]

Type: object

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


Example:

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

Type: number Default: 25

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

Type: number

Maximum number of active scratch orgs in the scratch org pool

Type: number

Maximum number of scratch orgs to create in one CI job

Type: string

Remote service allowing to store scratch org pool details

Type: string Default: ""

Name of the git branch corresponding to production environment


Examples:

"master"
"main"
"production"

Type: string Default: ""

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


Examples:

"MyClientMyProject"
"GoogleGmail"
"AppleIWatch"

Type: string Default: ""

Name of the git branch where retrofit merge requests targets to


Examples:

"preprod"
"dev"
"maintenance"

Type: array of string

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

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"
]

Type: array of string

Apex scripts to call after scratch org initialization

Each item of this array must be:


Example:

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

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

Type: string Default: ""

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


Example:

"myproject.force.com"

Type: boolean Default: false

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

Type: boolean Default: false

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

Type: string Default: ""

Salesforce username used by CI for deployment or backups


Examples:

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

Type: boolean Default: false

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

Type: string Default: ""

Ignore profiles or permission sets


Examples:

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