Skip to content

Commit

Permalink
Add chartVersion to graphql schema for compatibilities (#1153)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored Jul 8, 2024
1 parent 50ff4a2 commit 483ffda
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/src/components/cd/clusters/runtime/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const colName = columnHelperRuntime.accessor((row) => row?.addon, {
},
})
const colChartVersion = columnHelperRuntime.accessor(
(row) => row?.service?.helm?.version,
(row) => row?.addonVersion?.chartVersion,
{
id: 'chartVersion',
header: 'Chart version',
Expand Down
11 changes: 7 additions & 4 deletions assets/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export type AddonVersion = {
__typename?: 'AddonVersion';
/** checks if this is blocking a specific kubernetes upgrade */
blocking?: Maybe<Scalars['Boolean']['output']>;
/** the version of the helm chart to install for this version */
chartVersion?: Maybe<Scalars['String']['output']>;
/** any add-ons this might break */
incompatibilities?: Maybe<Array<Maybe<VersionReference>>>;
/** kubernetes versions this add-on works with */
Expand Down Expand Up @@ -8052,9 +8054,9 @@ export type NodePoolFragment = { __typename?: 'NodePool', id: string, name: stri

export type ApiDeprecationFragment = { __typename?: 'ApiDeprecation', availableIn?: string | null, blocking?: boolean | null, deprecatedIn?: string | null, removedIn?: string | null, replacement?: string | null, component?: { __typename?: 'ServiceComponent', group?: string | null, version?: string | null, kind: string, name: string, namespace?: string | null, service?: { __typename?: 'ServiceDeployment', git?: { __typename?: 'GitRef', ref: string, folder: string } | null, repository?: { __typename?: 'GitRepository', httpsPath?: string | null, urlFormat?: string | null } | null } | null } | null };

export type RuntimeServiceFragment = { __typename?: 'RuntimeService', id: string, name: string, version: string, addon?: { __typename?: 'RuntimeAddon', icon?: string | null, versions?: Array<{ __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null> | null } | null, service?: { __typename?: 'ServiceDeployment', git?: { __typename?: 'GitRef', ref: string, folder: string } | null, repository?: { __typename?: 'GitRepository', httpsPath?: string | null, urlFormat?: string | null } | null, helm?: { __typename?: 'HelmSpec', version?: string | null } | null } | null, addonVersion?: { __typename?: 'AddonVersion', blocking?: boolean | null, version?: string | null, kube?: Array<string | null> | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null };
export type RuntimeServiceFragment = { __typename?: 'RuntimeService', id: string, name: string, version: string, addon?: { __typename?: 'RuntimeAddon', icon?: string | null, versions?: Array<{ __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, chartVersion?: string | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null> | null } | null, service?: { __typename?: 'ServiceDeployment', git?: { __typename?: 'GitRef', ref: string, folder: string } | null, repository?: { __typename?: 'GitRepository', httpsPath?: string | null, urlFormat?: string | null } | null, helm?: { __typename?: 'HelmSpec', version?: string | null } | null } | null, addonVersion?: { __typename?: 'AddonVersion', blocking?: boolean | null, version?: string | null, kube?: Array<string | null> | null, chartVersion?: string | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null };

export type AddonVersionFragment = { __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null };
export type AddonVersionFragment = { __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, chartVersion?: string | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null };

export type AddonVersionBlockingFragment = { __typename?: 'AddonVersion', blocking?: boolean | null };

Expand Down Expand Up @@ -8143,15 +8145,15 @@ export type RuntimeServicesQueryVariables = Exact<{
}>;


export type RuntimeServicesQuery = { __typename?: 'RootQueryType', cluster?: { __typename?: 'Cluster', id: string, name: string, currentVersion?: string | null, version?: string | null, runtimeServices?: Array<{ __typename?: 'RuntimeService', id: string, name: string, version: string, addon?: { __typename?: 'RuntimeAddon', icon?: string | null, versions?: Array<{ __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null> | null } | null, service?: { __typename?: 'ServiceDeployment', git?: { __typename?: 'GitRef', ref: string, folder: string } | null, repository?: { __typename?: 'GitRepository', httpsPath?: string | null, urlFormat?: string | null } | null, helm?: { __typename?: 'HelmSpec', version?: string | null } | null } | null, addonVersion?: { __typename?: 'AddonVersion', blocking?: boolean | null, version?: string | null, kube?: Array<string | null> | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null } | null> | null, apiDeprecations?: Array<{ __typename?: 'ApiDeprecation', availableIn?: string | null, blocking?: boolean | null, deprecatedIn?: string | null, removedIn?: string | null, replacement?: string | null, component?: { __typename?: 'ServiceComponent', group?: string | null, version?: string | null, kind: string, name: string, namespace?: string | null, service?: { __typename?: 'ServiceDeployment', git?: { __typename?: 'GitRef', ref: string, folder: string } | null, repository?: { __typename?: 'GitRepository', httpsPath?: string | null, urlFormat?: string | null } | null } | null } | null } | null> | null } | null };
export type RuntimeServicesQuery = { __typename?: 'RootQueryType', cluster?: { __typename?: 'Cluster', id: string, name: string, currentVersion?: string | null, version?: string | null, runtimeServices?: Array<{ __typename?: 'RuntimeService', id: string, name: string, version: string, addon?: { __typename?: 'RuntimeAddon', icon?: string | null, versions?: Array<{ __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, chartVersion?: string | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null> | null } | null, service?: { __typename?: 'ServiceDeployment', git?: { __typename?: 'GitRef', ref: string, folder: string } | null, repository?: { __typename?: 'GitRepository', httpsPath?: string | null, urlFormat?: string | null } | null, helm?: { __typename?: 'HelmSpec', version?: string | null } | null } | null, addonVersion?: { __typename?: 'AddonVersion', blocking?: boolean | null, version?: string | null, kube?: Array<string | null> | null, chartVersion?: string | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null } | null> | null, apiDeprecations?: Array<{ __typename?: 'ApiDeprecation', availableIn?: string | null, blocking?: boolean | null, deprecatedIn?: string | null, removedIn?: string | null, replacement?: string | null, component?: { __typename?: 'ServiceComponent', group?: string | null, version?: string | null, kind: string, name: string, namespace?: string | null, service?: { __typename?: 'ServiceDeployment', git?: { __typename?: 'GitRef', ref: string, folder: string } | null, repository?: { __typename?: 'GitRepository', httpsPath?: string | null, urlFormat?: string | null } | null } | null } | null } | null> | null } | null };

export type RuntimeServiceQueryVariables = Exact<{
id: Scalars['ID']['input'];
version: Scalars['String']['input'];
}>;


export type RuntimeServiceQuery = { __typename?: 'RootQueryType', runtimeService?: { __typename?: 'RuntimeService', id: string, addon?: { __typename?: 'RuntimeAddon', icon?: string | null, releaseUrl?: string | null, readme?: string | null, versions?: Array<{ __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null> | null } | null } | null };
export type RuntimeServiceQuery = { __typename?: 'RootQueryType', runtimeService?: { __typename?: 'RuntimeService', id: string, addon?: { __typename?: 'RuntimeAddon', icon?: string | null, releaseUrl?: string | null, readme?: string | null, versions?: Array<{ __typename?: 'AddonVersion', version?: string | null, kube?: Array<string | null> | null, chartVersion?: string | null, incompatibilities?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null, requirements?: Array<{ __typename?: 'VersionReference', version: string, name: string } | null> | null } | null> | null } | null } | null };

export type UpdateClusterBindingsMutationVariables = Exact<{
id: Scalars['ID']['input'];
Expand Down Expand Up @@ -9909,6 +9911,7 @@ export const AddonVersionFragmentDoc = gql`
fragment AddonVersion on AddonVersion {
version
kube
chartVersion
incompatibilities {
version
name
Expand Down
1 change: 1 addition & 0 deletions assets/src/graph/cdClusters.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fragment RuntimeService on RuntimeService {
fragment AddonVersion on AddonVersion {
version
kube
chartVersion
incompatibilities {
version
name
Expand Down
2 changes: 1 addition & 1 deletion lib/console/deployments/compatibilities/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Console.Deployments.Compatibilities.Version do

@type t :: %__MODULE__{requirements: [%Reference{}], incompatibilities: [%Reference{}]}

defstruct [:version, :kube, :requirements, :incompatibilities]
defstruct [:version, :kube, :chart_version, :requirements, :incompatibilities]

def blocking?(%__MODULE__{kube: kube_vsns}, kube_version, inc \\ 1) do
with {:ok, %{major: maj, minor: min}} <- Version.parse(clean_version(kube_version)) do
Expand Down
1 change: 1 addition & 0 deletions lib/console/graphql/deployments/cluster.ex
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ defmodule Console.GraphQl.Deployments.Cluster do
field :kube, list_of(:string), description: "kubernetes versions this add-on works with"
field :requirements, list_of(:version_reference), description: "any other add-ons this might require"
field :incompatibilities, list_of(:version_reference), description: "any add-ons this might break"
field :chart_version, :string, description: "the version of the helm chart to install for this version"

@desc "the release page for a runtime service at a version, this is a heavy operation not suitable for lists"
field :release_url, :string do
Expand Down
3 changes: 3 additions & 0 deletions schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3945,6 +3945,9 @@ type AddonVersion {
"any add-ons this might break"
incompatibilities: [VersionReference]

"the version of the helm chart to install for this version"
chartVersion: String

"the release page for a runtime service at a version, this is a heavy operation not suitable for lists"
releaseUrl(version: String!): String

Expand Down

0 comments on commit 483ffda

Please sign in to comment.