<commit_before>package common

// App is the main top-level Resource within Supergiant, acting as a logical
// namespace for Components and all of their controlled assets -- along with
// provisioning an actual Kubernetes Namespace, it is used as a base name for
// app-specific cloud assets.
type App struct {
	Name ID `json:"name" validate:"nonzero,max=24,regexp=^[a-z]([-a-z0-9]*[a-z0-9])?$"`
	*Meta
}

type Component struct {
	Name ID `json:"name" validate:"nonzero,max=24,regexp=^[a-z]([-a-z0-9]*[a-z0-9])?$"`

	CustomDeployScript *CustomDeployScript `json:"custom_deploy_script"`

	CurrentReleaseTimestamp ID `json:"current_release_id" sg:"readonly"` // TODO this should be release_timestamp, not release_id
	TargetReleaseTimestamp  ID `json:"target_release_id" sg:"readonly"`

	Addresses *Addresses `json:"addresses,omitempty" sg:"readonly,nostore"`

	*Meta
}

// NOTE the word Blueprint is used for Volumes and Containers, since they are
// both "definitions" that create "instances" of the real thing
type Release struct {
	// NOTE Timestamp here does not use the Timestamp type.
	Timestamp ID `json:"timestamp"`

	// TODO
	// InstanceGroup is used as a labeling mechanism for instances. If nil,
	// InstanceGroup is set equal to the release's Timestamp. If a value is
	// supplied by the user, it MUST be the current (previous) Release's<commit_msg>Change max len validation on Component name to 17<commit_after>package common

// App is the main top-level Resource within Supergiant, acting as a logical
// namespace for Components and all of their controlled assets -- along with
// provisioning an actual Kubernetes Namespace, it is used as a base name for
// app-specific cloud assets.
type App struct {
	Name ID `json:"name" validate:"nonzero,max=24,regexp=^[a-z]([-a-z0-9]*[a-z0-9])?$"`
	*Meta
}

type Component struct {
	Name ID `json:"name" validate:"nonzero,max=17,regexp=^[a-z]([-a-z0-9]*[a-z0-9])?$"`

	CustomDeployScript *CustomDeployScript `json:"custom_deploy_script"`

	CurrentReleaseTimestamp ID `json:"current_release_id" sg:"readonly"` // TODO this should be release_timestamp, not release_id
	TargetReleaseTimestamp  ID `json:"target_release_id" sg:"readonly"`

	Addresses *Addresses `json:"addresses,omitempty" sg:"readonly,nostore"`

	*Meta
}

// NOTE the word Blueprint is used for Volumes and Containers, since they are
// both "definitions" that create "instances" of the real thing
type Release struct {
	// NOTE Timestamp here does not use the Timestamp type.
	Timestamp ID `json:"timestamp"`

	// TODO
	// InstanceGroup is used as a labeling mechanism for instances. If nil,
	// InstanceGroup is set equal to the release's Timestamp. If a value is
	// supplied by the user, it MUST be the current (previous) Release's
{'fraction_non_alphanumeric': 0.11183732752360204, 'fraction_numerical': 0.00944081336238199, 'mean_word_length': 4.751565762004176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3341879', 'n_tokens_mistral': 857, 'n_tokens_neox': 816, 'n_words': 309}