featureflags

package
v2.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VerifyEnvironmentType returns the feature flag that tells whether the environment check
	// at the beginning of execution is enabled or not.
	// Introduced: before 2023-04-27; v2.0.0
	VerifyEnvironmentType PermanentFlag = "MONACO_FEAT_VERIFY_ENV_TYPE"
	// ManagementZoneSettingsNumericIDs returns the feature flag that tells whether configs of settings type builtin:management-zones
	// are addressed directly via their object ID or their resolved numeric ID when they are referenced.
	// Introduced: 2023-04-18; v2.0.1
	ManagementZoneSettingsNumericIDs PermanentFlag = "MONACO_FEAT_USE_MZ_NUMERIC_ID"
	// DangerousCommands returns the feature flag that tells whether dangerous commands for the CLI are enabled or not
	DangerousCommands = "MONACO_ENABLE_DANGEROUS_COMMANDS"
	// featureflags.Permanent[featureflags.FastDependencyResolver] returns the feature flag controlling whether the fast (but memory intensive) Aho-Corasick
	// algorithm based dependency resolver is used when downloading. If set to false, the old naive and CPU intensive resolver
	// is used. This flag is permanent as the fast resolver has significant memory cost.
	FastDependencyResolver = "MONACO_FEAT_FAST_DEPENDENCY_RESOLVER"
	// DownloadFilter returns the feature flag controlling whether download filters out configurations that we believe can't
	// be managed by config-as-code. Some users may still want to download everything on an environment, and turning off the
	// filters allows them to do so.
	DownloadFilter = "MONACO_FEAT_DOWNLOAD_FILTER"
	// DownloadFilterSettings returns the feature flag controlling whether general filters are applied to Settings download.
	DownloadFilterSettings = "MONACO_FEAT_DOWNLOAD_FILTER_SETTINGS"
	// DownloadFilterSettingsUnmodifiable returns the feature flag controlling whether Settings marked as unmodifiable by
	// their dtclient.SettingsModificationInfo are filtered out on download.
	DownloadFilterSettingsUnmodifiable = "MONACO_FEAT_DOWNLOAD_FILTER_SETTINGS_UNMODIFIABLE"
	// DownloadFilterClassicConfigs returns the feature flag controlling whether download filters are applied to Classic Config API download.
	DownloadFilterClassicConfigs = "MONACO_FEAT_DOWNLOAD_FILTER_CLASSIC_CONFIGS"
	// SkipVersionCheck returns the feature flag to control disabling the version check that happens at the end of each monaco run
	SkipVersionCheck = "MONACO_SKIP_VERSION_CHECK"
	// ExtractScopeAsParameter returns the feature flag to controlling whether the scope field of setting 2.0 objects shall be extracted as monaco parameter
	ExtractScopeAsParameter = "MONACO_FEAT_EXTRACT_SCOPE_AS_PARAMETER"
	// BuildSimpleClassicURL returns the feature flag to controlling whether we attempt to create the Classic URL of a platform environment via string replacement before using the metadata API.
	// As there may be networking/DNS edge-cases where the replaced URL is valid (GET returns 200) but is not actually a Classic environment, this feature flag allows deactivation of the feature.
	BuildSimpleClassicURL = "MONACO_FEAT_SIMPLE_CLASSIC_URL"
	// LogToFile returns the feature flag to control whether log files shall be created or not
	LogToFile = "MONACO_LOG_FILE_ENABLED"
	// UpdateNonUniqueByNameIfSingleOneExists toggles whether we attempt update api.API configurations with NonUniqueName,
	// by name if only a single one is found on the environment. As this causes issues if a project defines more than one config
	// with the same name - they will overwrite each other, and keep a single on the environment - the feature flag is introduced
	// to turn it off until a generally better solution is available.
	// Introduced: 2023-09-01; v2.9.1
	UpdateNonUniqueByNameIfSingleOneExists = "MONACO_FEAT_UPDATE_SINGLE_NON_UNIQUE_BY_NAME"
)

Variables

View Source
var Permanent = map[PermanentFlag]FeatureFlag{
	VerifyEnvironmentType: {
		// contains filtered or unexported fields
	},
	ManagementZoneSettingsNumericIDs: {
		// contains filtered or unexported fields
	},
	DangerousCommands: {
		// contains filtered or unexported fields
	},
	FastDependencyResolver: {
		// contains filtered or unexported fields
	},
	DownloadFilter: {
		// contains filtered or unexported fields
	},
	DownloadFilterSettings: {
		// contains filtered or unexported fields
	},
	DownloadFilterSettingsUnmodifiable: {
		// contains filtered or unexported fields
	},
	DownloadFilterClassicConfigs: {
		// contains filtered or unexported fields
	},
	SkipVersionCheck: {
		// contains filtered or unexported fields
	},
	ExtractScopeAsParameter: {
		// contains filtered or unexported fields
	},
	BuildSimpleClassicURL: {
		// contains filtered or unexported fields
	},
	LogToFile: {
		// contains filtered or unexported fields
	},
	UpdateNonUniqueByNameIfSingleOneExists: {
		// contains filtered or unexported fields
	},
}

Permanent FeatureFlag - features we want to be able to toggle long-term, instead of removing them after a stabilization period.

View Source
var Temporary = map[TemporaryFlag]FeatureFlag{
	SkipReadOnlyAccountGroupUpdates: {
		// contains filtered or unexported fields
	},
	Documents: {
		// contains filtered or unexported fields
	},
	DeleteDocuments: {
		// contains filtered or unexported fields
	},
	PersistSettingsOrder: {
		// contains filtered or unexported fields
	},
	OpenPipeline: {
		// contains filtered or unexported fields
	},
	IgnoreSkippedConfigs: {
		// contains filtered or unexported fields
	},
}

Temporary FeatureFlags - for features that are hidden during development or have some uncertainty. These should always be removed after release of a feature, or some stabilization period if needed.

Functions

func AnyModified added in v2.15.0

func AnyModified() bool

AnyModified returns true if any Permanent or Temporary feature flag value is different to its default.

func StateInfo added in v2.15.0

func StateInfo() string

StateInfo builds a string message describing the current and default values of all feature flags, noting especially if any flag has been changed off its default value.

Types

type FeatureFlag

type FeatureFlag struct {
	// contains filtered or unexported fields
}

FeatureFlag represents a command line switch to turn certain features ON or OFF. Values are read from environment variables defined by the feature flag. The feature flag can have default values that are used when the resp. environment variable does not exist

func (FeatureFlag) Enabled

func (ff FeatureFlag) Enabled() bool

Enabled evaluates the feature flag. Feature flags are considered to be "enabled" if their resp. environment variable is set to 1, t, T, TRUE, true or True. Feature flags are considered to be "disabled" if their resp. environment variable is set to 0, f, F, FALSE, false or False.

func (FeatureFlag) EnvName

func (ff FeatureFlag) EnvName() string

EnvName gives back the environment variable name for the feature flag

func (FeatureFlag) Value added in v2.15.0

func (ff FeatureFlag) Value() (enabled bool, defaultVal bool)

Value returns the current value and default value of a FeatureFlag

type PermanentFlag added in v2.15.0

type PermanentFlag string

type TemporaryFlag added in v2.15.0

type TemporaryFlag string
const (
	// SkipReadOnlyAccountGroupUpdates toggles whether updates to read-only account groups are skipped or not.
	// Introduced: 2024-03-29; v2.13.0
	SkipReadOnlyAccountGroupUpdates TemporaryFlag = "MONACO_SKIP_READ_ONLY_ACCOUNT_GROUP_UPDATES"
	// Documents toggles whether documents are downloaded and / or deployed.
	// Introduced: 2024-04-16; v2.14.0
	Documents TemporaryFlag = "MONACO_FEAT_DOCUMENTS"
	// DeleteDocuments toggles whether documents are deleted
	// Introduced: 2024-04-16; v2.14.2
	DeleteDocuments TemporaryFlag = "MONACO_FEAT_DELETE_DOCUMENTS"
	// PersistSettingsOrder toggles whether insertAfter config parameter is persisted for ordered settings.
	// Introduced: 2024-05-15; v2.14.0
	PersistSettingsOrder TemporaryFlag = "MONACO_FEAT_PERSIST_SETTINGS_ORDER"
	// OpenPipeline toggles whether openpipeline configurations are downloaded and / or deployed.
	// Introduced: 2024-06-10; v2.15.0
	OpenPipeline TemporaryFlag = "MONACO_FEAT_OPENPIPELINE"
	// IgnoreSkippedConfigs toggles whether configurations that are marked to be skipped should also be excluded
	// from the dependency graph created by Monaco. These configs are not only skipped during deployment but also
	// not validated prior to deployment. Further, other configs cannot reference properties of this config anymore.
	IgnoreSkippedConfigs TemporaryFlag = "MONACO_FEAT_IGNORE_SKIPPED_CONFIGS"
)

Jump to

Keyboard shortcuts

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