From fc987b0bfad42bf04576478aa1821bf4d8eceeff Mon Sep 17 00:00:00 2001 From: scme0 <scott.merchant@octopus.com> Date: Mon, 10 Feb 2025 13:05:17 +0100 Subject: [PATCH 1/4] update .gitignore to ignore .DS_Store --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 4878cdd..b0ab270 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ cover # Jetbrains Goland IDE folder .idea + +# Macos filesystem +.DS_Store From 15ac92edd73cdb053e9cce74fa70bce0954ad7d0 Mon Sep 17 00:00:00 2001 From: scme0 <scott.merchant@octopus.com> Date: Mon, 10 Feb 2025 13:06:45 +0100 Subject: [PATCH 2/4] update generated go models --- pkg/model/abac/models_gen.go | 341 ------------ pkg/model/app-proxy/models_gen.go | 452 ++++++++++++--- pkg/model/platform/models_gen.go | 526 +++++++++++++----- .../promotion-orchestrator/models_gen.go | 254 +++++++++ 4 files changed, 998 insertions(+), 575 deletions(-) delete mode 100644 pkg/model/abac/models_gen.go diff --git a/pkg/model/abac/models_gen.go b/pkg/model/abac/models_gen.go deleted file mode 100644 index f2e6127..0000000 --- a/pkg/model/abac/models_gen.go +++ /dev/null @@ -1,341 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package model - -import ( - "fmt" - "io" - "strconv" -) - -// AbacAllActionsValidatedEntity -type AbacAllActionsValidatedEntityAction struct { - Action AbacActionNames `json:"action"` - Enabled bool `json:"enabled"` -} - -// AbacAllActionsValidationResult -type AbacAllActionsValidationResult struct { - Entity string `json:"entity"` - ValidationResult []*AbacAllActionsValidatedEntityAction `json:"validationResult"` -} - -// AbacAttribute -type AbacAttribute struct { - // Name - Name AbacAttributeNames `json:"name"` - // Key - Key *string `json:"key,omitempty"` - // Value - Value string `json:"value"` -} - -// AbacAttributeInput -type AbacAttributeInput struct { - // Name - Name string `json:"name"` - // Key - Key *string `json:"key,omitempty"` - // Value - Value string `json:"value"` -} - -// AbacRulesFilterArgs -type AbacRulesFilterArgs struct { - // Filter by entity types - Type *AbacEntityValues `json:"type,omitempty"` -} - -// AbacValidateAllActionsInput -type AbacValidateAllActionsInput struct { - // AccountId - AccountID string `json:"accountId"` - // Teams - Teams []*string `json:"teams"` - // EntityType - EntityType AbacEntityValues `json:"entityType"` - // Entity - Entities []*string `json:"entities"` -} - -// AbacValidateInput -type AbacValidateInput struct { - // AccountId - AccountID string `json:"accountId"` - // Teams - Teams []*string `json:"teams"` - // Action - Action string `json:"action"` - // EntityType - EntityType AbacEntityValues `json:"entityType"` - // Entity - Entity *string `json:"entity,omitempty"` -} - -// AbacValidationResult -type AbacValidationResult struct { - IsValid bool `json:"isValid"` - Message *string `json:"message,omitempty"` -} - -// CreateRuleInput -type CreateAbacRuleInput struct { - // EntityType - EntityType AbacEntityValues `json:"entityType"` - // Teams - Teams []string `json:"teams"` - // Actions - Actions []string `json:"actions"` - // Tags - Tags []*string `json:"tags,omitempty"` - // Attributes - Attributes []*AbacAttributeInput `json:"attributes,omitempty"` -} - -// EntityAbacRules -type EntityAbacRules struct { - // Id - ID *string `json:"id,omitempty"` - // AccountId - AccountID string `json:"accountId"` - // EntityType - EntityType AbacEntityValues `json:"entityType"` - // Teams - Teams []string `json:"teams"` - // Tags - Tags []*string `json:"tags,omitempty"` - // Actions - Actions []AbacActionNames `json:"actions"` - // Attributes - Attributes []*AbacAttribute `json:"attributes"` -} - -// Mutation root -type Mutation struct { -} - -// Query root -type Query struct { -} - -// UpdateRuleInput -type UpdateAbacRuleInput struct { - // _id - ID string `json:"id"` - // AccountId - AccountID string `json:"accountId"` - // EntityType - EntityType AbacEntityValues `json:"entityType"` - // Teams - Teams []string `json:"teams"` - // Actions - Actions []string `json:"actions"` - // Tags - Tags []*string `json:"tags,omitempty"` - // Attributes - Attributes []*AbacAttributeInput `json:"attributes,omitempty"` -} - -// AbacActionNames -type AbacActionNames string - -const ( - AbacActionNamesDeleteResource AbacActionNames = "DELETE_RESOURCE" - AbacActionNamesExecToPod AbacActionNames = "EXEC_TO_POD" - AbacActionNamesRefresh AbacActionNames = "REFRESH" - AbacActionNamesSync AbacActionNames = "SYNC" - AbacActionNamesTerminateSync AbacActionNames = "TERMINATE_SYNC" - AbacActionNamesView AbacActionNames = "VIEW" - AbacActionNamesViewPodLogs AbacActionNames = "VIEW_POD_LOGS" - AbacActionNamesAppRollback AbacActionNames = "APP_ROLLBACK" - AbacActionNamesRolloutPause AbacActionNames = "ROLLOUT_PAUSE" - AbacActionNamesRolloutResume AbacActionNames = "ROLLOUT_RESUME" - AbacActionNamesRolloutPromoteFull AbacActionNames = "ROLLOUT_PROMOTE_FULL" - AbacActionNamesRolloutSkipCurrentStep AbacActionNames = "ROLLOUT_SKIP_CURRENT_STEP" - AbacActionNamesRolloutAbort AbacActionNames = "ROLLOUT_ABORT" - AbacActionNamesRolloutRetry AbacActionNames = "ROLLOUT_RETRY" - AbacActionNamesAccessArtifacts AbacActionNames = "ACCESS_ARTIFACTS" - AbacActionNamesAccessLogs AbacActionNames = "ACCESS_LOGS" - AbacActionNamesCreate AbacActionNames = "CREATE" - AbacActionNamesRestart AbacActionNames = "RESTART" - AbacActionNamesResubmit AbacActionNames = "RESUBMIT" - AbacActionNamesStop AbacActionNames = "STOP" - AbacActionNamesTerminate AbacActionNames = "TERMINATE" - AbacActionNamesTriggerPromotion AbacActionNames = "TRIGGER_PROMOTION" - AbacActionNamesRetryRelease AbacActionNames = "RETRY_RELEASE" - AbacActionNamesPromoteTo AbacActionNames = "PROMOTE_TO" -) - -var AllAbacActionNames = []AbacActionNames{ - AbacActionNamesDeleteResource, - AbacActionNamesExecToPod, - AbacActionNamesRefresh, - AbacActionNamesSync, - AbacActionNamesTerminateSync, - AbacActionNamesView, - AbacActionNamesViewPodLogs, - AbacActionNamesAppRollback, - AbacActionNamesRolloutPause, - AbacActionNamesRolloutResume, - AbacActionNamesRolloutPromoteFull, - AbacActionNamesRolloutSkipCurrentStep, - AbacActionNamesRolloutAbort, - AbacActionNamesRolloutRetry, - AbacActionNamesAccessArtifacts, - AbacActionNamesAccessLogs, - AbacActionNamesCreate, - AbacActionNamesRestart, - AbacActionNamesResubmit, - AbacActionNamesStop, - AbacActionNamesTerminate, - AbacActionNamesTriggerPromotion, - AbacActionNamesRetryRelease, - AbacActionNamesPromoteTo, -} - -func (e AbacActionNames) IsValid() bool { - switch e { - case AbacActionNamesDeleteResource, AbacActionNamesExecToPod, AbacActionNamesRefresh, AbacActionNamesSync, AbacActionNamesTerminateSync, AbacActionNamesView, AbacActionNamesViewPodLogs, AbacActionNamesAppRollback, AbacActionNamesRolloutPause, AbacActionNamesRolloutResume, AbacActionNamesRolloutPromoteFull, AbacActionNamesRolloutSkipCurrentStep, AbacActionNamesRolloutAbort, AbacActionNamesRolloutRetry, AbacActionNamesAccessArtifacts, AbacActionNamesAccessLogs, AbacActionNamesCreate, AbacActionNamesRestart, AbacActionNamesResubmit, AbacActionNamesStop, AbacActionNamesTerminate, AbacActionNamesTriggerPromotion, AbacActionNamesRetryRelease, AbacActionNamesPromoteTo: - return true - } - return false -} - -func (e AbacActionNames) String() string { - return string(e) -} - -func (e *AbacActionNames) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = AbacActionNames(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid AbacActionNames", str) - } - return nil -} - -func (e AbacActionNames) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} - -// AbacAttributeNames -type AbacAttributeNames string - -const ( - AbacAttributeNamesCluster AbacAttributeNames = "CLUSTER" - AbacAttributeNamesGitSource AbacAttributeNames = "GIT_SOURCE" - AbacAttributeNamesLabel AbacAttributeNames = "LABEL" - AbacAttributeNamesNamespace AbacAttributeNames = "NAMESPACE" - AbacAttributeNamesRuntime AbacAttributeNames = "RUNTIME" - AbacAttributeNamesProductName AbacAttributeNames = "PRODUCT_NAME" - AbacAttributeNamesEnvironmentName AbacAttributeNames = "ENVIRONMENT_NAME" - AbacAttributeNamesEnvironmentKind AbacAttributeNames = "ENVIRONMENT_KIND" -) - -var AllAbacAttributeNames = []AbacAttributeNames{ - AbacAttributeNamesCluster, - AbacAttributeNamesGitSource, - AbacAttributeNamesLabel, - AbacAttributeNamesNamespace, - AbacAttributeNamesRuntime, - AbacAttributeNamesProductName, - AbacAttributeNamesEnvironmentName, - AbacAttributeNamesEnvironmentKind, -} - -func (e AbacAttributeNames) IsValid() bool { - switch e { - case AbacAttributeNamesCluster, AbacAttributeNamesGitSource, AbacAttributeNamesLabel, AbacAttributeNamesNamespace, AbacAttributeNamesRuntime, AbacAttributeNamesProductName, AbacAttributeNamesEnvironmentName, AbacAttributeNamesEnvironmentKind: - return true - } - return false -} - -func (e AbacAttributeNames) String() string { - return string(e) -} - -func (e *AbacAttributeNames) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = AbacAttributeNames(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid AbacAttributeNames", str) - } - return nil -} - -func (e AbacAttributeNames) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} - -// Values from AbacEntityValues enum -type AbacEntityValues string - -const ( - AbacEntityValuesClusters AbacEntityValues = "clusters" - AbacEntityValuesExecutionContext AbacEntityValues = "executionContext" - AbacEntityValuesGitContexts AbacEntityValues = "gitContexts" - AbacEntityValuesGitopsApplications AbacEntityValues = "gitopsApplications" - AbacEntityValuesPromotionFlows AbacEntityValues = "promotionFlows" - AbacEntityValuesProducts AbacEntityValues = "products" - AbacEntityValuesEnvironments AbacEntityValues = "environments" - AbacEntityValuesHelmCharts AbacEntityValues = "helmCharts" - AbacEntityValuesPipelines AbacEntityValues = "pipelines" - AbacEntityValuesProjects AbacEntityValues = "projects" - AbacEntityValuesSharedConfiguration AbacEntityValues = "sharedConfiguration" - AbacEntityValuesWorkflows AbacEntityValues = "workflows" - AbacEntityValuesWorkflowTemplates AbacEntityValues = "workflowTemplates" -) - -var AllAbacEntityValues = []AbacEntityValues{ - AbacEntityValuesClusters, - AbacEntityValuesExecutionContext, - AbacEntityValuesGitContexts, - AbacEntityValuesGitopsApplications, - AbacEntityValuesPromotionFlows, - AbacEntityValuesProducts, - AbacEntityValuesEnvironments, - AbacEntityValuesHelmCharts, - AbacEntityValuesPipelines, - AbacEntityValuesProjects, - AbacEntityValuesSharedConfiguration, - AbacEntityValuesWorkflows, - AbacEntityValuesWorkflowTemplates, -} - -func (e AbacEntityValues) IsValid() bool { - switch e { - case AbacEntityValuesClusters, AbacEntityValuesExecutionContext, AbacEntityValuesGitContexts, AbacEntityValuesGitopsApplications, AbacEntityValuesPromotionFlows, AbacEntityValuesProducts, AbacEntityValuesEnvironments, AbacEntityValuesHelmCharts, AbacEntityValuesPipelines, AbacEntityValuesProjects, AbacEntityValuesSharedConfiguration, AbacEntityValuesWorkflows, AbacEntityValuesWorkflowTemplates: - return true - } - return false -} - -func (e AbacEntityValues) String() string { - return string(e) -} - -func (e *AbacEntityValues) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = AbacEntityValues(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid AbacEntityValues", str) - } - return nil -} - -func (e AbacEntityValues) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} diff --git a/pkg/model/app-proxy/models_gen.go b/pkg/model/app-proxy/models_gen.go index 672bfc4..18312f4 100644 --- a/pkg/model/app-proxy/models_gen.go +++ b/pkg/model/app-proxy/models_gen.go @@ -150,6 +150,40 @@ type WorkflowSpecTemplate interface { IsWorkflowSpecTemplate() } +// AbacAllActionsValidatedEntity +type AbacAllActionsValidatedEntityAction struct { + // Action name + Action AbacActionNames `json:"action"` + // Enabled + Enabled bool `json:"enabled"` +} + +// AbacAllActionsValidationResult +type AbacAllActionsValidationResult struct { + // Entity + Entity string `json:"entity"` + // Validation result + ValidationResult []*AbacAllActionsValidatedEntityAction `json:"validationResult"` +} + +// AbacAttribute +type AbacAttribute struct { + // Name + Name AbacAttributeNames `json:"name"` + // Key + Key *string `json:"key,omitempty"` + // Value + Value string `json:"value"` +} + +// AbacValidationResult +type AbacValidationResult struct { + // Is access validated + IsValid bool `json:"isValid"` + // Validation message + Message *string `json:"message,omitempty"` +} + // Account is logical entity that group together users pipeliens and more type Account struct { // The account id @@ -350,6 +384,10 @@ type AccountFeatures struct { HideHelmReleasesMenuItem *bool `json:"hideHelmReleasesMenuItem,omitempty"` // Hide Helm Charts item in navigation menu HideHelmChartsMenuItem *bool `json:"hideHelmChartsMenuItem,omitempty"` + // Hide all pipelines-related menu items. + HidePipelinesMenuItems *bool `json:"hidePipelinesMenuItems,omitempty"` + // Hide usage menu item. + HideUsageMenuItem *bool `json:"hideUsageMenuItem,omitempty"` // Shows promotion workflows in the application menu PromotionWorkflows *bool `json:"promotionWorkflows,omitempty"` // Allows product components to be draggable and enables a promotion flow @@ -398,6 +436,14 @@ type AccountFeatures struct { GitopsGroupsPage *bool `json:"gitopsGroupsPage,omitempty"` // Adds UX tips to GitOps platform in order to improve user flow and provide better onboarding. GitopsOnboarding *bool `json:"gitopsOnboarding,omitempty"` + // Enables new runtime installation flow wizard + RuntimeInstallationWizard *bool `json:"runtimeInstallationWizard,omitempty"` + // Enables ArgoHub welcome screen. + ArgoHubWelcomeScreen *bool `json:"argoHubWelcomeScreen,omitempty"` + // Enables ArgoHub payments view. + ArgoHubPayments *bool `json:"argoHubPayments,omitempty"` + // Enables audit view. + Auditing *bool `json:"auditing,omitempty"` } // Account Settings will hold a generic object with settings used by the UI @@ -410,6 +456,16 @@ type AccountSettings struct { UpdatedAt time.Time `json:"updatedAt"` } +// Account Usage +type AccountUsage struct { + // Applications counter + Applications int `json:"applications"` + // Products counter + Products int `json:"products"` + // Clusters counter + Clusters int `json:"clusters"` +} + // Git integration creation args type AddGitIntegrationArgs struct { // Git integration name @@ -1098,6 +1154,14 @@ type AppResourceEventsMetadata struct { ResourceVersion *string `json:"resourceVersion,omitempty"` } +// Repo Resource Manifest response +type AppResourceGitManifestResponse struct { + // Resource git manifest + Content string `json:"content"` + // Resource source + Source *RepoResourceSource `json:"source"` +} + // App Resource metadata type AppResourceMetadataInput struct { // Resource Name @@ -1136,8 +1200,6 @@ type Application struct { AppsRelations *AppsRelations `json:"appsRelations,omitempty"` // ReadPermission of related git source ReadPermission *bool `json:"readPermission,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -2109,6 +2171,8 @@ type ApplicationValidationSpec struct { Project *string `json:"project,omitempty"` // Application source Source *ApplicationValidationSource `json:"source,omitempty"` + // Application sources + Sources []*ApplicationValidationSource `json:"sources,omitempty"` } // Application validation status @@ -3060,8 +3124,6 @@ type Component struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *Application `json:"self,omitempty"` - // History of the component - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -3166,42 +3228,6 @@ type ComponentSlice struct { func (ComponentSlice) IsSlice() {} -// Composite Slice -type CompositeSlice struct { - // GitOps edges - Edges []*GitOpsEdge `json:"edges"` - // Slice information - PageInfo []*CompositeSliceInfo `json:"pageInfo"` - // Indicate if there is next slice - HasNextPage bool `json:"hasNextPage"` - // Indicate if there is previous slice - HasPrevPage bool `json:"hasPrevPage"` -} - -// Infomration about a slice of a specific kind -type CompositeSliceInfo struct { - // Key of the slice - Key string `json:"key"` - // Cursor for the first result in the slice - StartCursor *string `json:"startCursor,omitempty"` - // Cursor for the last result in the slice - EndCursor *string `json:"endCursor,omitempty"` -} - -// Pagination arguments to request kind-slice -type CompositeSlicePaginationArgs struct { - // References a specific key - Key string `json:"key"` - // Returns entities after the provided cursor - After *string `json:"after,omitempty"` - // Returns entities before the provided cursor - Before *string `json:"before,omitempty"` - // Returns the first X entities - First *int `json:"first,omitempty"` - // Returns the last X entities - Last *int `json:"last,omitempty"` -} - // ConfigMap Form Data object type ConfigMapFormData struct { // Metadata @@ -3449,8 +3475,6 @@ type Deployment struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -3669,6 +3693,24 @@ type EditUserToAccountArgs struct { Status string `json:"status"` } +// EntityAbacRules +type EntityAbacRules struct { + // Id + ID *string `json:"id,omitempty"` + // AccountId + AccountID string `json:"accountId"` + // EntityType + EntityType AbacEntityValues `json:"entityType"` + // Teams + Teams []string `json:"teams"` + // Tags + Tags []*string `json:"tags,omitempty"` + // Actions + Actions []AbacActionNames `json:"actions"` + // Attributes + Attributes []*AbacAttribute `json:"attributes"` +} + // Entity Reference Meta type EntityReferenceMeta struct { // GVK/group @@ -3825,8 +3867,6 @@ type EventSource struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the event-source - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -4019,8 +4059,6 @@ type GenericEntity struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -4200,14 +4238,6 @@ type GitIntegration struct { func (GitIntegration) IsIntegration() {} -// GitOps Edge -type GitOpsEdge struct { - // Node contains the actual component data - Node GitopsEntity `json:"node"` - // Cursor - Cursor string `json:"cursor"` -} - // GitOps settings type GitOpsSettings struct { // Account id @@ -4216,14 +4246,6 @@ type GitOpsSettings struct { IsHideHostedRuntimeBoxes bool `json:"isHideHostedRuntimeBoxes"` } -// GitOps Slice -type GitOpsSlice struct { - // GitOps edges - Edges []*GitOpsEdge `json:"edges"` - // Slice information - PageInfo *SliceInfo `json:"pageInfo"` -} - // GitOrganization type GitOrganization struct { // Name @@ -4470,8 +4492,6 @@ type GitSource struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *Application `json:"self,omitempty"` - // History of the GitSource - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -4678,7 +4698,11 @@ type GitlabTriggerConditionsArgs struct { // Gitops entity source type GitopsEntitySource struct { - // Entity source + // Source application name + AppName *string `json:"appName,omitempty"` + // Source application namespace + AppNamespace *string `json:"appNamespace,omitempty"` + // Entity codefresh git source GitSource *GitSource `json:"gitSource,omitempty"` // Repo URL RepoURL *string `json:"repoURL,omitempty"` @@ -5476,8 +5500,6 @@ type IntegrationConfig struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -5638,8 +5660,6 @@ type IntegrationSecret struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -6308,8 +6328,6 @@ type Pipeline struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *Sensor `json:"self,omitempty"` - // History of the pipeline - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -6760,8 +6778,6 @@ type Product struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -6782,6 +6798,8 @@ type Product struct { Projects []string `json:"projects,omitempty"` // Promotion flows and their selectors PromotionFlows []*ProductPromotionFlowSelectors `json:"promotionFlows,omitempty"` + // Product concurrency + Concurrency *ProductConcurrency `json:"concurrency,omitempty"` } func (Product) IsFavorableNotK8sEntity() {} @@ -7170,8 +7188,6 @@ type PromotionFlow struct { AppsRelations *AppsRelations `json:"appsRelations,omitempty"` // ReadPermission of related git source ReadPermission *bool `json:"readPermission,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -7238,8 +7254,6 @@ type PromotionPolicy struct { Source *GitopsEntitySource `json:"source"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` - // History - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -7472,6 +7486,10 @@ type PullRequestArgs struct { AvatarURL string `json:"avatarUrl"` // Pull request created at CreatedAt string `json:"createdAt"` + // Pull request state + State *PullRequestState `json:"state,omitempty"` + // Pull request is merged + IsMerged *bool `json:"isMerged,omitempty"` } // PullRequestCommitter @@ -7659,8 +7677,6 @@ type ReplicaSet struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Image Image string `json:"image"` // Replicas @@ -7721,6 +7737,28 @@ type RepoBitbucketCloudFilterArgsInput struct { RepositorySlug string `json:"repositorySlug"` } +// Repo Resource metadata +type RepoResourceMetadataInput struct { + // Resource Name + Name string `json:"name"` + // Resource api version + Version string `json:"version"` + // Resource king + Kind string `json:"kind"` + // Resource group + Group *string `json:"group,omitempty"` +} + +// Repo Resource Source data +type RepoResourceSource struct { + // Repository URL + RepoURL string `json:"repoURL"` + // Repository revision + Revision string `json:"revision"` + // Repository path + Path string `json:"path"` +} + // Runtime Errors Report Arguments type ReportRuntimeErrorsArgs struct { // Name of the Runtime @@ -8239,8 +8277,6 @@ type Rollout struct { References []BaseEntity `json:"references,omitempty"` // Entities referencing this entity ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` - // History of the entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -8605,8 +8641,6 @@ type Runtime struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *GenericEntity `json:"self,omitempty"` - // History of the runtime - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -9081,8 +9115,6 @@ type Sensor struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the sensor - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -9141,8 +9173,6 @@ type ServiceEntity struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -10293,8 +10323,6 @@ type WorkflowTemplate struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the workflow-template - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -10381,6 +10409,208 @@ type WorkflowTemplatesFilterArgs struct { PromotionRelated *bool `json:"promotionRelated,omitempty"` } +// AbacActionNames +type AbacActionNames string + +const ( + AbacActionNamesAccessArtifacts AbacActionNames = "ACCESS_ARTIFACTS" + AbacActionNamesAccessLogs AbacActionNames = "ACCESS_LOGS" + AbacActionNamesAppRollback AbacActionNames = "APP_ROLLBACK" + AbacActionNamesCreate AbacActionNames = "CREATE" + AbacActionNamesDeleteResource AbacActionNames = "DELETE_RESOURCE" + AbacActionNamesExecToPod AbacActionNames = "EXEC_TO_POD" + AbacActionNamesPromoteTo AbacActionNames = "PROMOTE_TO" + AbacActionNamesRefresh AbacActionNames = "REFRESH" + AbacActionNamesRestart AbacActionNames = "RESTART" + AbacActionNamesResubmit AbacActionNames = "RESUBMIT" + AbacActionNamesRetryRelease AbacActionNames = "RETRY_RELEASE" + AbacActionNamesRolloutAbort AbacActionNames = "ROLLOUT_ABORT" + AbacActionNamesRolloutPause AbacActionNames = "ROLLOUT_PAUSE" + AbacActionNamesRolloutPromoteFull AbacActionNames = "ROLLOUT_PROMOTE_FULL" + AbacActionNamesRolloutResume AbacActionNames = "ROLLOUT_RESUME" + AbacActionNamesRolloutRetry AbacActionNames = "ROLLOUT_RETRY" + AbacActionNamesRolloutSkipCurrentStep AbacActionNames = "ROLLOUT_SKIP_CURRENT_STEP" + AbacActionNamesStop AbacActionNames = "STOP" + AbacActionNamesSync AbacActionNames = "SYNC" + AbacActionNamesTerminate AbacActionNames = "TERMINATE" + AbacActionNamesTerminateSync AbacActionNames = "TERMINATE_SYNC" + AbacActionNamesTriggerPromotion AbacActionNames = "TRIGGER_PROMOTION" + AbacActionNamesViewviewPodLogs AbacActionNames = "VIEWVIEW_POD_LOGS" +) + +var AllAbacActionNames = []AbacActionNames{ + AbacActionNamesAccessArtifacts, + AbacActionNamesAccessLogs, + AbacActionNamesAppRollback, + AbacActionNamesCreate, + AbacActionNamesDeleteResource, + AbacActionNamesExecToPod, + AbacActionNamesPromoteTo, + AbacActionNamesRefresh, + AbacActionNamesRestart, + AbacActionNamesResubmit, + AbacActionNamesRetryRelease, + AbacActionNamesRolloutAbort, + AbacActionNamesRolloutPause, + AbacActionNamesRolloutPromoteFull, + AbacActionNamesRolloutResume, + AbacActionNamesRolloutRetry, + AbacActionNamesRolloutSkipCurrentStep, + AbacActionNamesStop, + AbacActionNamesSync, + AbacActionNamesTerminate, + AbacActionNamesTerminateSync, + AbacActionNamesTriggerPromotion, + AbacActionNamesViewviewPodLogs, +} + +func (e AbacActionNames) IsValid() bool { + switch e { + case AbacActionNamesAccessArtifacts, AbacActionNamesAccessLogs, AbacActionNamesAppRollback, AbacActionNamesCreate, AbacActionNamesDeleteResource, AbacActionNamesExecToPod, AbacActionNamesPromoteTo, AbacActionNamesRefresh, AbacActionNamesRestart, AbacActionNamesResubmit, AbacActionNamesRetryRelease, AbacActionNamesRolloutAbort, AbacActionNamesRolloutPause, AbacActionNamesRolloutPromoteFull, AbacActionNamesRolloutResume, AbacActionNamesRolloutRetry, AbacActionNamesRolloutSkipCurrentStep, AbacActionNamesStop, AbacActionNamesSync, AbacActionNamesTerminate, AbacActionNamesTerminateSync, AbacActionNamesTriggerPromotion, AbacActionNamesViewviewPodLogs: + return true + } + return false +} + +func (e AbacActionNames) String() string { + return string(e) +} + +func (e *AbacActionNames) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacActionNames(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacActionNames", str) + } + return nil +} + +func (e AbacActionNames) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// AbacAttributeNames +type AbacAttributeNames string + +const ( + AbacAttributeNamesCluster AbacAttributeNames = "CLUSTER" + AbacAttributeNamesEnvironmentKind AbacAttributeNames = "ENVIRONMENT_KIND" + AbacAttributeNamesEnvironmentName AbacAttributeNames = "ENVIRONMENT_NAME" + AbacAttributeNamesGitSource AbacAttributeNames = "GIT_SOURCE" + AbacAttributeNamesLabel AbacAttributeNames = "LABEL" + AbacAttributeNamesNamespace AbacAttributeNames = "NAMESPACE" + AbacAttributeNamesProductName AbacAttributeNames = "PRODUCT_NAME" + AbacAttributeNamesRuntime AbacAttributeNames = "RUNTIME" +) + +var AllAbacAttributeNames = []AbacAttributeNames{ + AbacAttributeNamesCluster, + AbacAttributeNamesEnvironmentKind, + AbacAttributeNamesEnvironmentName, + AbacAttributeNamesGitSource, + AbacAttributeNamesLabel, + AbacAttributeNamesNamespace, + AbacAttributeNamesProductName, + AbacAttributeNamesRuntime, +} + +func (e AbacAttributeNames) IsValid() bool { + switch e { + case AbacAttributeNamesCluster, AbacAttributeNamesEnvironmentKind, AbacAttributeNamesEnvironmentName, AbacAttributeNamesGitSource, AbacAttributeNamesLabel, AbacAttributeNamesNamespace, AbacAttributeNamesProductName, AbacAttributeNamesRuntime: + return true + } + return false +} + +func (e AbacAttributeNames) String() string { + return string(e) +} + +func (e *AbacAttributeNames) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacAttributeNames(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacAttributeNames", str) + } + return nil +} + +func (e AbacAttributeNames) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Values from AbacEntityValues enum +type AbacEntityValues string + +const ( + AbacEntityValuesClusters AbacEntityValues = "clusters" + AbacEntityValuesEnvironments AbacEntityValues = "environments" + AbacEntityValuesExecutionContext AbacEntityValues = "executionContext" + AbacEntityValuesGitContexts AbacEntityValues = "gitContexts" + AbacEntityValuesGitopsApplications AbacEntityValues = "gitopsApplications" + AbacEntityValuesHelmCharts AbacEntityValues = "helmCharts" + AbacEntityValuesPipelines AbacEntityValues = "pipelines" + AbacEntityValuesProducts AbacEntityValues = "products" + AbacEntityValuesProjects AbacEntityValues = "projects" + AbacEntityValuesPromotionFlows AbacEntityValues = "promotionFlows" + AbacEntityValuesSharedConfiguration AbacEntityValues = "sharedConfiguration" + AbacEntityValuesWorkflows AbacEntityValues = "workflows" + AbacEntityValuesWorkflowTemplates AbacEntityValues = "workflowTemplates" +) + +var AllAbacEntityValues = []AbacEntityValues{ + AbacEntityValuesClusters, + AbacEntityValuesEnvironments, + AbacEntityValuesExecutionContext, + AbacEntityValuesGitContexts, + AbacEntityValuesGitopsApplications, + AbacEntityValuesHelmCharts, + AbacEntityValuesPipelines, + AbacEntityValuesProducts, + AbacEntityValuesProjects, + AbacEntityValuesPromotionFlows, + AbacEntityValuesSharedConfiguration, + AbacEntityValuesWorkflows, + AbacEntityValuesWorkflowTemplates, +} + +func (e AbacEntityValues) IsValid() bool { + switch e { + case AbacEntityValuesClusters, AbacEntityValuesEnvironments, AbacEntityValuesExecutionContext, AbacEntityValuesGitContexts, AbacEntityValuesGitopsApplications, AbacEntityValuesHelmCharts, AbacEntityValuesPipelines, AbacEntityValuesProducts, AbacEntityValuesProjects, AbacEntityValuesPromotionFlows, AbacEntityValuesSharedConfiguration, AbacEntityValuesWorkflows, AbacEntityValuesWorkflowTemplates: + return true + } + return false +} + +func (e AbacEntityValues) String() string { + return string(e) +} + +func (e *AbacEntityValues) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacEntityValues(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacEntityValues", str) + } + return nil +} + +func (e AbacEntityValues) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // Access Mode type AccessMode string @@ -12331,6 +12561,50 @@ func (e ProductComponentType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +// ProductConcurrency +type ProductConcurrency string + +const ( + // Queue + ProductConcurrencyQueue ProductConcurrency = "queue" + // Terminate + ProductConcurrencyTerminate ProductConcurrency = "terminate" +) + +var AllProductConcurrency = []ProductConcurrency{ + ProductConcurrencyQueue, + ProductConcurrencyTerminate, +} + +func (e ProductConcurrency) IsValid() bool { + switch e { + case ProductConcurrencyQueue, ProductConcurrencyTerminate: + return true + } + return false +} + +func (e ProductConcurrency) String() string { + return string(e) +} + +func (e *ProductConcurrency) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ProductConcurrency(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ProductConcurrency", str) + } + return nil +} + +func (e ProductConcurrency) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // ProductGitTrigger type ProductGitTrigger string diff --git a/pkg/model/platform/models_gen.go b/pkg/model/platform/models_gen.go index 633241b..84d3b59 100644 --- a/pkg/model/platform/models_gen.go +++ b/pkg/model/platform/models_gen.go @@ -155,6 +155,50 @@ type WorkflowSpecTemplate interface { IsWorkflowSpecTemplate() } +// AbacAllActionsValidatedEntity +type AbacAllActionsValidatedEntityAction struct { + // Action name + Action AbacActionNames `json:"action"` + // Enabled + Enabled bool `json:"enabled"` +} + +// AbacAllActionsValidationResult +type AbacAllActionsValidationResult struct { + // Entity + Entity string `json:"entity"` + // Validation result + ValidationResult []*AbacAllActionsValidatedEntityAction `json:"validationResult"` +} + +// AbacAttribute +type AbacAttribute struct { + // Name + Name AbacAttributeNames `json:"name"` + // Key + Key *string `json:"key,omitempty"` + // Value + Value string `json:"value"` +} + +// AbacAttributeInput +type AbacAttributeInput struct { + // Name + Name string `json:"name"` + // Key + Key *string `json:"key,omitempty"` + // Value + Value string `json:"value"` +} + +// AbacValidationResult +type AbacValidationResult struct { + // Is access validated + IsValid bool `json:"isValid"` + // Validation message + Message *string `json:"message,omitempty"` +} + // Account is logical entity that group together users pipeliens and more type Account struct { // The account id @@ -355,6 +399,10 @@ type AccountFeatures struct { HideHelmReleasesMenuItem *bool `json:"hideHelmReleasesMenuItem,omitempty"` // Hide Helm Charts item in navigation menu HideHelmChartsMenuItem *bool `json:"hideHelmChartsMenuItem,omitempty"` + // Hide all pipelines-related menu items. + HidePipelinesMenuItems *bool `json:"hidePipelinesMenuItems,omitempty"` + // Hide usage menu item. + HideUsageMenuItem *bool `json:"hideUsageMenuItem,omitempty"` // Shows promotion workflows in the application menu PromotionWorkflows *bool `json:"promotionWorkflows,omitempty"` // Allows product components to be draggable and enables a promotion flow @@ -403,6 +451,14 @@ type AccountFeatures struct { GitopsGroupsPage *bool `json:"gitopsGroupsPage,omitempty"` // Adds UX tips to GitOps platform in order to improve user flow and provide better onboarding. GitopsOnboarding *bool `json:"gitopsOnboarding,omitempty"` + // Enables new runtime installation flow wizard + RuntimeInstallationWizard *bool `json:"runtimeInstallationWizard,omitempty"` + // Enables ArgoHub welcome screen. + ArgoHubWelcomeScreen *bool `json:"argoHubWelcomeScreen,omitempty"` + // Enables ArgoHub payments view. + ArgoHubPayments *bool `json:"argoHubPayments,omitempty"` + // Enables audit view. + Auditing *bool `json:"auditing,omitempty"` } // Account Settings will hold a generic object with settings used by the UI @@ -425,6 +481,16 @@ type AccountSettingsInput struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } +// Account Usage +type AccountUsage struct { + // Applications counter + Applications int `json:"applications"` + // Products counter + Products int `json:"products"` + // Clusters counter + Clusters int `json:"clusters"` +} + // Args to add user to account type AddUserToAccountArgs struct { // User email @@ -933,8 +999,6 @@ type Application struct { AppsRelations *AppsRelations `json:"appsRelations,omitempty"` // ReadPermission of related git source ReadPermission *bool `json:"readPermission,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -1149,6 +1213,8 @@ type ApplicationFormInputMetadata struct { // Application form Source type ApplicationFormInputSource struct { + // Name of ref source + Ref *string `json:"ref,omitempty"` // Path Path *string `json:"path,omitempty"` // Repository url @@ -1893,6 +1959,12 @@ type ApplicationsFilterArgs struct { Inactive *bool `json:"inactive,omitempty"` // Include runtime components in the result IncludeComponents *bool `json:"includeComponents,omitempty"` + // Include git sources in the result + ExcludeGitSources *bool `json:"excludeGitSources,omitempty"` + // Filter applications by app groups + AppGroups []string `json:"appGroups,omitempty"` + // Filter with or without app groups + HasAppGroups *bool `json:"hasAppGroups,omitempty"` } // Application relations @@ -2827,8 +2899,6 @@ type Component struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *Application `json:"self,omitempty"` - // History of the component - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -2923,42 +2993,6 @@ type ComponentSlice struct { func (ComponentSlice) IsSlice() {} -// Composite Slice -type CompositeSlice struct { - // GitOps edges - Edges []*GitOpsEdge `json:"edges"` - // Slice information - PageInfo []*CompositeSliceInfo `json:"pageInfo"` - // Indicate if there is next slice - HasNextPage bool `json:"hasNextPage"` - // Indicate if there is previous slice - HasPrevPage bool `json:"hasPrevPage"` -} - -// Infomration about a slice of a specific kind -type CompositeSliceInfo struct { - // Key of the slice - Key string `json:"key"` - // Cursor for the first result in the slice - StartCursor *string `json:"startCursor,omitempty"` - // Cursor for the last result in the slice - EndCursor *string `json:"endCursor,omitempty"` -} - -// Pagination arguments to request kind-slice -type CompositeSlicePaginationArgs struct { - // References a specific key - Key string `json:"key"` - // Returns entities after the provided cursor - After *string `json:"after,omitempty"` - // Returns entities before the provided cursor - Before *string `json:"before,omitempty"` - // Returns the first X entities - First *int `json:"first,omitempty"` - // Returns the last X entities - Last *int `json:"last,omitempty"` -} - // ConfigMap Form Data object type ConfigMapFormData struct { // Metadata @@ -3021,6 +3055,20 @@ type ConnectionStateInput struct { AttemptedAt *string `json:"attemptedAt,omitempty"` } +// CreateRuleInput +type CreateAbacRuleInput struct { + // EntityType + EntityType AbacEntityValues `json:"entityType"` + // Teams + Teams []string `json:"teams"` + // Actions + Actions []string `json:"actions"` + // Tags + Tags []*string `json:"tags,omitempty"` + // Attributes + Attributes []*AbacAttributeInput `json:"attributes,omitempty"` +} + // Create Audit Classic Record Response type CreateAuditClassicRecordResponse struct { // IsError @@ -3133,8 +3181,6 @@ type Deployment struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -3353,6 +3399,24 @@ type EditUserToAccountArgs struct { Status string `json:"status"` } +// EntityAbacRules +type EntityAbacRules struct { + // Id + ID *string `json:"id,omitempty"` + // AccountId + AccountID string `json:"accountId"` + // EntityType + EntityType AbacEntityValues `json:"entityType"` + // Teams + Teams []string `json:"teams"` + // Tags + Tags []*string `json:"tags,omitempty"` + // Actions + Actions []AbacActionNames `json:"actions"` + // Attributes + Attributes []*AbacAttribute `json:"attributes"` +} + // Db Entity Reference type EntityReference struct { // GVK/group @@ -3537,8 +3601,6 @@ type EventSource struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the event-source - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -3671,8 +3733,6 @@ type GenericEntity struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -3849,14 +3909,6 @@ type GitConfigEntitySource struct { ResourceAction *ResourceAction `json:"resourceAction,omitempty"` } -// GitOps Edge -type GitOpsEdge struct { - // Node contains the actual component data - Node GitopsEntity `json:"node"` - // Cursor - Cursor string `json:"cursor"` -} - // GitOps settings type GitOpsSettings struct { // Account id @@ -3871,14 +3923,6 @@ type GitOpsSettingsInput struct { IsHideHostedRuntimeBoxes *bool `json:"isHideHostedRuntimeBoxes,omitempty"` } -// GitOps Slice -type GitOpsSlice struct { - // GitOps edges - Edges []*GitOpsEdge `json:"edges"` - // Slice information - PageInfo *SliceInfo `json:"pageInfo"` -} - // "PR data type GitPr struct { // PR action @@ -4101,8 +4145,6 @@ type GitSource struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *Application `json:"self,omitempty"` - // History of the GitSource - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -4321,7 +4363,11 @@ type GitlabTriggerConditionsArgs struct { // Gitops entity source type GitopsEntitySource struct { - // Entity source + // Source application name + AppName *string `json:"appName,omitempty"` + // Source application namespace + AppNamespace *string `json:"appNamespace,omitempty"` + // Entity codefresh git source GitSource *GitSource `json:"gitSource,omitempty"` // Repo URL RepoURL *string `json:"repoURL,omitempty"` @@ -4601,18 +4647,6 @@ type HierarchyTemplates struct { Refs []*HierarchyRef `json:"refs,omitempty"` } -// History arguments -type HistoryArgs struct { - // History Pagination arguments - Pagination []*CompositeSlicePaginationArgs `json:"pagination,omitempty"` - // Page Size - PageSize *int `json:"pageSize,omitempty"` - // Sync Success - SUCCESS/FAILURE - SyncSuccess *SyncSuccess `json:"syncSuccess,omitempty"` - // Repo - Repo *string `json:"repo,omitempty"` -} - // Image application type ImageApplication struct { // Application Ref metadata @@ -5293,8 +5327,6 @@ type IntegrationConfig struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -5438,8 +5470,6 @@ type IntegrationSecret struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -6128,8 +6158,6 @@ type Pipeline struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *Sensor `json:"self,omitempty"` - // History of the pipeline - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -6568,8 +6596,6 @@ type Product struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -6590,6 +6616,8 @@ type Product struct { Projects []string `json:"projects,omitempty"` // Promotion flows and their selectors PromotionFlows []*ProductPromotionFlowSelectors `json:"promotionFlows,omitempty"` + // Product concurrency + Concurrency *ProductConcurrency `json:"concurrency,omitempty"` } func (Product) IsFavorableNotK8sEntity() {} @@ -6956,8 +6984,6 @@ type PromotionFlow struct { AppsRelations *AppsRelations `json:"appsRelations,omitempty"` // ReadPermission of related git source ReadPermission *bool `json:"readPermission,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -7036,8 +7062,6 @@ type PromotionPolicy struct { Source *GitopsEntitySource `json:"source"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` - // History - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -7274,6 +7298,10 @@ type PullRequestArgs struct { AvatarURL string `json:"avatarUrl"` // Pull request created at CreatedAt string `json:"createdAt"` + // Pull request state + State *PullRequestState `json:"state,omitempty"` + // Pull request is merged + IsMerged *bool `json:"isMerged,omitempty"` } // PullRequestCommitter @@ -7428,8 +7456,6 @@ type ReplicaSet struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the application - History *GitOpsSlice `json:"history"` // Image Image string `json:"image"` // Replicas @@ -7668,8 +7694,6 @@ type Rollout struct { References []BaseEntity `json:"references,omitempty"` // Entities referencing this entity ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` - // History of the entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -8056,8 +8080,6 @@ type Runtime struct { References []BaseEntity `json:"references,omitempty"` // Self entity reference for the real k8s entity in case of codefresh logical entity Self *GenericEntity `json:"self,omitempty"` - // History of the runtime - History *CompositeSlice `json:"history"` // Sync status SyncStatus SyncStatus `json:"syncStatus"` // Health status @@ -8526,8 +8548,6 @@ type Sensor struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the sensor - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -8598,8 +8618,6 @@ type ServiceEntity struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the generic entity - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -9256,6 +9274,24 @@ type UnknownEventPayloadData struct { func (UnknownEventPayloadData) IsEventPayloadData() {} +// UpdateRuleInput +type UpdateAbacRuleInput struct { + // _id + ID string `json:"id"` + // AccountId + AccountID string `json:"accountId"` + // EntityType + EntityType AbacEntityValues `json:"entityType"` + // Teams + Teams []string `json:"teams"` + // Actions + Actions []string `json:"actions"` + // Tags + Tags []*string `json:"tags,omitempty"` + // Attributes + Attributes []*AbacAttributeInput `json:"attributes,omitempty"` +} + // Update Environment Input type UpdateEnvironmentArgs struct { // Id of the environment @@ -9708,8 +9744,6 @@ type WorkflowTemplate struct { ReferencedBy []BaseEntity `json:"referencedBy,omitempty"` // Entities referenced by this enitity References []BaseEntity `json:"references,omitempty"` - // History of the workflow-template - History *GitOpsSlice `json:"history"` // Version of the entity Version *int `json:"version,omitempty"` // Is this the latest version of this entity @@ -9852,6 +9886,208 @@ type WorkflowsFilterArgs struct { Environments []*string `json:"environments,omitempty"` } +// AbacActionNames +type AbacActionNames string + +const ( + AbacActionNamesAccessArtifacts AbacActionNames = "ACCESS_ARTIFACTS" + AbacActionNamesAccessLogs AbacActionNames = "ACCESS_LOGS" + AbacActionNamesAppRollback AbacActionNames = "APP_ROLLBACK" + AbacActionNamesCreate AbacActionNames = "CREATE" + AbacActionNamesDeleteResource AbacActionNames = "DELETE_RESOURCE" + AbacActionNamesExecToPod AbacActionNames = "EXEC_TO_POD" + AbacActionNamesPromoteTo AbacActionNames = "PROMOTE_TO" + AbacActionNamesRefresh AbacActionNames = "REFRESH" + AbacActionNamesRestart AbacActionNames = "RESTART" + AbacActionNamesResubmit AbacActionNames = "RESUBMIT" + AbacActionNamesRetryRelease AbacActionNames = "RETRY_RELEASE" + AbacActionNamesRolloutAbort AbacActionNames = "ROLLOUT_ABORT" + AbacActionNamesRolloutPause AbacActionNames = "ROLLOUT_PAUSE" + AbacActionNamesRolloutPromoteFull AbacActionNames = "ROLLOUT_PROMOTE_FULL" + AbacActionNamesRolloutResume AbacActionNames = "ROLLOUT_RESUME" + AbacActionNamesRolloutRetry AbacActionNames = "ROLLOUT_RETRY" + AbacActionNamesRolloutSkipCurrentStep AbacActionNames = "ROLLOUT_SKIP_CURRENT_STEP" + AbacActionNamesStop AbacActionNames = "STOP" + AbacActionNamesSync AbacActionNames = "SYNC" + AbacActionNamesTerminate AbacActionNames = "TERMINATE" + AbacActionNamesTerminateSync AbacActionNames = "TERMINATE_SYNC" + AbacActionNamesTriggerPromotion AbacActionNames = "TRIGGER_PROMOTION" + AbacActionNamesViewviewPodLogs AbacActionNames = "VIEWVIEW_POD_LOGS" +) + +var AllAbacActionNames = []AbacActionNames{ + AbacActionNamesAccessArtifacts, + AbacActionNamesAccessLogs, + AbacActionNamesAppRollback, + AbacActionNamesCreate, + AbacActionNamesDeleteResource, + AbacActionNamesExecToPod, + AbacActionNamesPromoteTo, + AbacActionNamesRefresh, + AbacActionNamesRestart, + AbacActionNamesResubmit, + AbacActionNamesRetryRelease, + AbacActionNamesRolloutAbort, + AbacActionNamesRolloutPause, + AbacActionNamesRolloutPromoteFull, + AbacActionNamesRolloutResume, + AbacActionNamesRolloutRetry, + AbacActionNamesRolloutSkipCurrentStep, + AbacActionNamesStop, + AbacActionNamesSync, + AbacActionNamesTerminate, + AbacActionNamesTerminateSync, + AbacActionNamesTriggerPromotion, + AbacActionNamesViewviewPodLogs, +} + +func (e AbacActionNames) IsValid() bool { + switch e { + case AbacActionNamesAccessArtifacts, AbacActionNamesAccessLogs, AbacActionNamesAppRollback, AbacActionNamesCreate, AbacActionNamesDeleteResource, AbacActionNamesExecToPod, AbacActionNamesPromoteTo, AbacActionNamesRefresh, AbacActionNamesRestart, AbacActionNamesResubmit, AbacActionNamesRetryRelease, AbacActionNamesRolloutAbort, AbacActionNamesRolloutPause, AbacActionNamesRolloutPromoteFull, AbacActionNamesRolloutResume, AbacActionNamesRolloutRetry, AbacActionNamesRolloutSkipCurrentStep, AbacActionNamesStop, AbacActionNamesSync, AbacActionNamesTerminate, AbacActionNamesTerminateSync, AbacActionNamesTriggerPromotion, AbacActionNamesViewviewPodLogs: + return true + } + return false +} + +func (e AbacActionNames) String() string { + return string(e) +} + +func (e *AbacActionNames) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacActionNames(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacActionNames", str) + } + return nil +} + +func (e AbacActionNames) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// AbacAttributeNames +type AbacAttributeNames string + +const ( + AbacAttributeNamesCluster AbacAttributeNames = "CLUSTER" + AbacAttributeNamesEnvironmentKind AbacAttributeNames = "ENVIRONMENT_KIND" + AbacAttributeNamesEnvironmentName AbacAttributeNames = "ENVIRONMENT_NAME" + AbacAttributeNamesGitSource AbacAttributeNames = "GIT_SOURCE" + AbacAttributeNamesLabel AbacAttributeNames = "LABEL" + AbacAttributeNamesNamespace AbacAttributeNames = "NAMESPACE" + AbacAttributeNamesProductName AbacAttributeNames = "PRODUCT_NAME" + AbacAttributeNamesRuntime AbacAttributeNames = "RUNTIME" +) + +var AllAbacAttributeNames = []AbacAttributeNames{ + AbacAttributeNamesCluster, + AbacAttributeNamesEnvironmentKind, + AbacAttributeNamesEnvironmentName, + AbacAttributeNamesGitSource, + AbacAttributeNamesLabel, + AbacAttributeNamesNamespace, + AbacAttributeNamesProductName, + AbacAttributeNamesRuntime, +} + +func (e AbacAttributeNames) IsValid() bool { + switch e { + case AbacAttributeNamesCluster, AbacAttributeNamesEnvironmentKind, AbacAttributeNamesEnvironmentName, AbacAttributeNamesGitSource, AbacAttributeNamesLabel, AbacAttributeNamesNamespace, AbacAttributeNamesProductName, AbacAttributeNamesRuntime: + return true + } + return false +} + +func (e AbacAttributeNames) String() string { + return string(e) +} + +func (e *AbacAttributeNames) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacAttributeNames(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacAttributeNames", str) + } + return nil +} + +func (e AbacAttributeNames) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Values from AbacEntityValues enum +type AbacEntityValues string + +const ( + AbacEntityValuesClusters AbacEntityValues = "clusters" + AbacEntityValuesEnvironments AbacEntityValues = "environments" + AbacEntityValuesExecutionContext AbacEntityValues = "executionContext" + AbacEntityValuesGitContexts AbacEntityValues = "gitContexts" + AbacEntityValuesGitopsApplications AbacEntityValues = "gitopsApplications" + AbacEntityValuesHelmCharts AbacEntityValues = "helmCharts" + AbacEntityValuesPipelines AbacEntityValues = "pipelines" + AbacEntityValuesProducts AbacEntityValues = "products" + AbacEntityValuesProjects AbacEntityValues = "projects" + AbacEntityValuesPromotionFlows AbacEntityValues = "promotionFlows" + AbacEntityValuesSharedConfiguration AbacEntityValues = "sharedConfiguration" + AbacEntityValuesWorkflows AbacEntityValues = "workflows" + AbacEntityValuesWorkflowTemplates AbacEntityValues = "workflowTemplates" +) + +var AllAbacEntityValues = []AbacEntityValues{ + AbacEntityValuesClusters, + AbacEntityValuesEnvironments, + AbacEntityValuesExecutionContext, + AbacEntityValuesGitContexts, + AbacEntityValuesGitopsApplications, + AbacEntityValuesHelmCharts, + AbacEntityValuesPipelines, + AbacEntityValuesProducts, + AbacEntityValuesProjects, + AbacEntityValuesPromotionFlows, + AbacEntityValuesSharedConfiguration, + AbacEntityValuesWorkflows, + AbacEntityValuesWorkflowTemplates, +} + +func (e AbacEntityValues) IsValid() bool { + switch e { + case AbacEntityValuesClusters, AbacEntityValuesEnvironments, AbacEntityValuesExecutionContext, AbacEntityValuesGitContexts, AbacEntityValuesGitopsApplications, AbacEntityValuesHelmCharts, AbacEntityValuesPipelines, AbacEntityValuesProducts, AbacEntityValuesProjects, AbacEntityValuesPromotionFlows, AbacEntityValuesSharedConfiguration, AbacEntityValuesWorkflows, AbacEntityValuesWorkflowTemplates: + return true + } + return false +} + +func (e AbacEntityValues) String() string { + return string(e) +} + +func (e *AbacEntityValues) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacEntityValues(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacEntityValues", str) + } + return nil +} + +func (e AbacEntityValues) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // Access Mode type AccessMode string @@ -11719,6 +11955,50 @@ func (e ProductComponentType) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +// ProductConcurrency +type ProductConcurrency string + +const ( + // Queue + ProductConcurrencyQueue ProductConcurrency = "queue" + // Terminate + ProductConcurrencyTerminate ProductConcurrency = "terminate" +) + +var AllProductConcurrency = []ProductConcurrency{ + ProductConcurrencyQueue, + ProductConcurrencyTerminate, +} + +func (e ProductConcurrency) IsValid() bool { + switch e { + case ProductConcurrencyQueue, ProductConcurrencyTerminate: + return true + } + return false +} + +func (e ProductConcurrency) String() string { + return string(e) +} + +func (e *ProductConcurrency) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = ProductConcurrency(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid ProductConcurrency", str) + } + return nil +} + +func (e ProductConcurrency) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // ProductGitTrigger type ProductGitTrigger string @@ -12972,50 +13252,6 @@ func (e SyncStatus) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } -// Sync success/failure -type SyncSuccess string - -const ( - // FAILURE - when SyncStatus is OUT_OF_SYNC or UNKNOWN - SyncSuccessFailure SyncSuccess = "FAILURE" - // SUCCESS - when SyncStatus is SYNCED - SyncSuccessSuccess SyncSuccess = "SUCCESS" -) - -var AllSyncSuccess = []SyncSuccess{ - SyncSuccessFailure, - SyncSuccessSuccess, -} - -func (e SyncSuccess) IsValid() bool { - switch e { - case SyncSuccessFailure, SyncSuccessSuccess: - return true - } - return false -} - -func (e SyncSuccess) String() string { - return string(e) -} - -func (e *SyncSuccess) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = SyncSuccess(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid SyncSuccess", str) - } - return nil -} - -func (e SyncSuccess) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} - // Types of system type type SystemType string diff --git a/pkg/model/promotion-orchestrator/models_gen.go b/pkg/model/promotion-orchestrator/models_gen.go index dac1def..aadcddc 100644 --- a/pkg/model/promotion-orchestrator/models_gen.go +++ b/pkg/model/promotion-orchestrator/models_gen.go @@ -157,6 +157,40 @@ type WorkflowSpecTemplate interface { IsWorkflowSpecTemplate() } +// AbacAllActionsValidatedEntity +type AbacAllActionsValidatedEntityAction struct { + // Action name + Action AbacActionNames `json:"action"` + // Enabled + Enabled bool `json:"enabled"` +} + +// AbacAllActionsValidationResult +type AbacAllActionsValidationResult struct { + // Entity + Entity string `json:"entity"` + // Validation result + ValidationResult []*AbacAllActionsValidatedEntityAction `json:"validationResult"` +} + +// AbacAttribute +type AbacAttribute struct { + // Name + Name AbacAttributeNames `json:"name"` + // Key + Key *string `json:"key,omitempty"` + // Value + Value string `json:"value"` +} + +// AbacValidationResult +type AbacValidationResult struct { + // Is access validated + IsValid bool `json:"isValid"` + // Validation message + Message *string `json:"message,omitempty"` +} + // Account is logical entity that group together users pipeliens and more type Account struct { // The account id @@ -2995,6 +3029,24 @@ type EditUserToAccountArgs struct { Status string `json:"status"` } +// EntityAbacRules +type EntityAbacRules struct { + // Id + ID *string `json:"id,omitempty"` + // AccountId + AccountID string `json:"accountId"` + // EntityType + EntityType AbacEntityValues `json:"entityType"` + // Teams + Teams []string `json:"teams"` + // Tags + Tags []*string `json:"tags,omitempty"` + // Actions + Actions []AbacActionNames `json:"actions"` + // Attributes + Attributes []*AbacAttribute `json:"attributes"` +} + // Entity Reference Meta type EntityReferenceMeta struct { // GVK/group @@ -9062,6 +9114,208 @@ type WorkflowsStepView struct { Workflows []*ReleaseStepWorkflowInfo `json:"workflows,omitempty"` } +// AbacActionNames +type AbacActionNames string + +const ( + AbacActionNamesAccessArtifacts AbacActionNames = "ACCESS_ARTIFACTS" + AbacActionNamesAccessLogs AbacActionNames = "ACCESS_LOGS" + AbacActionNamesAppRollback AbacActionNames = "APP_ROLLBACK" + AbacActionNamesCreate AbacActionNames = "CREATE" + AbacActionNamesDeleteResource AbacActionNames = "DELETE_RESOURCE" + AbacActionNamesExecToPod AbacActionNames = "EXEC_TO_POD" + AbacActionNamesPromoteTo AbacActionNames = "PROMOTE_TO" + AbacActionNamesRefresh AbacActionNames = "REFRESH" + AbacActionNamesRestart AbacActionNames = "RESTART" + AbacActionNamesResubmit AbacActionNames = "RESUBMIT" + AbacActionNamesRetryRelease AbacActionNames = "RETRY_RELEASE" + AbacActionNamesRolloutAbort AbacActionNames = "ROLLOUT_ABORT" + AbacActionNamesRolloutPause AbacActionNames = "ROLLOUT_PAUSE" + AbacActionNamesRolloutPromoteFull AbacActionNames = "ROLLOUT_PROMOTE_FULL" + AbacActionNamesRolloutResume AbacActionNames = "ROLLOUT_RESUME" + AbacActionNamesRolloutRetry AbacActionNames = "ROLLOUT_RETRY" + AbacActionNamesRolloutSkipCurrentStep AbacActionNames = "ROLLOUT_SKIP_CURRENT_STEP" + AbacActionNamesStop AbacActionNames = "STOP" + AbacActionNamesSync AbacActionNames = "SYNC" + AbacActionNamesTerminate AbacActionNames = "TERMINATE" + AbacActionNamesTerminateSync AbacActionNames = "TERMINATE_SYNC" + AbacActionNamesTriggerPromotion AbacActionNames = "TRIGGER_PROMOTION" + AbacActionNamesViewviewPodLogs AbacActionNames = "VIEWVIEW_POD_LOGS" +) + +var AllAbacActionNames = []AbacActionNames{ + AbacActionNamesAccessArtifacts, + AbacActionNamesAccessLogs, + AbacActionNamesAppRollback, + AbacActionNamesCreate, + AbacActionNamesDeleteResource, + AbacActionNamesExecToPod, + AbacActionNamesPromoteTo, + AbacActionNamesRefresh, + AbacActionNamesRestart, + AbacActionNamesResubmit, + AbacActionNamesRetryRelease, + AbacActionNamesRolloutAbort, + AbacActionNamesRolloutPause, + AbacActionNamesRolloutPromoteFull, + AbacActionNamesRolloutResume, + AbacActionNamesRolloutRetry, + AbacActionNamesRolloutSkipCurrentStep, + AbacActionNamesStop, + AbacActionNamesSync, + AbacActionNamesTerminate, + AbacActionNamesTerminateSync, + AbacActionNamesTriggerPromotion, + AbacActionNamesViewviewPodLogs, +} + +func (e AbacActionNames) IsValid() bool { + switch e { + case AbacActionNamesAccessArtifacts, AbacActionNamesAccessLogs, AbacActionNamesAppRollback, AbacActionNamesCreate, AbacActionNamesDeleteResource, AbacActionNamesExecToPod, AbacActionNamesPromoteTo, AbacActionNamesRefresh, AbacActionNamesRestart, AbacActionNamesResubmit, AbacActionNamesRetryRelease, AbacActionNamesRolloutAbort, AbacActionNamesRolloutPause, AbacActionNamesRolloutPromoteFull, AbacActionNamesRolloutResume, AbacActionNamesRolloutRetry, AbacActionNamesRolloutSkipCurrentStep, AbacActionNamesStop, AbacActionNamesSync, AbacActionNamesTerminate, AbacActionNamesTerminateSync, AbacActionNamesTriggerPromotion, AbacActionNamesViewviewPodLogs: + return true + } + return false +} + +func (e AbacActionNames) String() string { + return string(e) +} + +func (e *AbacActionNames) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacActionNames(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacActionNames", str) + } + return nil +} + +func (e AbacActionNames) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// AbacAttributeNames +type AbacAttributeNames string + +const ( + AbacAttributeNamesCluster AbacAttributeNames = "CLUSTER" + AbacAttributeNamesEnvironmentKind AbacAttributeNames = "ENVIRONMENT_KIND" + AbacAttributeNamesEnvironmentName AbacAttributeNames = "ENVIRONMENT_NAME" + AbacAttributeNamesGitSource AbacAttributeNames = "GIT_SOURCE" + AbacAttributeNamesLabel AbacAttributeNames = "LABEL" + AbacAttributeNamesNamespace AbacAttributeNames = "NAMESPACE" + AbacAttributeNamesProductName AbacAttributeNames = "PRODUCT_NAME" + AbacAttributeNamesRuntime AbacAttributeNames = "RUNTIME" +) + +var AllAbacAttributeNames = []AbacAttributeNames{ + AbacAttributeNamesCluster, + AbacAttributeNamesEnvironmentKind, + AbacAttributeNamesEnvironmentName, + AbacAttributeNamesGitSource, + AbacAttributeNamesLabel, + AbacAttributeNamesNamespace, + AbacAttributeNamesProductName, + AbacAttributeNamesRuntime, +} + +func (e AbacAttributeNames) IsValid() bool { + switch e { + case AbacAttributeNamesCluster, AbacAttributeNamesEnvironmentKind, AbacAttributeNamesEnvironmentName, AbacAttributeNamesGitSource, AbacAttributeNamesLabel, AbacAttributeNamesNamespace, AbacAttributeNamesProductName, AbacAttributeNamesRuntime: + return true + } + return false +} + +func (e AbacAttributeNames) String() string { + return string(e) +} + +func (e *AbacAttributeNames) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacAttributeNames(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacAttributeNames", str) + } + return nil +} + +func (e AbacAttributeNames) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + +// Values from AbacEntityValues enum +type AbacEntityValues string + +const ( + AbacEntityValuesClusters AbacEntityValues = "clusters" + AbacEntityValuesEnvironments AbacEntityValues = "environments" + AbacEntityValuesExecutionContext AbacEntityValues = "executionContext" + AbacEntityValuesGitContexts AbacEntityValues = "gitContexts" + AbacEntityValuesGitopsApplications AbacEntityValues = "gitopsApplications" + AbacEntityValuesHelmCharts AbacEntityValues = "helmCharts" + AbacEntityValuesPipelines AbacEntityValues = "pipelines" + AbacEntityValuesProducts AbacEntityValues = "products" + AbacEntityValuesProjects AbacEntityValues = "projects" + AbacEntityValuesPromotionFlows AbacEntityValues = "promotionFlows" + AbacEntityValuesSharedConfiguration AbacEntityValues = "sharedConfiguration" + AbacEntityValuesWorkflows AbacEntityValues = "workflows" + AbacEntityValuesWorkflowTemplates AbacEntityValues = "workflowTemplates" +) + +var AllAbacEntityValues = []AbacEntityValues{ + AbacEntityValuesClusters, + AbacEntityValuesEnvironments, + AbacEntityValuesExecutionContext, + AbacEntityValuesGitContexts, + AbacEntityValuesGitopsApplications, + AbacEntityValuesHelmCharts, + AbacEntityValuesPipelines, + AbacEntityValuesProducts, + AbacEntityValuesProjects, + AbacEntityValuesPromotionFlows, + AbacEntityValuesSharedConfiguration, + AbacEntityValuesWorkflows, + AbacEntityValuesWorkflowTemplates, +} + +func (e AbacEntityValues) IsValid() bool { + switch e { + case AbacEntityValuesClusters, AbacEntityValuesEnvironments, AbacEntityValuesExecutionContext, AbacEntityValuesGitContexts, AbacEntityValuesGitopsApplications, AbacEntityValuesHelmCharts, AbacEntityValuesPipelines, AbacEntityValuesProducts, AbacEntityValuesProjects, AbacEntityValuesPromotionFlows, AbacEntityValuesSharedConfiguration, AbacEntityValuesWorkflows, AbacEntityValuesWorkflowTemplates: + return true + } + return false +} + +func (e AbacEntityValues) String() string { + return string(e) +} + +func (e *AbacEntityValues) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AbacEntityValues(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AbacEntityValues", str) + } + return nil +} + +func (e AbacEntityValues) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + // Access Mode type AccessMode string From 5ff996c9293b42315bbbbd61ac16f836c3faddf8 Mon Sep 17 00:00:00 2001 From: scme0 <scott.merchant@octopus.com> Date: Mon, 10 Feb 2025 13:08:56 +0100 Subject: [PATCH 3/4] update unmarshal.go --- pkg/model/platform/unmarshal.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/model/platform/unmarshal.go b/pkg/model/platform/unmarshal.go index 6795b4b..39f65c8 100644 --- a/pkg/model/platform/unmarshal.go +++ b/pkg/model/platform/unmarshal.go @@ -22,8 +22,6 @@ type ApplicationJSON struct { References []BaseEntity `json:"references"` // Relations between parents and child applications in tree AppsRelations *AppsRelations `json:"appsRelations"` - // History of the application - History *GitOpsSlice `json:"history"` // Version of the entity (generation) Version *int `json:"version"` // Is this the latest version of this entity @@ -76,7 +74,6 @@ func (a *Application) UnmarshalJSON(data []byte) error { a.ReferencedBy = aj.ReferencedBy a.References = aj.References a.AppsRelations = aj.AppsRelations - a.History = aj.History a.Version = aj.Version a.Latest = aj.Latest a.Source = aj.Source From 3df99d3e7e783969d5341d030aa4130020e3bbec Mon Sep 17 00:00:00 2001 From: scme0 <scott.merchant@octopus.com> Date: Mon, 10 Feb 2025 13:58:13 +0100 Subject: [PATCH 4/4] bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34097cf..41af827 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v1.4.7 +VERSION=v1.4.8 ifndef GOBIN ifndef GOPATH