Documentation ¶
Index ¶
- Constants
- Variables
- func AllFlags(ctx context.Context) []string
- func ContextWithExplicitFeatureFlags(ctx context.Context) context.Context
- func ContextWithFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
- func IncomingCtxWithFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
- func IncomingCtxWithRubyFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
- func OutgoingCtxWithFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
- func OutgoingCtxWithRubyFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
- func OutgoingWithRaw(ctx context.Context, flags Raw) context.Context
- type FeatureFlag
- type Raw
Constants ¶
const (
// Delim is a delimiter used between a feature flag name and its value.
Delim = ":"
)
Variables ¶
var ( // All is the list of all registered feature flags. All = []FeatureFlag{} )
var ConcurrencyQueueEnforceMax = NewFeatureFlag("concurrency_queue_enforce_max", false)
ConcurrencyQueueEnforceMax enforces a maximum number of items that are waiting in a concurrency queue. when this flag is turned on, subsequent requests that come in will be rejected with an error.
var ConcurrencyQueueMaxWait = NewFeatureFlag("concurrency_queue_max_wait", false)
ConcurrencyQueueMaxWait will enable the concurrency limiter to drop requests that are waiting in the concurrency queue for longer than the configured time.
var ExactPaginationTokenMatch = NewFeatureFlag("exact_pagination_token_match", false)
ExactPaginationTokenMatch enables exact matching for provided pagination tokens and returns an error if the match is not found.
var GitV2351WithFetchSpeedups = NewFeatureFlag("git_v2351_with_fetch_speedups", false)
GitV2351WithFetchSpeedups will enable the use of Git v2.35.1 with patches speeding up mirror fetches in repositories with many references.
var GoFindLicense = NewFeatureFlag("go_find_license", false)
GoFindLicense enables Go implementation of FindLicense
var LinkRepositoryToObjectPoolNotFound = NewFeatureFlag("link_repository_to_object_pool_not_found", false)
LinkRepositoryToObjectPoolNotFound disables the implicit pool creation when linking a repository to an object pool that does not exist.
var RunCommandsInCGroup = NewFeatureFlag("run_cmds_in_cgroup", true)
RunCommandsInCGroup allows all commands to be run within a cgroup
var TransactionalSymbolicRefUpdates = NewFeatureFlag("transactional_symbolic_ref_updates", false)
TransactionalSymbolicRefUpdates allows the WriteRef RPC to use an implementation to update HEAD that does its own transaction voting.
var UseBundledGit = NewFeatureFlag("use_bundled_git", true)
UseBundledGit enables the use of bundled Git if the Gitaly configuration has both a binary path and the bundled Git enabled.
var UserSquashImprovedErrorHandling = NewFeatureFlag("user_squash_improved_error_handling", false)
UserSquashImprovedErrorHandling enables proper error handling in the UserSquash RPC. When this flag is disabled many error cases were returning successfully with an error message embedded in the response. With this flag enabled, this is converted to return real gRPC errors with structured errors.
Functions ¶
func AllFlags ¶
AllFlags returns all feature flags with their value that use the Gitaly metadata prefix. Note: results will not be sorted.
func ContextWithExplicitFeatureFlags ¶ added in v14.6.0
ContextWithExplicitFeatureFlags marks the context such that all feature flags which are checked must have been explicitly set in that context. If a feature flag wasn't set to an explicit value, then checking this feature flag will panic. This is not for use in production systems, but is intended for tests to verify that we test each feature flag properly.
func ContextWithFeatureFlag ¶ added in v14.7.0
ContextWithFeatureFlag sets the feature flag in both the incoming and outgoing context.
func IncomingCtxWithFeatureFlag ¶
func IncomingCtxWithFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
IncomingCtxWithFeatureFlag sets the feature flag for an incoming context. This is NOT meant for use in clients that transfer the context across process boundaries.
func IncomingCtxWithRubyFeatureFlag ¶ added in v14.6.0
func IncomingCtxWithRubyFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
IncomingCtxWithRubyFeatureFlag sets the Ruby feature flag for an incoming context. This is NOT meant for use in clients that transfer the context across process boundaries.
func OutgoingCtxWithFeatureFlag ¶ added in v14.6.0
func OutgoingCtxWithFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
OutgoingCtxWithFeatureFlag sets the feature flag for an outgoing context.
func OutgoingCtxWithRubyFeatureFlag ¶ added in v14.6.0
func OutgoingCtxWithRubyFeatureFlag(ctx context.Context, flag FeatureFlag, enabled bool) context.Context
OutgoingCtxWithRubyFeatureFlag sets the Ruby feature flag for an outgoing context.
Types ¶
type FeatureFlag ¶
type FeatureFlag struct { // Name is the name of the feature flag. Name string `json:"name"` // OnByDefault is the default value if the feature flag is not explicitly set in // the incoming context. OnByDefault bool `json:"on_by_default"` }
FeatureFlag gates the implementation of new or changed functionality.
func NewFeatureFlag ¶ added in v14.3.0
func NewFeatureFlag(name string, onByDefault bool) FeatureFlag
NewFeatureFlag creates a new feature flag and adds it to the array of all existing feature flags.
func (FeatureFlag) IsDisabled ¶ added in v14.1.0
func (ff FeatureFlag) IsDisabled(ctx context.Context) bool
IsDisabled determines whether the feature flag is disabled in the incoming context.
func (FeatureFlag) IsEnabled ¶ added in v14.1.0
func (ff FeatureFlag) IsEnabled(ctx context.Context) bool
IsEnabled checks if the feature flag is enabled for the passed context. Only returns true if the metadata for the feature flag is set to "true"
func (FeatureFlag) MetadataKey ¶ added in v14.4.0
func (ff FeatureFlag) MetadataKey() string
MetadataKey returns the key of the feature flag as it is present in the metadata map.
type Raw ¶
Raw contains feature flags and their values in their raw form with header prefix in place and values unparsed.
func RawFromContext ¶
RawFromContext returns a map that contains all feature flags with their values. The feature flags are in their raw format with the header prefix in place. If multiple values are set a flag, the first occurrence is used.
This is mostly intended for propagating the feature flags by other means than the metadata, for example into the hooks through the environment.
Source Files ¶
- context.go
- featureflag.go
- ff_exact_pagination_token_match.go
- ff_git_v2351_with_fetch_speedups.go
- ff_go_find_license.go
- ff_link_repository_to_object_pool_not_found.go
- ff_max_queue_wait_time.go
- ff_queue_max.go
- ff_run_cmd_in_cgroup.go
- ff_use_bundled_git.go
- ff_user_squash_improved_error_handling.go
- ff_write_ref_manual_voting.go