experiments

package
v3.63.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 4 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"
	PTYRaw                     = "pty-raw"
	PolyglotHooks              = "polyglot-hooks"
	ResolveCommitAfterCheckout = "resolve-commit-after-checkout"
	AvoidRecursiveTrap         = "avoid-recursive-trap"
	IsolatedPluginCheckout     = "isolated-plugin-checkout"
	UseZZGlob                  = "use-zzglob"

	// 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:     {},
		UseZZGlob:                  {},
	}

		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

func Disable(ctx context.Context, key string) context.Context

Disable a particular experiment in a new context.

func Enabled

func Enabled(ctx context.Context) []string

Enabled returns the keys of all the enabled experiments.

func IsEnabled

func IsEnabled(ctx context.Context, key string) bool

IsEnabled reports whether the named experiment is enabled in the context.

Types

type State

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

Experiment states

func Enable

func Enable(ctx context.Context, key string) (newctx context.Context, state State)

Enable a particular experiment in a new context.

func EnableWithWarnings

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

EnableWithWarnings enables an experiment in a new context, logging information about unknown and promoted experiments.

Jump to

Keyboard shortcuts

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