configcmd

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package configcmd contains the business logic for circleci config subcommands.

Index

Constants

View Source
const (
	FunctionsTip     = "CircleCI Functions can replace orbs and install languages and tools in a new config. Orbs remain supported."
	FunctionsTipNext = "Run `circleci function list` to find one, then `circleci function get <name>` for its arguments and an example."
)

The tip `config validate` shows for a new config with no functions block. It names no Function, because `circleci function list` is the catalog.

Variables

This section is empty.

Functions

func LocalPipelineValues

func LocalPipelineValues(params map[string]any) map[string]any

LocalPipelineValues fabricates the CircleCI pipeline values used when validating or processing a config locally. Git state is read best-effort; failures are silent. params are merged as pipeline.parameters.<key> and also returned separately so callers can pass them as PipelineParameters.

func ParsePipelineParams

func ParsePipelineParams(input string) (map[string]any, error)

ParsePipelineParams parses pipeline parameters from either a YAML/JSON string or a file path. A file is tried first; only when the path does not exist is the value parsed as inline YAML. An empty input yields a nil map and no error.

Types

type Suggestion added in v1.15.0

type Suggestion struct {
	Message string `json:"message"`
}

Suggestion is a tip `config validate` reports alongside a valid config.

func FunctionsSuggestions added in v1.15.0

func FunctionsSuggestions(path, configYAML string) []Suggestion

FunctionsSuggestions returns the Functions tip for a config file that is new and declares no functions, or nothing.

type ValidateResult

type ValidateResult struct {
	Valid        bool     `json:"valid"`
	CompiledYAML string   `json:"compiled_yaml,omitempty"`
	Errors       []string `json:"errors,omitempty"`
	// Suggestions is never nil, so --json shows an empty array.
	Suggestions []Suggestion `json:"suggestions"`
}

ValidateResult holds the outcome of a config validation call.

func Process

func Process(ctx context.Context, client *apiclient.Client, configYAML, orgID string, previewNext bool, params map[string]any) (*ValidateResult, error)

Process compiles the config YAML and returns the fully expanded output YAML. params are pipeline parameters injected at << pipeline.parameters.* >>.

func Validate

func Validate(ctx context.Context, client *apiclient.Client, configYAML, orgID string, previewNext bool) (*ValidateResult, error)

Validate compiles the config YAML against the CircleCI API and returns whether it is valid. orgID may be empty; pass one to enable private orb resolution.

Jump to

Keyboard shortcuts

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