experiments

package
v3.52.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package experiments provides a global registry of enabled and disabled experiments.

It is intended for internal use by buildkite-agent only.

Index

Constants

View Source
const (
	// Available experiments
	AgentAPI                   = "agent-api"
	DescendingSpawnPrioity     = "descending-spawn-priority"
	JobAPI                     = "job-api"
	KubernetesExec             = "kubernetes-exec"
	NormalisedUploadPaths      = "normalised-upload-paths"
	PolyglotHooks              = "polyglot-hooks"
	ResolveCommitAfterCheckout = "resolve-commit-after-checkout"
	AvoidRecursiveTrap         = "avoid-recursive-trap"
	IsolatedPluginCheckout     = "isolated-plugin-checkout"

	// Promoted experiments
	ANSITimestamps    = "ansi-timestamps"
	FlockFileLocks    = "flock-file-locks"
	GitMirrors        = "git-mirrors"
	InbuiltStatusPage = "inbuilt-status-page"
)

Variables

View Source
var (
	Available = map[string]struct{}{
		AgentAPI:                   {},
		DescendingSpawnPrioity:     {},
		JobAPI:                     {},
		KubernetesExec:             {},
		NormalisedUploadPaths:      {},
		PolyglotHooks:              {},
		ResolveCommitAfterCheckout: {},
		AvoidRecursiveTrap:         {},
		IsolatedPluginCheckout:     {},
	}

		ANSITimestamps:    standardPromotionMsg(ANSITimestamps, "v3.48.0"),
		FlockFileLocks:    standardPromotionMsg(FlockFileLocks, "v3.48.0"),
		GitMirrors:        standardPromotionMsg(GitMirrors, "v3.47.0"),
		InbuiltStatusPage: standardPromotionMsg(InbuiltStatusPage, "v3.48.0"),
	}
)

Functions

func Disable added in v3.22.0

func Disable(key string)

Disable a particular experiment in the agent.

func EnableWithUndo added in v3.47.0

func EnableWithUndo(key string) func()

func Enabled

func Enabled() []string

Enabled returns the keys of all the enabled experiments.

func IsEnabled

func IsEnabled(key string) bool

IsEnabled reports whether the named experiment is enabled.

Types

type State added in v3.47.0

type State string
const (
	StateKnown    State = "known"
	StatePromoted State = "promoted"
	StateUnknown  State = "unknown"
)

Experiment states

func Enable

func Enable(key string) (state State)

Enable a particular experiment in the agent.

func EnableWithWarnings added in v3.47.0

func EnableWithWarnings(l logger.Logger, key string) State

Jump to

Keyboard shortcuts

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