proexec

package
v1.226.0-test.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 17 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).

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