From 2ade9f8cbd5e22ab9197b3805c2b74720cf64bc1 Mon Sep 17 00:00:00 2001 From: Youssef Bel Mekki <38552193+ybelMekk@users.noreply.github.com> Date: Thu, 19 Nov 2026 14:33:32 +0100 Subject: [PATCH 1/4] refactor: remove vulnerability history and MTTF --- src/lib/chart/MeanTimeToFixChart.svelte | 133 --------------- src/lib/chart/VulnerabilityChart.svelte | 157 ------------------ .../TeamMeanTimeToFixHistoryGraph.svelte | 134 --------------- .../TeamVulnerabilityHistoryGraph.svelte | 141 ---------------- .../WorkloadVulnerabilitiesPage.svelte | 10 -- .../WorkloadVulnerabilitiesPage.test.ts | 2 +- .../WorkloadVulnerabilityHistoryGraph.svelte | 104 ------------ src/lib/domain/vulnerability/dateUtils.ts | 20 +-- src/lib/utils/vulnerabilities.test.ts | 41 +---- src/lib/utils/vulnerabilities.ts | 12 -- .../team/[team]/vulnerabilities/+page.svelte | 10 -- .../vulnerabilities/(single)/+page.svelte | 3 - .../VulnerabilityHistory.svelte | 102 ------------ 13 files changed, 3 insertions(+), 866 deletions(-) delete mode 100644 src/lib/chart/MeanTimeToFixChart.svelte delete mode 100644 src/lib/chart/VulnerabilityChart.svelte delete mode 100644 src/lib/domain/vulnerability/TeamMeanTimeToFixHistoryGraph.svelte delete mode 100644 src/lib/domain/vulnerability/TeamVulnerabilityHistoryGraph.svelte delete mode 100644 src/lib/domain/vulnerability/WorkloadVulnerabilityHistoryGraph.svelte delete mode 100644 src/routes/vulnerabilities/VulnerabilityHistory.svelte diff --git a/src/lib/chart/MeanTimeToFixChart.svelte b/src/lib/chart/MeanTimeToFixChart.svelte deleted file mode 100644 index 1c0762009..000000000 --- a/src/lib/chart/MeanTimeToFixChart.svelte +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - (value ? format(value, 'dd/MM') : ''), - tickSpacing: 150 - } - }} - > - {#snippet tooltip({ context })} - - {#snippet children({ data })} - {const series = $derived(context.series.series)} - {format(context.x(data), 'dd/MM/yyyy')} - - {#each severitiesForChart as severityKey (severityKey)} - {const seriesItem = $derived(series.find((s) => s.key === severityKey))} - {const valueAccessor = $derived(accessor(severityKey))} - - {formatDays(valueAccessor(data))} days - - - {data[`fixedCount_${severityKey}`] ?? 0} - - {const lastFixedAt = $derived(data[`lastFixedAt_${severityKey}`])} - - {formatLastFixedAt(lastFixedAt)} - - {/each} - - {/snippet} - - {/snippet} - - diff --git a/src/lib/chart/VulnerabilityChart.svelte b/src/lib/chart/VulnerabilityChart.svelte deleted file mode 100644 index eda38467b..000000000 --- a/src/lib/chart/VulnerabilityChart.svelte +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - { - if (!value) return ''; - return format(value, 'dd/MM'); - }, - tickSpacing: 150 - } - }} - > - {#snippet tooltip({ context })} - - {#snippet children({ data })} - {const series = $derived(context.series.series)} - {format(context.x(data), 'dd/MM/yyyy')} - - - {calculateTooltipRiskScore(data, series)} - - - {#each allSeverities as severityKey (severityKey)} - {const seriesItem = $derived(series.find((s) => s.key === severityKey))} - {const valueAccessor = $derived(accessor(severityKey))} - - {layerchartFormat(valueAccessor(data))} - - {/each} - - {/snippet} - - {/snippet} - - diff --git a/src/lib/domain/vulnerability/TeamMeanTimeToFixHistoryGraph.svelte b/src/lib/domain/vulnerability/TeamMeanTimeToFixHistoryGraph.svelte deleted file mode 100644 index e0a9b9180..000000000 --- a/src/lib/domain/vulnerability/TeamMeanTimeToFixHistoryGraph.svelte +++ /dev/null @@ -1,134 +0,0 @@ - - -
-
-
- - Mean Time To Fix History for {$query.data?.team.slug} - - - Track the average time to fix vulnerabilities by severity level over time. Use the interval - selector to adjust the time range and analyze your team's remediation trends. - -
-
- - {#if !$query.fetching} -
- - {#each intervalOptionsVulnerabilityHistory as intervalOption (intervalOption)} - {intervalOption} - {/each} - -
- - {#if $query.data?.team.vulnerabilityFixHistory} -
- - - -
- {:else} - No Mean Time To Fix data available for this team. - {/if} - {:else} -
- -
- {/if} -
- - diff --git a/src/lib/domain/vulnerability/TeamVulnerabilityHistoryGraph.svelte b/src/lib/domain/vulnerability/TeamVulnerabilityHistoryGraph.svelte deleted file mode 100644 index dd7bf2a4c..000000000 --- a/src/lib/domain/vulnerability/TeamVulnerabilityHistoryGraph.svelte +++ /dev/null @@ -1,141 +0,0 @@ - - -
-
-
- Vulnerability History for {$query.data?.team.slug} - - Track the accumulation of image vulnerabilities by severity level over time. Use the - interval selector to adjust the time range and monitor trends. - -
-
- {#if !$query.fetching} -
- - {#each intervalOptionsVulnerabilityHistory as interval (interval)} - {interval} - {/each} - -
- {#if $query.data?.team.imageVulnerabilityHistory} -
- - - -
- {:else} - No vulnerability history data available for this team. - {/if} - {:else} -
- -
- {/if} -
- - diff --git a/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.svelte b/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.svelte index e88f14147..72d064ea0 100644 --- a/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.svelte +++ b/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.svelte @@ -12,7 +12,6 @@ } from '$houdini'; import { Alert, BodyShort, Loader } from '#lib/shadcn/ui/index.js'; import ImageVulnerabilities from './ImageVulnerabilities.svelte'; - import WorkloadVulnerabilityHistoryGraph from './WorkloadVulnerabilityHistoryGraph.svelte'; import WorkloadVulnerabilitySummary from './WorkloadVulnerabilitySummary.svelte'; interface Props { @@ -139,15 +138,6 @@ {/if} - - {#key vulnerabilityDataKey} - - {/key} - {/if} diff --git a/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.test.ts b/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.test.ts index 484f8f13d..39027379c 100644 --- a/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.test.ts +++ b/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.test.ts @@ -108,7 +108,7 @@ describe('WorkloadVulnerabilitiesPage', () => { expect(body).not.toContain('Loading vulnerabilities'); expect(body).not.toContain('class="priority-group"'); expect(body).toContain('Image activity log'); - expect(body).toContain('Vulnerability history'); + expect(body).not.toContain('Vulnerability history'); expect(body.includes('Showing the latest available results')).toBe(status === 'PROCESSING'); } ); diff --git a/src/lib/domain/vulnerability/WorkloadVulnerabilityHistoryGraph.svelte b/src/lib/domain/vulnerability/WorkloadVulnerabilityHistoryGraph.svelte deleted file mode 100644 index bdbc423bc..000000000 --- a/src/lib/domain/vulnerability/WorkloadVulnerabilityHistoryGraph.svelte +++ /dev/null @@ -1,104 +0,0 @@ - - -
- {#if !$query.fetching} -
- (interval = i as typeof interval)} - > - {#each intervalOptionsVulnerabilityHistory as interval (interval)} - {interval} - {/each} - -
- {#if $query.data?.team.environment.workload.imageVulnerabilityHistory} -
- - - -
- {:else} - No vulnerability history data available for this workload. - {/if} - {/if} -
- - diff --git a/src/lib/domain/vulnerability/dateUtils.ts b/src/lib/domain/vulnerability/dateUtils.ts index 47f17a4f3..ca64c223e 100644 --- a/src/lib/domain/vulnerability/dateUtils.ts +++ b/src/lib/domain/vulnerability/dateUtils.ts @@ -1,22 +1,4 @@ -import { formatDuration, intervalToDuration, subDays, subMonths } from 'date-fns'; - -export const intervalOptionsVulnerabilityHistory = ['7d', '30d', '6m'] as const; - -export const getFromForVulnerabilityHistory = ( - interval: (typeof intervalOptionsVulnerabilityHistory)[number] -): Date => { - const now = new Date(); - switch (interval) { - case '6m': - return subMonths(now, 6); - case '30d': - return subDays(now, 30); - case '7d': - return subDays(now, 7); - default: - return subDays(now, 7); - } -}; +import { formatDuration, intervalToDuration } from 'date-fns'; export function formatSeconds(seconds: number): string { const duration = intervalToDuration({ start: 0, end: seconds * 1000 }); diff --git a/src/lib/utils/vulnerabilities.test.ts b/src/lib/utils/vulnerabilities.test.ts index 0c15656e7..d299fbce7 100644 --- a/src/lib/utils/vulnerabilities.test.ts +++ b/src/lib/utils/vulnerabilities.test.ts @@ -1,12 +1,10 @@ import { readFileSync } from 'node:fs'; import { parse } from 'svelte/compiler'; import { - allSeverities, formatFixVersion, formatProcessingDuration, sbomStatusDetails, - severityToColor, - severityToRiskScore + severityToColor } from './vulnerabilities'; function remediationGuidance(node: unknown): string[] { @@ -136,43 +134,6 @@ describe('vulnerabilities', () => { }); }); - describe('severityToRiskScore', () => { - test('assigns correct risk scores', () => { - expect(severityToRiskScore.Critical).toBe(10); - expect(severityToRiskScore.High).toBe(5); - expect(severityToRiskScore.Medium).toBe(3); - expect(severityToRiskScore.Low).toBe(1); - expect(severityToRiskScore.Unassigned).toBe(5); - }); - - test('Critical has highest risk score', () => { - const scores = Object.values(severityToRiskScore); - expect(Math.max(...scores)).toBe(severityToRiskScore.Critical); - }); - - test('Low has lowest risk score', () => { - const scores = Object.values(severityToRiskScore); - expect(Math.min(...scores)).toBe(severityToRiskScore.Low); - }); - }); - - describe('allSeverities', () => { - test('contains all severity levels', () => { - expect(allSeverities).toEqual(['Critical', 'High', 'Medium', 'Low', 'Unassigned']); - }); - - test('has exactly 5 severity levels', () => { - expect(allSeverities).toHaveLength(5); - }); - - test('severities are ordered by risk (descending)', () => { - const scores = allSeverities.map((s) => severityToRiskScore[s]); - // Documents the actual order: Critical(10), High(5), Medium(3), Low(1), Unassigned(5) - // Note: Not strictly descending because Unassigned (5) comes after Low (1) - expect(scores).toEqual([10, 5, 3, 1, 5]); - }); - }); - describe('SbomStatus helpers', () => { test('READY status with staleImageTag returns stale iconIndicator', () => { const result = sbomStatusDetails({ status: 'READY', staleImageTag: 'sha256-abc123' }); diff --git a/src/lib/utils/vulnerabilities.ts b/src/lib/utils/vulnerabilities.ts index 25f25cbeb..530255b10 100644 --- a/src/lib/utils/vulnerabilities.ts +++ b/src/lib/utils/vulnerabilities.ts @@ -173,18 +173,6 @@ export function severityToColor({ } } -export type Severity = 'Critical' | 'High' | 'Medium' | 'Low' | 'Unassigned'; - -export const allSeverities: Severity[] = ['Critical', 'High', 'Medium', 'Low', 'Unassigned']; - -export const severityToRiskScore: Record = { - Critical: 10, - High: 5, - Medium: 3, - Low: 1, - Unassigned: 5 -}; - export const suppressionStateLabels: Record = { FALSE_POSITIVE: 'False Positive', NOT_AFFECTED: 'Not Affected', diff --git a/src/routes/team/[team]/vulnerabilities/+page.svelte b/src/routes/team/[team]/vulnerabilities/+page.svelte index 1caf59a07..d965a3f6d 100644 --- a/src/routes/team/[team]/vulnerabilities/+page.svelte +++ b/src/routes/team/[team]/vulnerabilities/+page.svelte @@ -1,8 +1,6 @@ - -
-
- Vulnerability History - - Track vulnerability trends over time across all container images. This chart shows the - distribution of vulnerabilities by severity level, helping you monitor your security posture - and identify patterns in newly discovered issues. - -
- -
- (interval = i as typeof interval)} - > - {#each intervalOptionsVulnerabilityHistory as interval (interval)} - {interval} - {/each} - -
- {#if !$vulnHistory.fetching} -
- - - -
- {:else} -
- -
- {/if} -
- - From e0279696237ceaed0969bb82570f8ffe1db9b1c1 Mon Sep 17 00:00:00 2001 From: Youssef Bel Mekki <38552193+ybelMekk@users.noreply.github.com> Date: Thu, 19 Nov 2026 14:57:43 +0100 Subject: [PATCH 2/4] chore: sync generated GraphQL schema --- schema.graphql | 309 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 220 insertions(+), 89 deletions(-) diff --git a/schema.graphql b/schema.graphql index 1b77f64eb..63cbb176b 100644 --- a/schema.graphql +++ b/schema.graphql @@ -800,12 +800,6 @@ type Application implements ActivityLogger & Node & Workload { """The container image of the application.""" image: ContainerImage! - """Get the vulnerability summary history for application.""" - imageVulnerabilityHistory( - """Get vulnerability summary from given date until today.""" - from: Date! - ): ImageVulnerabilityHistory! - """List of ingresses for the application.""" ingresses: [Ingress!]! @@ -957,9 +951,6 @@ type Application implements ActivityLogger & Node & Workload { """Ordering options for items returned from the connection.""" orderBy: ValkeyOrder ): ValkeyConnection! - - """Get the mean time to fix history for an application.""" - vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! } """Authentication integrations for the application.""" @@ -1111,6 +1102,11 @@ type ApplicationInstanceEdge { enum ApplicationInstanceState { FAILING + + """ + The instance is waiting to be placed on a server, for example because there is not enough CPU or memory available. + """ + PENDING RUNNING STARTING TERMINATED @@ -1138,7 +1134,8 @@ type ApplicationInstanceStatus { message: String! """ - Whether the container is passing its readiness check and can receive traffic. + Whether the instance is passing its readiness check and can receive traffic. + An instance does not receive traffic while a component added by the platform is failing. """ ready: Boolean! state: ApplicationInstanceState! @@ -1251,6 +1248,40 @@ type ApplicationRestartedActivityLogEntry implements ActivityLogEntry & Node { teamSlug: Slug! } +""" +An issue raised when a new version of an application is not being rolled out. +""" +type ApplicationRolloutStuckIssue implements Issue & Node { + """Unique identifier for this issue.""" + id: ID! + + """A human-readable description of the issue.""" + message: String! + + """Why the rollout is stuck.""" + reason: ApplicationRolloutStuckReason! + + """The severity of the issue.""" + severity: Severity! + + """The team environment where the issue was detected.""" + teamEnvironment: TeamEnvironment! + + """The workload whose rollout is stuck.""" + workload: Workload! +} + +"""Why a rollout of a new application version is stuck.""" +enum ApplicationRolloutStuckReason { + """ + Instances of the new version could not be created, for example because of a quota or a platform policy. + """ + INSTANCE_CREATION_FAILED + + """The new version did not become ready within the allowed time.""" + TIMED_OUT +} + type ApplicationScaledActivityLogEntry implements ActivityLogEntry & Node { """ The identity of the actor who performed the action. The value is either the name of a service account, or the email address of a user. @@ -1298,10 +1329,53 @@ type ApplicationScaling { """The minimum number of application instances.""" minInstances: Int! + """ + The current state of automatic scaling for the application. + Null if automatic scaling is not set up for the application in the environment. + """ + status: ApplicationScalingStatus + """Scaling strategies for the application.""" strategies: [ScalingStrategy!]! } +"""The state of automatic scaling for an application.""" +enum ApplicationScalingState { + """Automatic scaling is working as expected.""" + ACTIVE + + """ + Automatic scaling is turned off because the application has been scaled down to zero instances. + """ + DISABLED + + """The application needs more instances than the configured maximum.""" + LIMITED_BY_MAXIMUM + + """ + The metrics used for automatic scaling cannot be read, so the number of instances is not adjusted. + """ + METRICS_UNAVAILABLE + + """The platform is currently unable to change the number of instances.""" + UNABLE_TO_SCALE +} + +"""The current state of automatic scaling for an application.""" +type ApplicationScalingStatus { + """The number of instances currently running.""" + currentInstances: Int! + + """The number of instances that automatic scaling wants to run.""" + desiredInstances: Int! + + """A user-friendly description of the current state.""" + message: String! + + """The state of automatic scaling.""" + state: ApplicationScalingState! +} + enum ApplicationState { """The application is not running.""" NOT_RUNNING @@ -3779,11 +3853,6 @@ input ImageVulnerabilityFilter { severitySince: Time } -type ImageVulnerabilityHistory { - """Vulnerability summary samples.""" - samples: [ImageVulnerabilitySample!]! -} - """Ordering options when fetching teams.""" input ImageVulnerabilityOrder { """The direction to order items by.""" @@ -3818,14 +3887,6 @@ enum ImageVulnerabilityOrderField { SUPPRESSED } -type ImageVulnerabilitySample { - """Timestamp of the vulnerability summary.""" - date: Time! - - """The historic image vulnerability summary""" - summary: ImageVulnerabilitySummary! -} - enum ImageVulnerabilitySeverity { CRITICAL HIGH @@ -4201,6 +4262,9 @@ type IssueTeamFacetItem { enum IssueType { """Raised when an application is stuck in a restart loop.""" APPLICATION_RESTART_LOOP + + """Raised when a new version of an application is not being rolled out.""" + APPLICATION_ROLLOUT_STUCK DEPRECATED_INGRESS DEPRECATED_REGISTRY @@ -4348,12 +4412,6 @@ type Job implements ActivityLogger & Node & Workload { """The container image of the job.""" image: ContainerImage! - """Get the vulnerability summary history for job.""" - imageVulnerabilityHistory( - """Get vulnerability summary from given date until today.""" - from: Date! - ): ImageVulnerabilityHistory! - """Issues that affect the job.""" issues( """Get items after this cursor.""" @@ -4498,9 +4556,6 @@ type Job implements ActivityLogger & Node & Workload { """Ordering options for items returned from the connection.""" orderBy: ValkeyOrder ): ValkeyConnection! - - """Get the mean time to fix history for a job.""" - vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! } union JobAuthIntegrations = EntraIDAuthIntegration | MaskinportenAuthIntegration @@ -4751,11 +4806,23 @@ type JobRunEdge { } type JobRunInstance implements Node { + """The time the job run instance was created.""" + created: Time! + """The globally unique ID of the job run instance.""" id: ID! + """The container image of the job run instance.""" + image: ContainerImage! + """The name of the job run instance.""" name: String! + + """The number of times the job run instance has been restarted.""" + restarts: Int! + + """The current status of the job run instance.""" + status: JobRunInstanceStatus! } type JobRunInstanceConnection { @@ -4777,6 +4844,57 @@ type JobRunInstanceEdge { node: JobRunInstance! } +"""The state of a job run instance.""" +enum JobRunInstanceState { + """ + The job run instance has a problem that prevents it from running or completing successfully. + """ + FAILING + + """ + The job run instance is waiting to be placed on a server, for example because there is not enough CPU or memory available. + """ + PENDING + + """The job run instance is running.""" + RUNNING + + """The job run instance is starting.""" + STARTING + + """The job run instance completed successfully.""" + SUCCEEDED + + """The state of the job run instance is unknown.""" + UNKNOWN +} + +"""The status of a job run instance.""" +type JobRunInstanceStatus { + """ + The exit code from the last termination of the job run instance, if applicable. + """ + lastExitCode: Int + + """ + The reason the job run instance last terminated, if applicable. + This is populated even when the instance is currently running, to help debug restarts. + """ + lastExitReason: String + + """ + The timestamp of the last termination of the job run instance, if applicable. + This is populated even when the instance is currently running, to help debug restarts. + """ + lastExitTimestamp: Time + + """A user-friendly description of the current state.""" + message: String! + + """The current state of the job run instance.""" + state: JobRunInstanceState! +} + enum JobRunState { """Job run is failed.""" FAILED @@ -7215,12 +7333,6 @@ type Query { last: Int ): WebhookSubscriptionConnection! - """Get the vulnerability summary history for all teams.""" - imageVulnerabilityHistory( - """Get vulnerability summary from given date until today.""" - from: Date! - ): ImageVulnerabilityHistory! - """ Issues across teams in the tenant, ordered by severity unless otherwise specified. """ @@ -7422,9 +7534,6 @@ type Query { orderBy: UserOrder ): UserConnection! - """Get the mean time to fix history for all teams.""" - vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! - """List per-workload vulnerability summaries across all teams.""" vulnerabilitySummaries( """Get items after this cursor.""" @@ -9884,12 +9993,6 @@ type Team implements ActivityLogger & Node { """The globally unique ID of the team.""" id: ID! - """Get the vulnerability summary history for team.""" - imageVulnerabilityHistory( - """Get vulnerability summary from given date until today.""" - from: Date! - ): ImageVulnerabilityHistory! - """Overall inventory of resources for the team.""" inventoryCounts: TeamInventoryCounts! @@ -10171,9 +10274,6 @@ type Team implements ActivityLogger & Node { """Whether or not the viewer is an owner of the team.""" viewerIsOwner: Boolean! - """Get the mean time to fix history for a team.""" - vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! - """Fetch vulnerability summaries for workloads in the team.""" vulnerabilitySummaries( """Get items after this cursor.""" @@ -13065,36 +13165,6 @@ type VulnerabilityActivityLogEntryData { severity: ImageVulnerabilitySeverity! } -"""Trend of mean time to fix vulnerabilities grouped by severity.""" -type VulnerabilityFixHistory { - """Mean time to fix samples.""" - samples: [VulnerabilityFixSample!]! -} - -"""One MTTR sample for a severity at a point in time.""" -type VulnerabilityFixSample { - """Snapshot date of the sample.""" - date: Time! - - """Mean time to fix in days.""" - days: Int! - - """Earliest time a vulnerability was fixed in this sample.""" - firstFixedAt: Time - - """Number of vulnerabilities fixed in this sample.""" - fixedCount: Int! - - """Latest time a vulnerability was fixed in this sample.""" - lastFixedAt: Time - - """Severity of vulnerabilities in this sample.""" - severity: ImageVulnerabilitySeverity! - - """Total number of workloads with this severity of vulnerabilities.""" - totalWorkloads: Int! -} - """ Package version information that helps remediate an image vulnerability. """ @@ -13777,12 +13847,6 @@ interface Workload implements ActivityLogger & Node { """The container image of the workload.""" image: ContainerImage! - """Get the vulnerability summary history for workload.""" - imageVulnerabilityHistory( - """Get vulnerability summary from given date until today.""" - from: Date! - ): ImageVulnerabilityHistory! - """Issues that affect the workload.""" issues( """Get items after this cursor.""" @@ -13902,9 +13966,6 @@ interface Workload implements ActivityLogger & Node { """Ordering options for items returned from the connection.""" orderBy: ValkeyOrder ): ValkeyConnection! - - """Get the mean time to fix history for a workload.""" - vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! } """Workload connection.""" @@ -14330,6 +14391,76 @@ type WorkloadVulnerabilitySummaryEdge { node: WorkloadVulnerabilitySummary! } +""" +A problem detected while running the workload. +Repeated occurrences of the same problem are combined into a single event. +""" +type WorkloadWarningEvent implements Node & WorkloadEvent { + """Number of times the problem has been observed.""" + count: Int! + + """When the problem was first observed.""" + firstSeenAt: Time! + + """Unique event identifier.""" + id: ID! + + """ + Name of the affected instance, if the problem concerns a single instance. + """ + instance: String + + """The kind of problem.""" + kind: WorkloadWarningEventKind! + + """Description of the problem.""" + message: String! + + """When the problem was last observed.""" + triggeredAt: Time! +} + +"""The kind of problem reported by a warning event.""" +enum WorkloadWarningEventKind { + """The instance keeps crashing and is restarted with increasing delay.""" + CRASH_LOOP + + """A readiness, liveness or startup check failed.""" + HEALTH_CHECK_FAILED + + """The container image could not be downloaded.""" + IMAGE_PULL_FAILED + + """ + New instances could not be created, for example because of a quota or a platform policy. + """ + INSTANCE_CREATION_FAILED + + """ + The instance was stopped by the platform, for example to free up resources. + """ + INSTANCE_STOPPED + + """Files or storage could not be mounted into the instance.""" + MOUNT_FAILED + + """ + No server with enough available resources was found to run the instance. + """ + PLACEMENT_FAILED + + """A job run failed permanently.""" + RUN_FAILED + + """Automatic scaling is unable to adjust the number of instances.""" + SCALING_FAILED + + """ + The instance could not be started, for example because of missing configuration. + """ + START_FAILED +} + """A workload affected by a specific vulnerability.""" type WorkloadWithVulnerability implements Node { """The globally unique ID of the workload vulnerability node.""" From a0978aea4f2ee4254903e310e5271386722017a2 Mon Sep 17 00:00:00 2001 From: Youssef Bel Mekki <38552193+ybelMekk@users.noreply.github.com> Date: Fri, 20 Nov 2026 09:59:28 +0100 Subject: [PATCH 3/4] fix(vulnerabilities): add deprecated fields - image vulnerability history and mean time to fix - fix test --- schema.graphql | 88 +++++++++++++++++++ ...WorkloadVulnerabilitiesPage.client.test.ts | 29 ++---- 2 files changed, 97 insertions(+), 20 deletions(-) diff --git a/schema.graphql b/schema.graphql index 63cbb176b..d46316499 100644 --- a/schema.graphql +++ b/schema.graphql @@ -800,6 +800,12 @@ type Application implements ActivityLogger & Node & Workload { """The container image of the application.""" image: ContainerImage! + """Get the vulnerability summary history for application.""" + imageVulnerabilityHistory( + """Get vulnerability summary from given date until today.""" + from: Date! + ): ImageVulnerabilityHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") + """List of ingresses for the application.""" ingresses: [Ingress!]! @@ -951,6 +957,9 @@ type Application implements ActivityLogger & Node & Workload { """Ordering options for items returned from the connection.""" orderBy: ValkeyOrder ): ValkeyConnection! + + """Get the mean time to fix history for an application.""" + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") } """Authentication integrations for the application.""" @@ -3853,6 +3862,11 @@ input ImageVulnerabilityFilter { severitySince: Time } +type ImageVulnerabilityHistory { + """Vulnerability summary samples.""" + samples: [ImageVulnerabilitySample!]! +} + """Ordering options when fetching teams.""" input ImageVulnerabilityOrder { """The direction to order items by.""" @@ -3887,6 +3901,14 @@ enum ImageVulnerabilityOrderField { SUPPRESSED } +type ImageVulnerabilitySample { + """Timestamp of the vulnerability summary.""" + date: Time! + + """The historic image vulnerability summary""" + summary: ImageVulnerabilitySummary! +} + enum ImageVulnerabilitySeverity { CRITICAL HIGH @@ -4412,6 +4434,12 @@ type Job implements ActivityLogger & Node & Workload { """The container image of the job.""" image: ContainerImage! + """Get the vulnerability summary history for job.""" + imageVulnerabilityHistory( + """Get vulnerability summary from given date until today.""" + from: Date! + ): ImageVulnerabilityHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") + """Issues that affect the job.""" issues( """Get items after this cursor.""" @@ -4556,6 +4584,9 @@ type Job implements ActivityLogger & Node & Workload { """Ordering options for items returned from the connection.""" orderBy: ValkeyOrder ): ValkeyConnection! + + """Get the mean time to fix history for a job.""" + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") } union JobAuthIntegrations = EntraIDAuthIntegration | MaskinportenAuthIntegration @@ -7333,6 +7364,12 @@ type Query { last: Int ): WebhookSubscriptionConnection! + """Get the vulnerability summary history for all teams.""" + imageVulnerabilityHistory( + """Get vulnerability summary from given date until today.""" + from: Date! + ): ImageVulnerabilityHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") + """ Issues across teams in the tenant, ordered by severity unless otherwise specified. """ @@ -7534,6 +7571,9 @@ type Query { orderBy: UserOrder ): UserConnection! + """Get the mean time to fix history for all teams.""" + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") + """List per-workload vulnerability summaries across all teams.""" vulnerabilitySummaries( """Get items after this cursor.""" @@ -9993,6 +10033,12 @@ type Team implements ActivityLogger & Node { """The globally unique ID of the team.""" id: ID! + """Get the vulnerability summary history for team.""" + imageVulnerabilityHistory( + """Get vulnerability summary from given date until today.""" + from: Date! + ): ImageVulnerabilityHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") + """Overall inventory of resources for the team.""" inventoryCounts: TeamInventoryCounts! @@ -10274,6 +10320,9 @@ type Team implements ActivityLogger & Node { """Whether or not the viewer is an owner of the team.""" viewerIsOwner: Boolean! + """Get the mean time to fix history for a team.""" + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") + """Fetch vulnerability summaries for workloads in the team.""" vulnerabilitySummaries( """Get items after this cursor.""" @@ -13165,6 +13214,36 @@ type VulnerabilityActivityLogEntryData { severity: ImageVulnerabilitySeverity! } +"""Trend of mean time to fix vulnerabilities grouped by severity.""" +type VulnerabilityFixHistory { + """Mean time to fix samples.""" + samples: [VulnerabilityFixSample!]! +} + +"""One MTTR sample for a severity at a point in time.""" +type VulnerabilityFixSample { + """Snapshot date of the sample.""" + date: Time! + + """Mean time to fix in days.""" + days: Int! + + """Earliest time a vulnerability was fixed in this sample.""" + firstFixedAt: Time + + """Number of vulnerabilities fixed in this sample.""" + fixedCount: Int! + + """Latest time a vulnerability was fixed in this sample.""" + lastFixedAt: Time + + """Severity of vulnerabilities in this sample.""" + severity: ImageVulnerabilitySeverity! + + """Total number of workloads with this severity of vulnerabilities.""" + totalWorkloads: Int! +} + """ Package version information that helps remediate an image vulnerability. """ @@ -13847,6 +13926,12 @@ interface Workload implements ActivityLogger & Node { """The container image of the workload.""" image: ContainerImage! + """Get the vulnerability summary history for workload.""" + imageVulnerabilityHistory( + """Get vulnerability summary from given date until today.""" + from: Date! + ): ImageVulnerabilityHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") + """Issues that affect the workload.""" issues( """Get items after this cursor.""" @@ -13966,6 +14051,9 @@ interface Workload implements ActivityLogger & Node { """Ordering options for items returned from the connection.""" orderBy: ValkeyOrder ): ValkeyConnection! + + """Get the mean time to fix history for a workload.""" + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! @deprecated(reason: "No longer used by Console. Retained for compatibility while consumer usage is assessed.") } """Workload connection.""" diff --git a/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.client.test.ts b/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.client.test.ts index dddf8ab1c..b9dbd1014 100644 --- a/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.client.test.ts +++ b/src/lib/domain/vulnerability/WorkloadVulnerabilitiesPage.client.test.ts @@ -35,9 +35,7 @@ const requests = vi.hoisted(() => ({ groupTotals: {} as Record, failedPriorities: [] as string[], failedPackageTypes: [] as string[], - packageTypes: ['maven', 'npm'], - fetchHistory: vi.fn(), - createHistoryQuery: vi.fn() + packageTypes: ['maven', 'npm'] })); vi.mock('$houdini', async (importOriginal) => { @@ -146,17 +144,13 @@ vi.mock('$houdini', async (importOriginal) => { return { ...actual, - graphql: () => { - requests.createHistoryQuery(); - return { - ...readable({ data: null, fetching: false, errors: null }), - fetch: requests.fetchHistory, - mutate: async (variables: { suppress: boolean }) => { - requests.suppressFinding(variables); - requests.suppressed = variables.suppress; - } - }; - }, + graphql: () => ({ + ...readable({ data: null, fetching: false, errors: null }), + mutate: async (variables: { suppress: boolean }) => { + requests.suppressFinding(variables); + requests.suppressed = variables.suppress; + } + }), ImagePriorityVulnerabilitiesStore }; }); @@ -852,7 +846,7 @@ describe.each(['Application', 'Job'] as const)('%s findings', (typename) => { }); it.each(['HIGH', 'ELEVATED', 'MONITOR', 'ALL'] as const)( - 'reloads %s findings and history after PROCESSING changes to READY', + 'reloads %s findings after PROCESSING changes to READY', async (priority) => { requests.phase = 'PROCESSING'; requests.typename = typename; @@ -882,8 +876,6 @@ describe.each(['Application', 'Job'] as const)('%s findings', (typename) => { flushSync(); await vi.waitFor(() => expect(document.body.textContent).toContain('CVE-2026-1111')); expect(requests.fetches).toEqual([null]); - expect(requests.fetchHistory).toHaveBeenCalledTimes(1); - expect(requests.createHistoryQuery).toHaveBeenCalledTimes(1); openFindings(priority); await vi.waitFor(() => expect(document.body.textContent).toContain('CVE-2026-1111')); @@ -896,8 +888,6 @@ describe.each(['Application', 'Job'] as const)('%s findings', (typename) => { await tick(); expect(document.body.textContent).not.toContain('CVE-2026-1111'); expect(requests.fetches).toEqual([...expectedFetches, null]); - expect(requests.fetchHistory).toHaveBeenCalledTimes(2); - expect(requests.createHistoryQuery).toHaveBeenCalledTimes(2); openFindings(priority); await vi.waitFor(() => expect(document.body.textContent).toContain('CVE-2026-2222')); @@ -908,7 +898,6 @@ describe.each(['Application', 'Job'] as const)('%s findings', (typename) => { await tick(); expect(document.body.textContent).toContain('CVE-2026-2222'); expect(requests.fetches).toHaveLength(expectedFetches.length * 2); - expect(requests.createHistoryQuery).toHaveBeenCalledTimes(2); } ); From 55491c761323464628141147b632bccf1ac7df8e Mon Sep 17 00:00:00 2001 From: Youssef Bel Mekki <38552193+ybelMekk@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:53:09 +0100 Subject: [PATCH 4/4] fix: add ApplicationRolloutStuckIssue to GraphQL schema --- src/routes/homeAttention.gql | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/routes/homeAttention.gql b/src/routes/homeAttention.gql index a711ac640..1bfcebbf3 100644 --- a/src/routes/homeAttention.gql +++ b/src/routes/homeAttention.gql @@ -28,6 +28,28 @@ query HomeAttention { } } } + ... on ApplicationRolloutStuckIssue { + id + message + teamEnvironment { + team { + slug + } + environment { + name + } + } + workload { + ... on Application { + __typename + name + } + ... on Job { + __typename + name + } + } + } ... on DeprecatedIngressIssue { id message