Skip to content

hardis:org:diagnose:deployments

Description

Analyzes metadata deployments and validations by querying DeployRequest records via the Tooling API.

Tracks:

  • Deployment/validation status (Succeeded, Failed, InProgress, Canceled)
  • Pending time (CreatedDate to StartDate)
  • Duration (StartDate to CompletedDate)
  • Separation of deployments vs validations (CheckOnly)

Key functionalities:

  • Deployments vs validations: Distinguishes actual deployments from validation-only (CheckOnly) runs.
  • Timing analysis: Pending time (queue) and deployment/validation duration in minutes.
  • CSV report: Generates a report of recent deployment/validation activity.
  • Notifications: Sends to Grafana, Slack, MS Teams.

This command is part of sfdx-hardis Monitoring and can output Grafana, Slack and MsTeams Notifications.

Agent Mode

Supports non-interactive execution with --agent:

sf hardis:org:diagnose:deployments --agent --period daily --target-org myorg@example.com

In agent mode:

  • --period defaults to daily (last 24 hours) when not provided.
  • All interactive prompts are skipped.

Screenshots

Type how many days back to analyze

Type how many days back to analyze

Deployments and validations of the last 30 days, with their duration and status

Deployments and validations of the last 30 days, with their duration and status

  • (1) The report of the run: the button opens it in Excel, the arrow lists its other files

Reports

The command writes these reports in the hardis-report folder of the project: a CSV file, and its Excel copy (XLSX) in the xls sub-folder.

Deployments and validations

One row per deployment or validation, with its status, author, dates, pending time and duration in minutes.

Files: deployments-*.csv, xls/deployments-*.xlsx

Deployments and validations report in Excel

Parameters

Name Type Description Default Required Options
agent boolean Run in non-interactive mode for agents and automation
debug
-d
boolean Activate debug mode (more logs)
flags-dir option Import flag values from a directory.
json boolean Format output as json.
outputfile
-f
option Force the path and name of output report file. Must end with .csv
period
-p
option Time period to analyze: daily (last 24h), weekly (last 7 days), or all (no date filter). If not set, defaults to daily in CI or prompts for a number of days interactively. daily
weekly
all
skipauth boolean Skip authentication check when a default username is required
target-org
-o
option Username or alias of the target org. Not required if the target-org configuration variable is already set. true
websocket option Websocket host:port for VsCode SFDX Hardis UI integration

Examples

$ sf hardis:org:diagnose:deployments
$ sf hardis:org:diagnose:deployments --period daily
$ sf hardis:org:diagnose:deployments --period weekly
$ sf hardis:org:diagnose:deployments --period all
$ sf hardis:org:diagnose:deployments --agent

Comments