Skip to main content

detect_ci_mode

Function detect_ci_mode 

Source
pub fn detect_ci_mode(cli_flag: bool, context_ci: Option<bool>) -> CiDetection
Expand description

Detect whether CI mode is active.

Priority:

  1. cli_flag--ci on the command line.
  2. DEVBOY_CI=<truthy> in the environment.
  3. context_ci[runtime] ci = true from the active context.

Heuristic signals (CI, GITLAB_CI, GITHUB_ACTIONS, BUILDKITE) are recorded in the result but do not flip CI mode on their own. This is the explicit/heuristic split the ADR insists on.

cli_flag = false and context_ci = None are the “no opinion” neutral inputs; CLI / context loaders pass concrete values when available.