proexec

package
v1.226.0-test.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package proexec reports command-execution metadata (what ran, exit code, environment, resource usage, and optional command-specific structured data) to Atmos Pro whenever Atmos is running in a recognized CI environment and Atmos Pro is configured. Every command gets a fire-and-forget, best-effort asynchronous upload (CaptureAsync); a small allowlist of critical commands (terraform plan/apply, describe affected) additionally calls the blocking, configurable-timeout variant (CaptureSync) from their own execution path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureAsync

func CaptureAsync(cmd *cobra.Command, err error)

CaptureAsync fires a best-effort, non-blocking execution-record upload for the just-completed command. It re-checks the CI+Pro gate itself (callers don't need to duplicate that check), never alters err or the caller's exit path, and blocks the caller for at most asyncFlushCeiling to maximize the chance the upload is dispatched before the process exits (FR-009).

Commands on the synchronous allowlist (IsSyncCommand) are skipped here: their own execution path already calls CaptureSync directly, and the two delivery paths are mutually exclusive per invocation (FR-007) — a command must never produce two execution records for the same run.

func CaptureSync

func CaptureSync(atmosConfig *schema.AtmosConfiguration, cmdName string, exitCode int, data any, dataItems []any) error

CaptureSync uploads an execution record for a command classified as synchronous (terraform plan/apply, describe affected), blocking until the complete upload — including every chunk, if dataItems required batching — completes or the configured timeout elapses. It re-checks the CI+Pro gate itself. Failure/timeout is warn-and-continue for all three initial synchronous commands (data-model.md's Delivery Classification table): a warning is logged and CaptureSync returns nil so a delivery outage never turns a successful command into a failed CI run.

func IsSyncCommand

func IsSyncCommand(commandPath string) bool

IsSyncCommand reports whether commandPath (a full Cobra command path, e.g. cmd.CommandPath() or "atmos "+"terraform "+subCommand) is on the synchronous execution-record delivery allowlist (FR-007).

func SetAtmosConfig

func SetAtmosConfig(atmosConfig *schema.AtmosConfiguration)

SetAtmosConfig registers the loaded Atmos configuration for use by CaptureAsync. Must be called once during startup (cmd/root.go's Execute), before any command runs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL