From b4d7a146e4db442bd55d2268c1d9d1701e22e5ce Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Wed, 10 Dec 2025 14:47:32 -0500 Subject: [PATCH 1/6] input type seems correct --- input.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/input.go b/input.go index ca996c35..51715e05 100644 --- a/input.go +++ b/input.go @@ -700,11 +700,12 @@ type ComponentTypeIconInput struct { // ComponentTypeInput Specifies the input fields used to create a component type type ComponentTypeInput struct { - Alias *Nullable[string] `json:"alias,omitempty" yaml:"alias,omitempty" example:"example_value"` // The unique alias of the component type (Optional) - Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the component type (Optional) - Icon *ComponentTypeIconInput `json:"icon,omitempty" yaml:"icon,omitempty"` // The icon associated with the component type (Optional) - Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The unique name of the component type (Optional) - Properties *[]ComponentTypePropertyDefinitionInput `json:"properties,omitempty" yaml:"properties,omitempty" example:"[]"` // A list of property definitions for the component type (Optional) + Alias *Nullable[string] `json:"alias,omitempty" yaml:"alias,omitempty" example:"example_value"` // The unique alias of the component type (Optional) + Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the component type (Optional) + Icon *ComponentTypeIconInput `json:"icon,omitempty" yaml:"icon,omitempty"` // The icon associated with the component type (Optional) + Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The unique name of the component type (Optional) + OwnerRelationship *OwnerRelationshipInput `json:"ownerRelationship,omitempty" yaml:"ownerRelationship,omitempty"` // The owner relationship for the component type (Optional) + Properties *[]ComponentTypePropertyDefinitionInput `json:"properties,omitempty" yaml:"properties,omitempty" example:"[]"` // A list of property definitions for the component type (Optional) } // ComponentTypePropertyDefinitionInput The input for defining a property @@ -981,6 +982,11 @@ type OctopusDeployIntegrationInput struct { Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The name of the integration (Optional) } +// OwnerRelationshipInput The input for defining the owner relationship for a component type. +type OwnerRelationshipInput struct { + ManagementRules *[]RelationshipDefinitionManagementRulesInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional) +} + // PayloadFilterInput Input to be used to filter types type PayloadFilterInput struct { Arg *Nullable[string] `json:"arg,omitempty" yaml:"arg,omitempty" example:"example_value"` // Value to be filtered (Optional) From 2fb33b5838c672969481f1674890fcdc02535349 Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Wed, 10 Dec 2025 15:24:47 -0500 Subject: [PATCH 2/6] run client gen? --- enum.go | 12 ------------ input.go | 36 ++++++++++++++++++------------------ object.go | 33 ++++++++++++++++----------------- relationship_test.go | 12 ++++++------ 4 files changed, 40 insertions(+), 53 deletions(-) diff --git a/enum.go b/enum.go index cb582f95..cb9c070c 100644 --- a/enum.go +++ b/enum.go @@ -3469,18 +3469,6 @@ var AllTypeEnum = []string{ string(TypeEnumStartsWith), } -type RelationshipOperatorEnum string - -var ( - RelationshipOperatorEnumEquals RelationshipOperatorEnum = "EQUALS" // Matches a specific value - RelationshipOperatorEnumArrayContains RelationshipOperatorEnum = "ARRAY_CONTAINS" // Matches any value within an array -) - -var AllRelationshipOperatorEnum = []string{ - string(RelationshipOperatorEnumEquals), - string(RelationshipOperatorEnumArrayContains), -} - // UserRole A role that can be assigned to a user type UserRole string diff --git a/input.go b/input.go index 51715e05..82a4e96e 100644 --- a/input.go +++ b/input.go @@ -944,6 +944,17 @@ type LevelUpdateInput struct { Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The display name of the level (Optional) } +// ManagementRuleInput A rule that defines how a relationship is automatically managed +type ManagementRuleInput struct { + Operator RelationshipDefinitionManagementRuleOperator `json:"operator,omitempty" yaml:"operator,omitempty" example:"ARRAY_CONTAINS"` // The operator used to compare the source and target properties (Required Default: EQUALS) + SourceProperty string `json:"sourceProperty" yaml:"sourceProperty" example:"example_value"` // The property on the source component type that is used in the rule (Required) + SourcePropertyBuiltin bool `json:"sourcePropertyBuiltin" yaml:"sourcePropertyBuiltin" example:"false"` // Whether the source property is a built-in property (Required) + TargetCategory *Nullable[string] `json:"targetCategory,omitempty" yaml:"targetCategory,omitempty" example:"example_value"` // A component type category that is the target category for the rule (Optional) + TargetProperty string `json:"targetProperty" yaml:"targetProperty" example:"example_value"` // The property on the target type that is used in the rule (Required) + TargetPropertyBuiltin bool `json:"targetPropertyBuiltin" yaml:"targetPropertyBuiltin" example:"false"` // Whether the target property is a built-in property (Required) + TargetType *Nullable[string] `json:"targetType,omitempty" yaml:"targetType,omitempty" example:"example_value"` // The target type for the rule (i.e., a component type alias, 'team', or 'user') (Optional) +} + // ManualCheckFrequencyInput Defines a frequency for the check update type ManualCheckFrequencyInput struct { FrequencyTimeScale FrequencyTimeScale `json:"frequencyTimeScale" yaml:"frequencyTimeScale" example:"day"` // The time scale type for the frequency (Required) @@ -984,7 +995,7 @@ type OctopusDeployIntegrationInput struct { // OwnerRelationshipInput The input for defining the owner relationship for a component type. type OwnerRelationshipInput struct { - ManagementRules *[]RelationshipDefinitionManagementRulesInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional) + ManagementRules *[]ManagementRuleInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional) } // PayloadFilterInput Input to be used to filter types @@ -1035,23 +1046,12 @@ type RelationshipDefinition struct { // RelationshipDefinitionInput The input for defining a relationship on a component type type RelationshipDefinitionInput struct { - Alias *string `json:"alias,omitempty" yaml:"alias,omitempty" example:"example_value"` // The unique identifier of the relationship (Optional) - ComponentType *IdentifierInput `json:"componentType,omitempty" yaml:"componentType,omitempty"` // The component type to create the relationship on (Optional) - Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the relationship (Optional) - ManagementRules *[]RelationshipDefinitionManagementRulesInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional) - Metadata *RelationshipDefinitionMetadataInput `json:"metadata,omitempty" yaml:"metadata,omitempty"` // The metadata of the relationship (Optional) - Name *string `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The name of the relationship (Optional) -} - -// RelationshipDefinitionManagementRulesInput The management rules for the relationship -type RelationshipDefinitionManagementRulesInput struct { - Operator RelationshipOperatorEnum `json:"operator" yaml:"operator" example:"EQUALS"` // The condition for this rule (Required) - SourceProperty string `json:"sourceProperty" yaml:"sourceProperty" example:"alias"` // The source property for this rule (Required) - SourcePropertyBuiltin bool `json:"sourcePropertyBuiltin" yaml:"sourcePropertyBuiltin" example:"true"` // Indicates if the property is a built in property or a custom property (Required) - TargetCategory *Nullable[string] `json:"targetCategory,omitempty" yaml:"targetCategory,omitempty" example:"infrastructure"` // The target category that this rule will target (Optional) - TargetProperty string `json:"targetProperty" yaml:"targetProperty" example:"alias"` // The target property for this rule on either the target type or target category (Required) - TargetPropertyBuiltin bool `json:"targetPropertyBuiltin" yaml:"targetPropertyBuiltin" example:"true"` // Indicates if the property is a built in property or a custom property (Required) - TargetType *Nullable[string] `json:"targetType,omitempty" yaml:"targetType,omitempty" example:"team"` // The target type that this rule will target (Optional) + Alias *string `json:"alias,omitempty" yaml:"alias,omitempty" example:"example_value"` // The unique identifier of the relationship (Optional) + ComponentType *IdentifierInput `json:"componentType,omitempty" yaml:"componentType,omitempty"` // The component type to create the relationship on (Optional) + Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the relationship (Optional) + ManagementRules *[]ManagementRuleInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional) + Metadata *RelationshipDefinitionMetadataInput `json:"metadata,omitempty" yaml:"metadata,omitempty"` // The metadata of the relationship (Optional) + Name *string `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The name of the relationship (Optional) } // RelationshipDefinitionMetadataInput The metadata of the relationship diff --git a/object.go b/object.go index 38962052..3fd6b63f 100644 --- a/object.go +++ b/object.go @@ -397,16 +397,15 @@ type Predicate struct { Value string // The value of the condition (Optional) } -// RelationshipDefinitionManagementRules The management rules for the relationship - -type RelationshipDefinitionManagementRules struct { - Operator RelationshipOperatorEnum // The condition for this rule - SourceProperty string // The source property for this rule (Required) - SourcePropertyBuiltin bool // Indicates if the property is a built in property or a custom property (Required) - TargetCategory *Nullable[string] // The target category that this rule will target (Optional) - TargetProperty string // The target property for this rule on either the target type or target category (Required) - TargetPropertyBuiltin bool // Indicates if the property is a built in property or a custom property (Required) - TargetType *Nullable[string] // The target type that this rule will target (Optional) +// RelationshipDefinitionManagementRule A rule that defines how a relationship is automatically managed +type RelationshipDefinitionManagementRule struct { + Operator RelationshipDefinitionManagementRuleOperator // The operator used to compare the source and target properties (Required) + SourceProperty string // The property on the source component type that is used in the rule (Required) + SourcePropertyBuiltin bool // Whether the source property is a built-in property (Required) + TargetCategory string // A component type category that is the target category for the rule (Optional) + TargetProperty string // The property on the target type that is used in the rule (Required) + TargetPropertyBuiltin bool // Whether the target property is a built-in property (Required) + TargetType string // The target type for the rule (i.e., a component type alias, 'team', or 'user') (Optional) } // RelationshipDefinitionMetadata The metadata of the relationship @@ -419,13 +418,13 @@ type RelationshipDefinitionMetadata struct { // RelationshipDefinitionType A dynamic definition for a relationship between one catalog entity to another type RelationshipDefinitionType struct { - Alias string // The programmatic alias that can be used to reference the relationship in OpsLevel tooling (Required) - ComponentType ComponentTypeId // The component type that the relationship belongs to (Required) - Description string // The long-form descripion of what the relationship represents (Optional) - Id ID // The ID of the relationship definition (Required) - ManagementRules []RelationshipDefinitionManagementRules // The management rules for the relationship (Optional) - Metadata RelationshipDefinitionMetadata // JSON data that defines rules for how the relationship should be validated internally (Required) - Name string // The human-readable name for a relationship (Required) + Alias string // The programmatic alias that can be used to reference the relationship in OpsLevel tooling (Required) + ComponentType ComponentTypeId // The component type that the relationship belongs to (Required) + Description string // The long-form descripion of what the relationship represents (Optional) + Id ID // The ID of the relationship definition (Required) + ManagementRules []RelationshipDefinitionManagementRule // Rules that define how relationships will be automatically created and deleted (Required) + Metadata RelationshipDefinitionMetadata // JSON data that defines rules for how the relationship should be validated internally (Required) + Name string // The human-readable name for a relationship (Required) } // RelationshipNode The relationship between two resources. A pair of source and destination resources diff --git a/relationship_test.go b/relationship_test.go index 5922d20d..ddf1fc79 100644 --- a/relationship_test.go +++ b/relationship_test.go @@ -21,9 +21,9 @@ func init() { Name: &name1, Description: ol.RefOf("Example Description"), ComponentType: ol.NewIdentifier("example"), - ManagementRules: &[]ol.RelationshipDefinitionManagementRulesInput{ + ManagementRules: &[]ol.ManagementRuleInput{ { - Operator: ol.RelationshipOperatorEnum(ol.RelationshipOperatorEnumEquals), + Operator: ol.RelationshipDefinitionManagementRuleOperator(ol.RelationshipDefinitionManagementRuleOperatorEquals), SourceProperty: "owner", SourcePropertyBuiltin: false, TargetProperty: "team", @@ -31,7 +31,7 @@ func init() { TargetCategory: ol.RefOf("infrastructure"), }, { - Operator: ol.RelationshipOperatorEnum(ol.RelationshipOperatorEnumEquals), + Operator: ol.RelationshipDefinitionManagementRuleOperator(ol.RelationshipDefinitionManagementRuleOperatorEquals), SourceProperty: "name", SourcePropertyBuiltin: true, TargetProperty: "alias", @@ -51,7 +51,7 @@ func init() { Name: name1, ManagementRules: []ol.RelationshipDefinitionManagementRules{ { - Operator: ol.RelationshipOperatorEnum(ol.RelationshipOperatorEnumEquals), + Operator: ol.RelationshipDefinitionManagementRuleOperator(ol.RelationshipDefinitionManagementRuleOperatorEquals), SourceProperty: "owner", SourcePropertyBuiltin: false, TargetProperty: "team", @@ -59,7 +59,7 @@ func init() { TargetCategory: ol.RefOf("infrastructure"), }, { - Operator: ol.RelationshipOperatorEnum(ol.RelationshipOperatorEnumEquals), + Operator: ol.RelationshipDefinitionManagementRuleOperator(ol.RelationshipDefinitionManagementRuleOperatorEquals), SourceProperty: "name", SourcePropertyBuiltin: true, TargetProperty: "alias", @@ -79,7 +79,7 @@ func init() { Name: name2, ManagementRules: []ol.RelationshipDefinitionManagementRules{ { - Operator: ol.RelationshipOperatorEnum(ol.RelationshipOperatorEnumEquals), + Operator: ol.RelationshipDefinitionManagementRuleOperator(ol.RelationshipDefinitionManagementRuleOperatorEquals), SourceProperty: "owner", SourcePropertyBuiltin: false, TargetProperty: "team", From 05d74ea3d96732894e27f20670ac9e339f6d37b9 Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Wed, 10 Dec 2025 15:59:29 -0500 Subject: [PATCH 3/6] schema seems pretty correct --- go.mod | 3 ++- go.sum | 7 ++++--- input.go | 2 +- object.go | 4 ++-- relationship_test.go | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 82d7939c..f4cb963f 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( require ( dario.cat/mergo v1.0.1 // indirect github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/coder/websocket v1.8.13 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/gabriel-vasile/mimetype v1.4.9 // indirect @@ -44,4 +44,5 @@ require ( golang.org/x/net v0.43.0 // indirect golang.org/x/sys v0.35.0 // indirect golang.org/x/text v0.28.0 // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect ) diff --git a/go.sum b/go.sum index 76164c9b..97b8b729 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= -github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE= @@ -91,7 +91,8 @@ golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/input.go b/input.go index 82a4e96e..2170c22e 100644 --- a/input.go +++ b/input.go @@ -993,7 +993,7 @@ type OctopusDeployIntegrationInput struct { Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The name of the integration (Optional) } -// OwnerRelationshipInput The input for defining the owner relationship for a component type. +// OwnerRelationshipInput The input for defining the owner relationship for a component type type OwnerRelationshipInput struct { ManagementRules *[]ManagementRuleInput `json:"managementRules,omitempty" yaml:"managementRules,omitempty"` // The management rules for the relationship (Optional) } diff --git a/object.go b/object.go index 3fd6b63f..8966b592 100644 --- a/object.go +++ b/object.go @@ -402,10 +402,10 @@ type RelationshipDefinitionManagementRule struct { Operator RelationshipDefinitionManagementRuleOperator // The operator used to compare the source and target properties (Required) SourceProperty string // The property on the source component type that is used in the rule (Required) SourcePropertyBuiltin bool // Whether the source property is a built-in property (Required) - TargetCategory string // A component type category that is the target category for the rule (Optional) + TargetCategory *Nullable[string] // A component type category that is the target category for the rule (Optional) TargetProperty string // The property on the target type that is used in the rule (Required) TargetPropertyBuiltin bool // Whether the target property is a built-in property (Required) - TargetType string // The target type for the rule (i.e., a component type alias, 'team', or 'user') (Optional) + TargetType *Nullable[string] // The target type for the rule (i.e., a component type alias, 'team', or 'user') (Optional) } // RelationshipDefinitionMetadata The metadata of the relationship diff --git a/relationship_test.go b/relationship_test.go index ddf1fc79..64653cca 100644 --- a/relationship_test.go +++ b/relationship_test.go @@ -49,7 +49,7 @@ func init() { Id: id1, Alias: alias1, Name: name1, - ManagementRules: []ol.RelationshipDefinitionManagementRules{ + ManagementRules: []ol.RelationshipDefinitionManagementRule{ { Operator: ol.RelationshipDefinitionManagementRuleOperator(ol.RelationshipDefinitionManagementRuleOperatorEquals), SourceProperty: "owner", @@ -77,7 +77,7 @@ func init() { Id: id2, Alias: alias2, Name: name2, - ManagementRules: []ol.RelationshipDefinitionManagementRules{ + ManagementRules: []ol.RelationshipDefinitionManagementRule{ { Operator: ol.RelationshipDefinitionManagementRuleOperator(ol.RelationshipDefinitionManagementRuleOperatorEquals), SourceProperty: "owner", From 97ea3a8f9a4ca7b131323d61d2b72e583690a904 Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Thu, 11 Dec 2025 12:46:27 -0500 Subject: [PATCH 4/6] add component category --- enum.go | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/enum.go b/enum.go index cb9c070c..3187dac3 100644 --- a/enum.go +++ b/enum.go @@ -2859,30 +2859,32 @@ var AllPayloadSortEnum = []string{ type PredicateKeyEnum string var ( - PredicateKeyEnumAliases PredicateKeyEnum = "aliases" // Filter by Alias attached to this service, if any - PredicateKeyEnumComponentTypeID PredicateKeyEnum = "component_type_id" // Filter by the `component_type` field - PredicateKeyEnumCreationSource PredicateKeyEnum = "creation_source" // Filter by the creation source - PredicateKeyEnumDomainID PredicateKeyEnum = "domain_id" // Filter by Domain that includes the System this service is assigned to, if any - PredicateKeyEnumFilterID PredicateKeyEnum = "filter_id" // Filter by another filter - PredicateKeyEnumFramework PredicateKeyEnum = "framework" // Filter by `framework` field - PredicateKeyEnumGroupIDs PredicateKeyEnum = "group_ids" // Filter by group hierarchy. Will return resources who's owner is in the group ancestry chain - PredicateKeyEnumLanguage PredicateKeyEnum = "language" // Filter by `language` field - PredicateKeyEnumLifecycleIndex PredicateKeyEnum = "lifecycle_index" // Filter by `lifecycle` field - PredicateKeyEnumName PredicateKeyEnum = "name" // Filter by `name` field - PredicateKeyEnumOwnerID PredicateKeyEnum = "owner_id" // Filter by `owner` field - PredicateKeyEnumOwnerIDs PredicateKeyEnum = "owner_ids" // Filter by `owner` hierarchy. Will return resources who's owner is in the team ancestry chain - PredicateKeyEnumProduct PredicateKeyEnum = "product" // Filter by `product` field - PredicateKeyEnumProperties PredicateKeyEnum = "properties" // Filter by custom-defined properties - PredicateKeyEnumRelationships PredicateKeyEnum = "relationships" // Filter by `relationships` - PredicateKeyEnumRepositoryIDs PredicateKeyEnum = "repository_ids" // Filter by Repository that this service is attached to, if any - PredicateKeyEnumSystemID PredicateKeyEnum = "system_id" // Filter by System that this service is assigned to, if any - PredicateKeyEnumTags PredicateKeyEnum = "tags" // Filter by `tags` field - PredicateKeyEnumTierIndex PredicateKeyEnum = "tier_index" // Filter by `tier` field + PredicateKeyEnumAliases PredicateKeyEnum = "aliases" // Filter by Alias attached to this service, if any + PredicateKeyEnumComponentCategory PredicateKeyEnum = "component_category" // Filter by the component type category for this service + PredicateKeyEnumComponentTypeID PredicateKeyEnum = "component_type_id" // Filter by the `component_type` field + PredicateKeyEnumCreationSource PredicateKeyEnum = "creation_source" // Filter by the creation source + PredicateKeyEnumDomainID PredicateKeyEnum = "domain_id" // Filter by Domain that includes the System this service is assigned to, if any + PredicateKeyEnumFilterID PredicateKeyEnum = "filter_id" // Filter by another filter + PredicateKeyEnumFramework PredicateKeyEnum = "framework" // Filter by `framework` field + PredicateKeyEnumGroupIDs PredicateKeyEnum = "group_ids" // Filter by group hierarchy. Will return resources who's owner is in the group ancestry chain + PredicateKeyEnumLanguage PredicateKeyEnum = "language" // Filter by `language` field + PredicateKeyEnumLifecycleIndex PredicateKeyEnum = "lifecycle_index" // Filter by `lifecycle` field + PredicateKeyEnumName PredicateKeyEnum = "name" // Filter by `name` field + PredicateKeyEnumOwnerID PredicateKeyEnum = "owner_id" // Filter by `owner` field + PredicateKeyEnumOwnerIDs PredicateKeyEnum = "owner_ids" // Filter by `owner` hierarchy. Will return resources who's owner is in the team ancestry chain + PredicateKeyEnumProduct PredicateKeyEnum = "product" // Filter by `product` field + PredicateKeyEnumProperties PredicateKeyEnum = "properties" // Filter by custom-defined properties + PredicateKeyEnumRelationships PredicateKeyEnum = "relationships" // Filter by `relationships` + PredicateKeyEnumRepositoryIDs PredicateKeyEnum = "repository_ids" // Filter by Repository that this service is attached to, if any + PredicateKeyEnumSystemID PredicateKeyEnum = "system_id" // Filter by System that this service is assigned to, if any + PredicateKeyEnumTags PredicateKeyEnum = "tags" // Filter by `tags` field + PredicateKeyEnumTierIndex PredicateKeyEnum = "tier_index" // Filter by `tier` field ) // All PredicateKeyEnum as []string var AllPredicateKeyEnum = []string{ string(PredicateKeyEnumAliases), + string(PredicateKeyEnumComponentCategory), string(PredicateKeyEnumComponentTypeID), string(PredicateKeyEnumCreationSource), string(PredicateKeyEnumDomainID), From 4fe8e172ce5e9f55cf2f5e12e1714461edaca1fc Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Thu, 11 Dec 2025 14:45:41 -0500 Subject: [PATCH 5/6] update tests --- component_test.go | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/component_test.go b/component_test.go index bb1a0217..0b3ac1ce 100644 --- a/component_test.go +++ b/component_test.go @@ -15,11 +15,23 @@ func TestComponentTypeCreate(t *testing.T) { Name: ol.RefOf("Example"), Description: ol.RefOf("Example Description"), Properties: &[]ol.ComponentTypePropertyDefinitionInput{}, + OwnerRelationship: &ol.OwnerRelationshipInput{ + ManagementRules: &[]ol.ManagementRuleInput{ + { + Operator: ol.RelationshipDefinitionManagementRuleOperatorEquals, + SourceProperty: "tag_key_eq:owner", + SourcePropertyBuiltin: true, + TargetProperty: "name", + TargetPropertyBuiltin: true, + TargetType: ol.NewNullableFrom("team"), + }, + }, + }, }) testRequest := autopilot.NewTestRequest( `mutation ComponentTypeCreate($input:ComponentTypeInput!){componentTypeCreate(input:$input){componentType{{ template "component_type_graphql" }},errors{message,path}}}`, - `{"input": {"alias": "example", "name": "Example", "description": "Example Description", "properties": []} }`, + `{"input": {"alias": "example", "name": "Example", "description": "Example Description", "properties": [], "ownerRelationship": {"managementRules": [{"operator": "EQUALS", "sourceProperty": "tag_key_eq:owner", "sourcePropertyBuiltin": true, "targetProperty": "name", "targetPropertyBuiltin": true, "targetType": "team"}]} }}`, `{"data": {"componentTypeCreate": {"componentType": {{ template "component_type_1_response" }} }}}`, ) @@ -81,11 +93,23 @@ func TestComponentTypeUpdate(t *testing.T) { Name: ol.RefOf("Example"), Description: ol.RefOf("Example Description"), Properties: &[]ol.ComponentTypePropertyDefinitionInput{}, + OwnerRelationship: &ol.OwnerRelationshipInput{ + ManagementRules: &[]ol.ManagementRuleInput{ + { + Operator: ol.RelationshipDefinitionManagementRuleOperatorEquals, + SourceProperty: "tag_key_eq:owner", + SourcePropertyBuiltin: true, + TargetProperty: "name", + TargetPropertyBuiltin: true, + TargetType: ol.NewNullableFrom("team"), + }, + }, + }, }) testRequest := autopilot.NewTestRequest( `mutation ComponentTypeUpdate($input:ComponentTypeInput!$target:IdentifierInput!){componentTypeUpdate(componentType:$target,input:$input){componentType{{ template "component_type_graphql" }},errors{message,path}}}`, - `{"input": {"alias": "example", "name": "Example", "description": "Example Description", "properties": []}, "target": { {{ template "id1" }} }}`, + `{"input": {"alias": "example", "name": "Example", "description": "Example Description", "properties": [], "ownerRelationship": {"managementRules": [{"operator": "EQUALS", "sourceProperty": "tag_key_eq:owner", "sourcePropertyBuiltin": true, "targetProperty": "name", "targetPropertyBuiltin": true, "targetType": "team"}]}}, "target": { {{ template "id1" }} }}`, `{"data": {"componentTypeUpdate": {"componentType": {{ template "component_type_1_response" }} }}}`, ) From 3b74cab8d630fd535281fc587fb3ce33252d4b74 Mon Sep 17 00:00:00 2001 From: Andrew Still Date: Thu, 11 Dec 2025 14:52:21 -0500 Subject: [PATCH 6/6] add changie --- .changes/unreleased/Feature-20251211-145211.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changes/unreleased/Feature-20251211-145211.yaml diff --git a/.changes/unreleased/Feature-20251211-145211.yaml b/.changes/unreleased/Feature-20251211-145211.yaml new file mode 100644 index 00000000..5bddc933 --- /dev/null +++ b/.changes/unreleased/Feature-20251211-145211.yaml @@ -0,0 +1,3 @@ +kind: Feature +body: Add support for owner relationships & component category predicates +time: 2025-12-11T14:52:11.411595-05:00