From fc9efa6302395fcfea17d17518ac073dcbd4c8f7 Mon Sep 17 00:00:00 2001 From: Sebastian Florek Date: Wed, 19 Jun 2024 12:47:01 +0200 Subject: [PATCH] add stack run list query --- client.go | 448 ++++++++++++++++++++++++++++++++++++++++++ graph/stack.graphql | 15 ++ models_gen.go | 101 +++++++++- schema/schema.graphql | 105 +++++++++- 4 files changed, 658 insertions(+), 11 deletions(-) diff --git a/client.go b/client.go index 2d0e2cb..387ec03 100644 --- a/client.go +++ b/client.go @@ -137,6 +137,7 @@ type ConsoleClient interface { CreateCustomStackRun(ctx context.Context, attributes CustomStackRunAttributes, interceptors ...clientv2.RequestInterceptor) (*CreateCustomStackRun, error) DeleteCustomStackRun(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*DeleteCustomStackRun, error) GetCustomStackRun(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*GetCustomStackRun, error) + ListStackRuns(ctx context.Context, id string, after *string, before *string, first *int64, last *int64, interceptors ...clientv2.RequestInterceptor) (*ListStackRuns, error) ListAccessTokens(ctx context.Context, cursor *string, before *string, last *int64, interceptors ...clientv2.RequestInterceptor) (*ListAccessTokens, error) GetAccessToken(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*GetAccessToken, error) TokenExchange(ctx context.Context, token string, interceptors ...clientv2.RequestInterceptor) (*TokenExchange, error) @@ -10547,6 +10548,172 @@ func (t *GetCustomStackRun_CustomStackRun_CustomStackRunFragment_Stack) GetID() return t.ID } +type ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform struct { + Address *string "json:\"address,omitempty\" graphql:\"address\"" + Lock *string "json:\"lock,omitempty\" graphql:\"lock\"" + Unlock *string "json:\"unlock,omitempty\" graphql:\"unlock\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform) GetAddress() *string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform{} + } + return t.Address +} +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform) GetLock() *string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform{} + } + return t.Lock +} +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform) GetUnlock() *string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform{} + } + return t.Unlock +} + +type ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls struct { + Terraform *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform "json:\"terraform,omitempty\" graphql:\"terraform\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls) GetTerraform() *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls_Terraform { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_StateUrls{} + } + return t.Terraform +} + +type ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_PluralCreds struct { + URL *string "json:\"url,omitempty\" graphql:\"url\"" + Token *string "json:\"token,omitempty\" graphql:\"token\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_PluralCreds) GetURL() *string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_PluralCreds{} + } + return t.URL +} +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_PluralCreds) GetToken() *string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_PluralCreds{} + } + return t.Token +} + +type ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env struct { + Name string "json:\"name\" graphql:\"name\"" + Value string "json:\"value\" graphql:\"value\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env) GetName() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env{} + } + return t.Name +} +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env) GetValue() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env{} + } + return t.Value +} + +type ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom struct { + ConfigMap string "json:\"configMap\" graphql:\"configMap\"" + Secret string "json:\"secret\" graphql:\"secret\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom) GetConfigMap() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom{} + } + return t.ConfigMap +} +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom) GetSecret() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_Stack_InfrastructureStackFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom{} + } + return t.Secret +} + +type ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env struct { + Name string "json:\"name\" graphql:\"name\"" + Value string "json:\"value\" graphql:\"value\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env) GetName() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env{} + } + return t.Name +} +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env) GetValue() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_Env{} + } + return t.Value +} + +type ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom struct { + ConfigMap string "json:\"configMap\" graphql:\"configMap\"" + Secret string "json:\"secret\" graphql:\"secret\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom) GetConfigMap() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom{} + } + return t.ConfigMap +} +func (t *ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom) GetSecret() string { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges_Node_StackRunFragment_StackRunBaseFragment_JobSpec_JobSpecFragment_Containers_ContainerSpecFragment_EnvFrom{} + } + return t.Secret +} + +type ListStackRuns_InfrastructureStack_Runs_Edges struct { + Node *StackRunFragment "json:\"node,omitempty\" graphql:\"node\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs_Edges) GetNode() *StackRunFragment { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs_Edges{} + } + return t.Node +} + +type ListStackRuns_InfrastructureStack_Runs struct { + PageInfo *PageInfoFragment "json:\"pageInfo\" graphql:\"pageInfo\"" + Edges []*ListStackRuns_InfrastructureStack_Runs_Edges "json:\"edges,omitempty\" graphql:\"edges\"" +} + +func (t *ListStackRuns_InfrastructureStack_Runs) GetPageInfo() *PageInfoFragment { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs{} + } + return t.PageInfo +} +func (t *ListStackRuns_InfrastructureStack_Runs) GetEdges() []*ListStackRuns_InfrastructureStack_Runs_Edges { + if t == nil { + t = &ListStackRuns_InfrastructureStack_Runs{} + } + return t.Edges +} + +type ListStackRuns_InfrastructureStack struct { + Runs *ListStackRuns_InfrastructureStack_Runs "json:\"runs,omitempty\" graphql:\"runs\"" +} + +func (t *ListStackRuns_InfrastructureStack) GetRuns() *ListStackRuns_InfrastructureStack_Runs { + if t == nil { + t = &ListStackRuns_InfrastructureStack{} + } + return t.Runs +} + type ListAccessTokens_AccessTokens_Edges struct { Node *AccessTokenFragment "json:\"node,omitempty\" graphql:\"node\"" } @@ -12085,6 +12252,17 @@ func (t *GetCustomStackRun) GetCustomStackRun() *CustomStackRunFragment { return t.CustomStackRun } +type ListStackRuns struct { + InfrastructureStack *ListStackRuns_InfrastructureStack "json:\"infrastructureStack,omitempty\" graphql:\"infrastructureStack\"" +} + +func (t *ListStackRuns) GetInfrastructureStack() *ListStackRuns_InfrastructureStack { + if t == nil { + t = &ListStackRuns{} + } + return t.InfrastructureStack +} + type ListAccessTokens struct { AccessTokens *ListAccessTokens_AccessTokens "json:\"accessTokens,omitempty\" graphql:\"accessTokens\"" } @@ -23351,6 +23529,275 @@ func (c *Client) GetCustomStackRun(ctx context.Context, id string, interceptors return &res, nil } +const ListStackRunsDocument = `query ListStackRuns ($id: ID!, $after: String, $before: String, $first: Int, $last: Int) { + infrastructureStack(id: $id) { + runs(after: $after, before: $before, first: $first, last: $last) { + pageInfo { + ... PageInfoFragment + } + edges { + node { + ... StackRunFragment + } + } + } + } +} +fragment PageInfoFragment on PageInfo { + hasNextPage + endCursor +} +fragment StackRunFragment on StackRun { + ... StackRunBaseFragment + approver { + ... UserFragment + } +} +fragment StackRunBaseFragment on StackRun { + id + type + status + approval + approvedAt + tarball + workdir + manageState + stateUrls { + terraform { + address + lock + unlock + } + } + pluralCreds { + url + token + } + actor { + ... UserFragment + } + stack { + ... InfrastructureStackFragment + } + state { + ... StackStateFragment + } + steps { + ... RunStepFragment + } + files { + ... StackFileFragment + } + git { + ... GitRefFragment + } + repository { + ... GitRepositoryFragment + } + jobSpec { + ... JobSpecFragment + } + configuration { + ... StackConfigurationFragment + } + environment { + ... StackEnvironmentFragment + } + output { + ... StackOutputFragment + } + errors { + ... ServiceErrorFragment + } +} +fragment UserFragment on User { + name + id + email +} +fragment InfrastructureStackFragment on InfrastructureStack { + id + name + type + git { + ... GitRefFragment + } + jobSpec { + ... JobSpecFragment + } + configuration { + ... StackConfigurationFragment + } + cluster { + ... TinyClusterFragment + } + project { + ... TinyProjectFragment + } + approval + workdir + manageState + deletedAt + files { + ... StackFileFragment + } + environment { + ... StackEnvironmentFragment + } + output { + ... StackOutputFragment + } + state { + ... StackStateFragment + } + repository { + ... GitRepositoryFragment + } + writeBindings { + ... PolicyBindingFragment + } + readBindings { + ... PolicyBindingFragment + } +} +fragment GitRefFragment on GitRef { + folder + ref +} +fragment JobSpecFragment on JobGateSpec { + namespace + raw + containers { + ... ContainerSpecFragment + } + labels + annotations + serviceAccount +} +fragment ContainerSpecFragment on ContainerSpec { + image + args + env { + name + value + } + envFrom { + configMap + secret + } +} +fragment StackConfigurationFragment on StackConfiguration { + image + version + hooks { + ... StackHookFragment + } +} +fragment StackHookFragment on StackHook { + cmd + args + afterStage +} +fragment TinyClusterFragment on Cluster { + id + name + handle + self + project { + ... TinyProjectFragment + } +} +fragment TinyProjectFragment on Project { + id + name + default +} +fragment StackFileFragment on StackFile { + path + content +} +fragment StackEnvironmentFragment on StackEnvironment { + name + value + secret +} +fragment StackOutputFragment on StackOutput { + name + value + secret +} +fragment StackStateFragment on StackState { + id + plan + state { + ... StackStateResourceFragment + } +} +fragment StackStateResourceFragment on StackStateResource { + identifier + resource + name + configuration + links +} +fragment GitRepositoryFragment on GitRepository { + id + error + health + authMethod + url + decrypt +} +fragment PolicyBindingFragment on PolicyBinding { + id + group { + ... GroupFragment + } + user { + ... UserFragment + } +} +fragment GroupFragment on Group { + id + name + description +} +fragment RunStepFragment on RunStep { + id + status + name + cmd + args + index + stage +} +fragment ServiceErrorFragment on ServiceError { + source + message +} +` + +func (c *Client) ListStackRuns(ctx context.Context, id string, after *string, before *string, first *int64, last *int64, interceptors ...clientv2.RequestInterceptor) (*ListStackRuns, error) { + vars := map[string]interface{}{ + "id": id, + "after": after, + "before": before, + "first": first, + "last": last, + } + + var res ListStackRuns + if err := c.Client.Post(ctx, "ListStackRuns", ListStackRunsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + + return nil, err + } + + return &res, nil +} + const ListAccessTokensDocument = `query ListAccessTokens ($cursor: String, $before: String, $last: Int) { accessTokens(after: $cursor, first: 100, before: $before, last: $last) { edges { @@ -23758,6 +24205,7 @@ var DocumentOperationNames = map[string]string{ CreateCustomStackRunDocument: "CreateCustomStackRun", DeleteCustomStackRunDocument: "DeleteCustomStackRun", GetCustomStackRunDocument: "GetCustomStackRun", + ListStackRunsDocument: "ListStackRuns", ListAccessTokensDocument: "ListAccessTokens", GetAccessTokenDocument: "GetAccessToken", TokenExchangeDocument: "TokenExchange", diff --git a/graph/stack.graphql b/graph/stack.graphql index 01e8628..806c94e 100644 --- a/graph/stack.graphql +++ b/graph/stack.graphql @@ -273,3 +273,18 @@ query GetCustomStackRun($id: ID!) { ...CustomStackRunFragment } } + +query ListStackRuns($id: ID!, $after: String, $before: String, $first: Int, $last: Int) { + infrastructureStack(id: $id) { + runs(after: $after, before: $before, first: $first, last: $last) { + pageInfo { + ...PageInfoFragment + } + edges { + node { + ...StackRunFragment + } + } + } + } +} diff --git a/models_gen.go b/models_gen.go index 21b52c4..715a42d 100644 --- a/models_gen.go +++ b/models_gen.go @@ -187,6 +187,67 @@ type ApplicationStatus struct { ComponentsReady string `json:"componentsReady"` } +type ArgoAnalysis struct { + Templates []*ArgoAnalysisTemplate `json:"templates,omitempty"` +} + +type ArgoAnalysisTemplate struct { + TemplateName *string `json:"templateName,omitempty"` +} + +type ArgoBlueGreenStrategy struct { + ActiveService *string `json:"activeService,omitempty"` + AutoPromotionEnabled *bool `json:"autoPromotionEnabled,omitempty"` + AutoPromotionSeconds *int64 `json:"autoPromotionSeconds,omitempty"` +} + +type ArgoCanaryStrategy struct { + Steps []*ArgoStrategyStep `json:"steps,omitempty"` +} + +type ArgoExperiment struct { + Templates []*ArgoExperimentTemplate `json:"templates,omitempty"` +} + +type ArgoExperimentTemplate struct { + Name *string `json:"name,omitempty"` +} + +type ArgoRollout struct { + Metadata Metadata `json:"metadata"` + Status ArgoRolloutStatus `json:"status"` + Spec ArgoRolloutSpec `json:"spec"` + Pods []*Pod `json:"pods,omitempty"` + Raw string `json:"raw"` + Events []*Event `json:"events,omitempty"` +} + +type ArgoRolloutSpec struct { + Replicas *int64 `json:"replicas,omitempty"` + Strategy *ArgoRolloutStrategy `json:"strategy,omitempty"` +} + +type ArgoRolloutStatus struct { + Abort *bool `json:"abort,omitempty"` + Phase *string `json:"phase,omitempty"` + Replicas *int64 `json:"replicas,omitempty"` + ReadyReplicas *int64 `json:"readyReplicas,omitempty"` + PauseConditions []*PauseCondition `json:"pauseConditions,omitempty"` + Conditions []*StatusCondition `json:"conditions,omitempty"` +} + +type ArgoRolloutStrategy struct { + BlueGreen *ArgoBlueGreenStrategy `json:"blueGreen,omitempty"` + Canary *ArgoCanaryStrategy `json:"canary,omitempty"` +} + +type ArgoStrategyStep struct { + StepWeight *int64 `json:"stepWeight,omitempty"` + Pause *CanaryPause `json:"pause,omitempty"` + Experiment *ArgoExperiment `json:"experiment,omitempty"` + Analysis *ArgoAnalysis `json:"analysis,omitempty"` +} + type Audit struct { ID string `json:"id"` Action AuditAction `json:"action"` @@ -370,6 +431,10 @@ type CanaryAnalysis struct { Threshold *int64 `json:"threshold,omitempty"` } +type CanaryPause struct { + Duration *string `json:"duration,omitempty"` +} + type CanarySpec struct { AutoscalerRef *TargetRef `json:"autoscalerRef,omitempty"` TargetRef *TargetRef `json:"targetRef,omitempty"` @@ -1379,6 +1444,8 @@ type GitAttributes struct { HTTPSPath *string `json:"httpsPath,omitempty"` // similar to https_path, a manually supplied url format for custom git. Should be something like {url}/tree/{ref}/{folder} URLFormat *string `json:"urlFormat,omitempty"` + // id of a scm connection to use for authentication + ConnectionID *string `json:"connectionId,omitempty"` // whether to run plural crypto on this repo Decrypt *bool `json:"decrypt,omitempty"` } @@ -1448,6 +1515,16 @@ type GitStatus struct { Output *string `json:"output,omitempty"` } +// Requirements to perform Github App authentication +type GithubAppAttributes struct { + // Github App ID + AppID string `json:"appId"` + // ID of this github app installation + InstallationID string `json:"installationId"` + // PEM-encoded private key for this app + PrivateKey string `json:"privateKey"` +} + // a rules based mechanism to redeploy a service across a fleet of clusters type GlobalService struct { // internal id of this global service @@ -1669,6 +1746,8 @@ type InfrastructureStack struct { Git GitRef `json:"git"` // whether the stack is actively tracking changes in git Paused *bool `json:"paused,omitempty"` + // The status of the last run of the stack + Status StackStatus `json:"status"` // optional k8s job configuration for the job that will apply this stack JobSpec *JobGateSpec `json:"jobSpec,omitempty"` // version/image config for the tool you're using @@ -2350,6 +2429,11 @@ type PathUpdate struct { ValueFrom string `json:"valueFrom"` } +type PauseCondition struct { + Reason *string `json:"reason,omitempty"` + StartTime *string `json:"startTime,omitempty"` +} + type Persona struct { ID string `json:"id"` // the name for this persona @@ -2984,6 +3068,7 @@ type PrConfiguration struct { Longform *string `json:"longform,omitempty"` Placeholder *string `json:"placeholder,omitempty"` Optional *bool `json:"optional,omitempty"` + Values []*string `json:"values,omitempty"` Condition *PrConfigurationCondition `json:"condition,omitempty"` } @@ -2997,6 +3082,7 @@ type PrConfigurationAttributes struct { Placeholder *string `json:"placeholder,omitempty"` Optional *bool `json:"optional,omitempty"` Condition *ConditionAttributes `json:"condition,omitempty"` + Values []*string `json:"values,omitempty"` } // declaritive spec for whether a config item is relevant given prior config @@ -3609,11 +3695,12 @@ type ScmConnectionAttributes struct { Name string `json:"name"` Type ScmType `json:"type"` // the owning entity in this scm provider, eg a github organization - Owner *string `json:"owner,omitempty"` - Username *string `json:"username,omitempty"` - Token *string `json:"token,omitempty"` - BaseURL *string `json:"baseUrl,omitempty"` - APIURL *string `json:"apiUrl,omitempty"` + Owner *string `json:"owner,omitempty"` + Username *string `json:"username,omitempty"` + Token *string `json:"token,omitempty"` + BaseURL *string `json:"baseUrl,omitempty"` + APIURL *string `json:"apiUrl,omitempty"` + Github *GithubAppAttributes `json:"github,omitempty"` // a ssh private key to be used for commit signing SigningPrivateKey *string `json:"signingPrivateKey,omitempty"` } @@ -5001,6 +5088,7 @@ const ( ConfigurationTypeFile ConfigurationType = "FILE" ConfigurationTypeFunction ConfigurationType = "FUNCTION" ConfigurationTypePassword ConfigurationType = "PASSWORD" + ConfigurationTypeEnum ConfigurationType = "ENUM" ) var AllConfigurationType = []ConfigurationType{ @@ -5012,11 +5100,12 @@ var AllConfigurationType = []ConfigurationType{ ConfigurationTypeFile, ConfigurationTypeFunction, ConfigurationTypePassword, + ConfigurationTypeEnum, } func (e ConfigurationType) IsValid() bool { switch e { - case ConfigurationTypeString, ConfigurationTypeInt, ConfigurationTypeBool, ConfigurationTypeDomain, ConfigurationTypeBucket, ConfigurationTypeFile, ConfigurationTypeFunction, ConfigurationTypePassword: + case ConfigurationTypeString, ConfigurationTypeInt, ConfigurationTypeBool, ConfigurationTypeDomain, ConfigurationTypeBucket, ConfigurationTypeFile, ConfigurationTypeFunction, ConfigurationTypePassword, ConfigurationTypeEnum: return true } return false diff --git a/schema/schema.graphql b/schema/schema.graphql index d72122f..d59b38f 100644 --- a/schema/schema.graphql +++ b/schema/schema.graphql @@ -123,6 +123,8 @@ type RootQueryType { canary(namespace: String!, name: String!, serviceId: ID): Canary + argoRollout(namespace: String!, name: String!, serviceId: ID): ArgoRollout + upgradePlan(namespace: String!, name: String!, serviceId: ID): UpgradePlan configurationOverlays(namespace: String!): [ConfigurationOverlay] @@ -202,10 +204,10 @@ type RootQueryType { ): ClusterConnection "gets summary information for all healthy\/unhealthy clusters in your fleet" - clusterStatuses(q: String, tag: TagInput): [ClusterStatusInfo] + clusterStatuses(q: String, tag: TagInput, projectId: ID): [ClusterStatusInfo] "gets summary information for upgradeability in your fleet" - upgradeStatistics(q: String, tag: TagInput): UpgradeStatistics + upgradeStatistics(q: String, tag: TagInput, projectId: ID): UpgradeStatistics "lists tags applied to any clusters in the fleet" tags(tag: String): [String] @@ -266,7 +268,7 @@ type RootQueryType { cluster: String ): ServiceDeploymentConnection - serviceStatuses(clusterId: ID, q: String, status: ServiceDeploymentStatus): [ServiceStatusCount] + serviceStatuses(clusterId: ID, q: String, status: ServiceDeploymentStatus, projectId: ID): [ServiceStatusCount] serviceContext(name: String!): ServiceContext @@ -344,11 +346,11 @@ type RootQueryType { policyConstraint(id: ID!): PolicyConstraint - managedNamespaces(after: String, first: Int, before: String, last: Int): ManagedNamespaceConnection + managedNamespaces(after: String, first: Int, before: String, last: Int, projectId: ID): ManagedNamespaceConnection globalService(id: ID!): GlobalService - globalServices(after: String, first: Int, before: String, last: Int): GlobalServiceConnection + globalServices(after: String, first: Int, before: String, last: Int, projectId: ID): GlobalServiceConnection clusterManagedNamespaces(after: String, first: Int, before: String, last: Int): ManagedNamespaceConnection @@ -1216,6 +1218,9 @@ type InfrastructureStack { "whether the stack is actively tracking changes in git" paused: Boolean + "The status of the last run of the stack" + status: StackStatus! + "optional k8s job configuration for the job that will apply this stack" jobSpec: JobGateSpec @@ -3941,6 +3946,7 @@ enum ConfigurationType { FILE FUNCTION PASSWORD + ENUM } enum Operation { @@ -3976,6 +3982,9 @@ input GitAttributes { "similar to https_path, a manually supplied url format for custom git. Should be something like {url}\/tree\/{ref}\/{folder}" urlFormat: String + "id of a scm connection to use for authentication" + connectionId: ID + "whether to run plural crypto on this repo" decrypt: Boolean } @@ -3997,10 +4006,24 @@ input ScmConnectionAttributes { apiUrl: String + github: GithubAppAttributes + "a ssh private key to be used for commit signing" signingPrivateKey: String } +"Requirements to perform Github App authentication" +input GithubAppAttributes { + "Github App ID" + appId: String! + + "ID of this github app installation" + installationId: String! + + "PEM-encoded private key for this app" + privateKey: String! +} + "A way to create a self-service means of generating PRs against an IaC repo" input PrAutomationAttributes { name: String @@ -4056,6 +4079,7 @@ input PrConfigurationAttributes { placeholder: String optional: Boolean condition: ConditionAttributes + values: [String] } "attributes for declaratively specifying whether a config item is relevant given prior config" @@ -4357,6 +4381,7 @@ type PrConfiguration { longform: String placeholder: String optional: Boolean + values: [String] condition: PrConfigurationCondition } @@ -5005,6 +5030,76 @@ type UpgradePlanSpec { concurrency: Int } +type ArgoRollout { + metadata: Metadata! + status: ArgoRolloutStatus! + spec: ArgoRolloutSpec! + pods: [Pod] + raw: String! + events: [Event] +} + +type ArgoRolloutSpec { + replicas: Int + strategy: ArgoRolloutStrategy +} + +type ArgoRolloutStrategy { + blueGreen: ArgoBlueGreenStrategy + canary: ArgoCanaryStrategy +} + +type ArgoBlueGreenStrategy { + activeService: String + autoPromotionEnabled: Boolean + autoPromotionSeconds: Int +} + +type ArgoCanaryStrategy { + steps: [ArgoStrategyStep] +} + +type ArgoStrategyStep { + stepWeight: Int + pause: CanaryPause + experiment: ArgoExperiment + analysis: ArgoAnalysis +} + +type ArgoExperiment { + templates: [ArgoExperimentTemplate] +} + +type ArgoAnalysis { + templates: [ArgoAnalysisTemplate] +} + +type ArgoExperimentTemplate { + name: String +} + +type ArgoAnalysisTemplate { + templateName: String +} + +type CanaryPause { + duration: String +} + +type PauseCondition { + reason: String + startTime: String +} + +type ArgoRolloutStatus { + abort: Boolean + phase: String + replicas: Int + readyReplicas: Int + pauseConditions: [PauseCondition] + conditions: [StatusCondition] +} + type Canary { metadata: Metadata! status: CanaryStatus!