Previously, the Atmos CLI interpreted terraform exit codes locally — mapping them to status strings like "in_sync" or "drifted" — before sending the result to Atmos Pro. This meant Atmos Pro never saw the raw data, status interpretation was coupled to CLI releases, and error exit codes were silently dropped.
This change makes the CLI a dumb pipe: it sends the raw command (plan or apply) and exit code to Atmos Pro, which interprets them server-side. This lets Atmos Pro evolve status logic without requiring CLI updates. The upload is also extended from plan-only to both plan and apply, eliminating the "Unknown" status problem on the dashboard.
- DTO (
pkg/pro/dtos/instances.go): ReplacedHasDrift boolwithCommand string+ExitCode int. - API client (
pkg/pro/api_client_instance_status.go): Sends{ command, exit_code }instead of{ status }. - Upload logic (
internal/exec/pro.go): Removed exit code filtering (previously skipped non-0/non-2). RemovedHasDriftinterpretation. Passes rawSubCommandandexitCode. - Upload scope (
internal/exec/pro.go):shouldUploadStatus()now acceptsapplyin addition toplan. - Apply wiring (
internal/exec/terraform.go): Apply uploads automatically whensettings.pro.enabledis true — no--upload-statusflag required.
The CLI sends a PATCH to /api/v1/repos/{owner}/{repo}/instances?stack={stack}&component={component} with:
{
"command": "plan" | "apply",
"exit_code": <integer>,
"last_run": "<ISO 8601 datetime>"
}Atmos Pro interprets exit codes server-side:
| Command | Exit Code | Instance Status |
|---|---|---|
| plan | 0 | in_sync |
| plan | 2 | drifted |
| plan | other | error |
| apply | 0 | in_sync |
| apply | != 0 | error |
The legacy { status } format is still accepted for backward compatibility.