diff --git a/internal/graph/gengql/generated.go b/internal/graph/gengql/generated.go index 68a4b7536..1745cb814 100644 --- a/internal/graph/gengql/generated.go +++ b/internal/graph/gengql/generated.go @@ -225,6 +225,7 @@ type ComplexityRoot struct { TeamEnvironment func(childComplexity int) int Utilization func(childComplexity int) int Valkeys func(childComplexity int, orderBy *valkey.ValkeyOrder) int + VulnerabilityFixHistory func(childComplexity int, from scalar.Date) int } ApplicationConnection struct { @@ -818,6 +819,7 @@ type ComplexityRoot struct { Team func(childComplexity int) int TeamEnvironment func(childComplexity int) int Valkeys func(childComplexity int, orderBy *valkey.ValkeyOrder) int + VulnerabilityFixHistory func(childComplexity int, from scalar.Date) int } JobConnection struct { @@ -1260,6 +1262,7 @@ type ComplexityRoot struct { User func(childComplexity int, email *string) int UserSyncLog func(childComplexity int, first *int, after *pagination.Cursor, last *int, before *pagination.Cursor) int Users func(childComplexity int, first *int, after *pagination.Cursor, last *int, before *pagination.Cursor, orderBy *user.UserOrder) int + VulnerabilityFixHistory func(childComplexity int, from scalar.Date) int VulnerabilitySummary func(childComplexity int) int } @@ -1959,6 +1962,7 @@ type ComplexityRoot struct { Valkeys func(childComplexity int, first *int, after *pagination.Cursor, last *int, before *pagination.Cursor, orderBy *valkey.ValkeyOrder) int ViewerIsMember func(childComplexity int) int ViewerIsOwner func(childComplexity int) int + VulnerabilityFixHistory func(childComplexity int, from scalar.Date) int VulnerabilitySummaries func(childComplexity int, filter *vulnerability.TeamVulnerabilitySummaryFilter, first *int, after *pagination.Cursor, last *int, before *pagination.Cursor, orderBy *vulnerability.VulnerabilitySummaryOrder) int VulnerabilitySummary func(childComplexity int, filter *vulnerability.TeamVulnerabilitySummaryFilter) int WorkloadUtilization func(childComplexity int, resourceType utilization.UtilizationResourceType) int @@ -2615,6 +2619,20 @@ type ComplexityRoot struct { Severity func(childComplexity int) int } + VulnerabilityFixHistory struct { + Samples func(childComplexity int) int + } + + VulnerabilityFixSample struct { + Date func(childComplexity int) int + Days func(childComplexity int) int + FirstFixedAt func(childComplexity int) int + FixedCount func(childComplexity int) int + LastFixedAt func(childComplexity int) int + Severity func(childComplexity int) int + TotalWorkloads func(childComplexity int) int + } + VulnerabilityUpdatedActivityLogEntry struct { Actor func(childComplexity int) int CreatedAt func(childComplexity int) int @@ -2747,6 +2765,7 @@ type ApplicationResolver interface { Utilization(ctx context.Context, obj *application.Application) (*utilization.WorkloadUtilization, error) Valkeys(ctx context.Context, obj *application.Application, orderBy *valkey.ValkeyOrder) (*pagination.Connection[*valkey.Valkey], error) ImageVulnerabilityHistory(ctx context.Context, obj *application.Application, from scalar.Date) (*vulnerability.ImageVulnerabilityHistory, error) + VulnerabilityFixHistory(ctx context.Context, obj *application.Application, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) } type ApplicationInstanceResolver interface { InstanceUtilization(ctx context.Context, obj *application.ApplicationInstance, resourceType utilization.UtilizationResourceType) (*utilization.ApplicationInstanceUtilization, error) @@ -2854,6 +2873,7 @@ type JobResolver interface { SQLInstances(ctx context.Context, obj *job.Job, orderBy *sqlinstance.SQLInstanceOrder) (*pagination.Connection[*sqlinstance.SQLInstance], error) Valkeys(ctx context.Context, obj *job.Job, orderBy *valkey.ValkeyOrder) (*pagination.Connection[*valkey.Valkey], error) ImageVulnerabilityHistory(ctx context.Context, obj *job.Job, from scalar.Date) (*vulnerability.ImageVulnerabilityHistory, error) + VulnerabilityFixHistory(ctx context.Context, obj *job.Job, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) } type JobRunResolver interface { Duration(ctx context.Context, obj *job.JobRun) (int, error) @@ -2983,6 +3003,7 @@ type QueryResolver interface { TeamsUtilization(ctx context.Context, resourceType utilization.UtilizationResourceType) ([]*utilization.TeamUtilizationData, error) ImageVulnerabilityHistory(ctx context.Context, from scalar.Date) (*vulnerability.ImageVulnerabilityHistory, error) VulnerabilitySummary(ctx context.Context) (*vulnerability.TenantVulnerabilitySummary, error) + VulnerabilityFixHistory(ctx context.Context, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) } type ReconcilerResolver interface { Config(ctx context.Context, obj *reconciler.Reconciler) ([]*reconciler.ReconcilerConfig, error) @@ -3089,6 +3110,7 @@ type TeamResolver interface { ImageVulnerabilityHistory(ctx context.Context, obj *team.Team, from scalar.Date) (*vulnerability.ImageVulnerabilityHistory, error) VulnerabilitySummary(ctx context.Context, obj *team.Team, filter *vulnerability.TeamVulnerabilitySummaryFilter) (*vulnerability.TeamVulnerabilitySummary, error) VulnerabilitySummaries(ctx context.Context, obj *team.Team, filter *vulnerability.TeamVulnerabilitySummaryFilter, first *int, after *pagination.Cursor, last *int, before *pagination.Cursor, orderBy *vulnerability.VulnerabilitySummaryOrder) (*pagination.Connection[*vulnerability.WorkloadVulnerabilitySummary], error) + VulnerabilityFixHistory(ctx context.Context, obj *team.Team, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) Workloads(ctx context.Context, obj *team.Team, first *int, after *pagination.Cursor, last *int, before *pagination.Cursor, orderBy *workload.WorkloadOrder, filter *workload.TeamWorkloadsFilter) (*pagination.Connection[workload.Workload], error) } type TeamCostResolver interface { @@ -3589,6 +3611,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Application.Valkeys(childComplexity, args["orderBy"].(*valkey.ValkeyOrder)), true + case "Application.vulnerabilityFixHistory": + if e.complexity.Application.VulnerabilityFixHistory == nil { + break + } + + args, err := ec.field_Application_vulnerabilityFixHistory_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Application.VulnerabilityFixHistory(childComplexity, args["from"].(scalar.Date)), true + case "ApplicationConnection.edges": if e.complexity.ApplicationConnection.Edges == nil { break @@ -5866,6 +5900,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Job.Valkeys(childComplexity, args["orderBy"].(*valkey.ValkeyOrder)), true + case "Job.vulnerabilityFixHistory": + if e.complexity.Job.VulnerabilityFixHistory == nil { + break + } + + args, err := ec.field_Job_vulnerabilityFixHistory_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Job.VulnerabilityFixHistory(childComplexity, args["from"].(scalar.Date)), true + case "JobConnection.edges": if e.complexity.JobConnection.Edges == nil { break @@ -8109,6 +8155,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Users(childComplexity, args["first"].(*int), args["after"].(*pagination.Cursor), args["last"].(*int), args["before"].(*pagination.Cursor), args["orderBy"].(*user.UserOrder)), true + case "Query.vulnerabilityFixHistory": + if e.complexity.Query.VulnerabilityFixHistory == nil { + break + } + + args, err := ec.field_Query_vulnerabilityFixHistory_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.VulnerabilityFixHistory(childComplexity, args["from"].(scalar.Date)), true + case "Query.vulnerabilitySummary": if e.complexity.Query.VulnerabilitySummary == nil { break @@ -11220,6 +11278,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Team.ViewerIsOwner(childComplexity), true + case "Team.vulnerabilityFixHistory": + if e.complexity.Team.VulnerabilityFixHistory == nil { + break + } + + args, err := ec.field_Team_vulnerabilityFixHistory_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Team.VulnerabilityFixHistory(childComplexity, args["from"].(scalar.Date)), true + case "Team.vulnerabilitySummaries": if e.complexity.Team.VulnerabilitySummaries == nil { break @@ -13939,6 +14009,62 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.VulnerabilityActivityLogEntryData.Severity(childComplexity), true + case "VulnerabilityFixHistory.samples": + if e.complexity.VulnerabilityFixHistory.Samples == nil { + break + } + + return e.complexity.VulnerabilityFixHistory.Samples(childComplexity), true + + case "VulnerabilityFixSample.date": + if e.complexity.VulnerabilityFixSample.Date == nil { + break + } + + return e.complexity.VulnerabilityFixSample.Date(childComplexity), true + + case "VulnerabilityFixSample.days": + if e.complexity.VulnerabilityFixSample.Days == nil { + break + } + + return e.complexity.VulnerabilityFixSample.Days(childComplexity), true + + case "VulnerabilityFixSample.firstFixedAt": + if e.complexity.VulnerabilityFixSample.FirstFixedAt == nil { + break + } + + return e.complexity.VulnerabilityFixSample.FirstFixedAt(childComplexity), true + + case "VulnerabilityFixSample.fixedCount": + if e.complexity.VulnerabilityFixSample.FixedCount == nil { + break + } + + return e.complexity.VulnerabilityFixSample.FixedCount(childComplexity), true + + case "VulnerabilityFixSample.lastFixedAt": + if e.complexity.VulnerabilityFixSample.LastFixedAt == nil { + break + } + + return e.complexity.VulnerabilityFixSample.LastFixedAt(childComplexity), true + + case "VulnerabilityFixSample.severity": + if e.complexity.VulnerabilityFixSample.Severity == nil { + break + } + + return e.complexity.VulnerabilityFixSample.Severity(childComplexity), true + + case "VulnerabilityFixSample.totalWorkloads": + if e.complexity.VulnerabilityFixSample.TotalWorkloads == nil { + break + } + + return e.complexity.VulnerabilityFixSample.TotalWorkloads(childComplexity), true + case "VulnerabilityUpdatedActivityLogEntry.actor": if e.complexity.VulnerabilityUpdatedActivityLogEntry.Actor == nil { break @@ -23559,141 +23685,67 @@ extend enum ActivityLogActivityType { "Activity log entry for when a vulnerability is updated." VULNERABILITY_UPDATED } -`, BuiltIn: false}, - {Name: "../schema/workloads.graphqls", Input: `extend type Team { - """ - Nais workloads owned by the team. - """ - workloads( - """ - Get the first n items in the connection. This can be used in combination with the after parameter. - """ - first: Int - - """ - Get items after this cursor. - """ - after: Cursor - """ - Get the last n items in the connection. This can be used in combination with the before parameter. - """ - last: Int - - """ - Get items before this cursor. - """ - before: Cursor - - """ - Ordering options for items returned from the connection. - """ - orderBy: WorkloadOrder - - """ - Filter the returned objects - """ - filter: TeamWorkloadsFilter - ): WorkloadConnection! +extend type Query { + "Get the mean time to fix history for all teams." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! } -extend type Environment { - """ - Nais workloads in the environment. - """ - workloads( - """ - Get the first n items in the connection. This can be used in combination with the after parameter. - """ - first: Int - - """ - Get items after this cursor. - """ - after: Cursor - - """ - Get the last n items in the connection. This can be used in combination with the before parameter. - """ - last: Int - - """ - Get items before this cursor. - """ - before: Cursor - - """ - Ordering options for items returned from the connection. - """ - orderBy: EnvironmentWorkloadOrder - ): WorkloadConnection! +extend interface Workload { + "Get the mean time to fix history for a workload." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! } -extend type TeamEnvironment { - """ - Workload in the team environment. - """ - workload( - """ - The name of the workload to get. - """ - name: String! - ): Workload! +extend type Application { + "Get the mean time to fix history for an application." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! } -""" -Interface for workloads. -""" -interface Workload implements Node & ActivityLogger { - """ - The globally unique ID of the workload. - """ - id: ID! +extend type Job { + "Get the mean time to fix history for a job." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! +} - """ - The name of the workload. - """ - name: String! +extend type Team { + "Get the mean time to fix history for a team." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! +} - """ - The team that owns the workload. - """ - team: Team! +"Trend of mean time to fix vulnerabilities grouped by severity." +type VulnerabilityFixHistory { + "Mean time to fix samples." + samples: [VulnerabilityFixSample!]! +} - """ - The environment the workload is deployed in. - """ - environment: TeamEnvironment! @deprecated(reason: "Use the ` + "`" + `teamEnvironment` + "`" + ` field instead.") +"One MTTR sample for a severity at a point in time." +type VulnerabilityFixSample { + "Severity of vulnerabilities in this sample." + severity: ImageVulnerabilitySeverity! - """ - The team environment for the workload. - """ - teamEnvironment: TeamEnvironment! + "Snapshot date of the sample." + date: Time! - """ - The container image of the workload. - """ - image: ContainerImage! + "Mean time to fix in days." + days: Int! - """ - The resources allocated to the workload. - """ - resources: WorkloadResources! + "Number of vulnerabilities fixed in this sample." + fixedCount: Int! - """ - The workload manifest. - """ - manifest: WorkloadManifest! + "Earliest time a vulnerability was fixed in this sample." + firstFixedAt: Time - """ - If set, when the workload was marked for deletion. - """ - deletionStartedAt: Time + "Latest time a vulnerability was fixed in this sample." + lastFixedAt: Time + "Total number of workloads with this severity of vulnerabilities." + totalWorkloads: Int! +} +`, BuiltIn: false}, + {Name: "../schema/workloads.graphqls", Input: `extend type Team { """ - Activity log associated with the workload. + Nais workloads owned by the team. """ - activityLog( + workloads( """ Get the first n items in the connection. This can be used in combination with the after parameter. """ @@ -23715,66 +23767,195 @@ interface Workload implements Node & ActivityLogger { before: Cursor """ - Filter items. + Ordering options for items returned from the connection. """ - filter: ActivityLogFilter - ): ActivityLogEntryConnection! - - "Issues that affects the workload." - issues( - "Get the first n items in the connection. This can be used in combination with the after parameter." - first: Int - - "Get items after this cursor." - after: Cursor - - "Get the last n items in the connection. This can be used in combination with the before parameter." - last: Int - - "Get items before this cursor." - before: Cursor - - "Ordering options for items returned from the connection." - orderBy: IssueOrder - - "Filtering options for items returned from the connection." - filter: ResourceIssueFilter - ): IssueConnection! -} + orderBy: WorkloadOrder -""" -Interface for workload manifests. -""" -interface WorkloadManifest { - """ - The manifest content, serialized as a YAML document. - """ - content: String! + """ + Filter the returned objects + """ + filter: TeamWorkloadsFilter + ): WorkloadConnection! } -""" -Container image. -""" -type ContainerImage implements Node & ActivityLogger { - """ - The globally unique ID of the container image node. - """ - id: ID! - - """ - Name of the container image. - """ - name: String! - - """ - Tag of the container image. - """ - tag: String! - +extend type Environment { """ - Activity log associated with the container image. + Nais workloads in the environment. """ - activityLog( + workloads( + """ + Get the first n items in the connection. This can be used in combination with the after parameter. + """ + first: Int + + """ + Get items after this cursor. + """ + after: Cursor + + """ + Get the last n items in the connection. This can be used in combination with the before parameter. + """ + last: Int + + """ + Get items before this cursor. + """ + before: Cursor + + """ + Ordering options for items returned from the connection. + """ + orderBy: EnvironmentWorkloadOrder + ): WorkloadConnection! +} + +extend type TeamEnvironment { + """ + Workload in the team environment. + """ + workload( + """ + The name of the workload to get. + """ + name: String! + ): Workload! +} + +""" +Interface for workloads. +""" +interface Workload implements Node & ActivityLogger { + """ + The globally unique ID of the workload. + """ + id: ID! + + """ + The name of the workload. + """ + name: String! + + """ + The team that owns the workload. + """ + team: Team! + + """ + The environment the workload is deployed in. + """ + environment: TeamEnvironment! @deprecated(reason: "Use the ` + "`" + `teamEnvironment` + "`" + ` field instead.") + + """ + The team environment for the workload. + """ + teamEnvironment: TeamEnvironment! + + """ + The container image of the workload. + """ + image: ContainerImage! + + """ + The resources allocated to the workload. + """ + resources: WorkloadResources! + + """ + The workload manifest. + """ + manifest: WorkloadManifest! + + """ + If set, when the workload was marked for deletion. + """ + deletionStartedAt: Time + + """ + Activity log associated with the workload. + """ + activityLog( + """ + Get the first n items in the connection. This can be used in combination with the after parameter. + """ + first: Int + + """ + Get items after this cursor. + """ + after: Cursor + + """ + Get the last n items in the connection. This can be used in combination with the before parameter. + """ + last: Int + + """ + Get items before this cursor. + """ + before: Cursor + + """ + Filter items. + """ + filter: ActivityLogFilter + ): ActivityLogEntryConnection! + + "Issues that affects the workload." + issues( + "Get the first n items in the connection. This can be used in combination with the after parameter." + first: Int + + "Get items after this cursor." + after: Cursor + + "Get the last n items in the connection. This can be used in combination with the before parameter." + last: Int + + "Get items before this cursor." + before: Cursor + + "Ordering options for items returned from the connection." + orderBy: IssueOrder + + "Filtering options for items returned from the connection." + filter: ResourceIssueFilter + ): IssueConnection! +} + +""" +Interface for workload manifests. +""" +interface WorkloadManifest { + """ + The manifest content, serialized as a YAML document. + """ + content: String! +} + +""" +Container image. +""" +type ContainerImage implements Node & ActivityLogger { + """ + The globally unique ID of the container image node. + """ + id: ID! + + """ + Name of the container image. + """ + name: String! + + """ + Tag of the container image. + """ + tag: String! + + """ + Activity log associated with the container image. + """ + activityLog( """ Get the first n items in the connection. This can be used in combination with the after parameter. """ @@ -24764,6 +24945,34 @@ func (ec *executionContext) field_Application_valkeys_argsOrderBy( return zeroVal, nil } +func (ec *executionContext) field_Application_vulnerabilityFixHistory_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Application_vulnerabilityFixHistory_argsFrom(ctx, rawArgs) + if err != nil { + return nil, err + } + args["from"] = arg0 + return args, nil +} +func (ec *executionContext) field_Application_vulnerabilityFixHistory_argsFrom( + ctx context.Context, + rawArgs map[string]any, +) (scalar.Date, error) { + if _, ok := rawArgs["from"]; !ok { + var zeroVal scalar.Date + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("from")) + if tmp, ok := rawArgs["from"]; ok { + return ec.unmarshalNDate2githubᚗcomᚋnaisᚋapiᚋinternalᚋgraphᚋscalarᚐDate(ctx, tmp) + } + + var zeroVal scalar.Date + return zeroVal, nil +} + func (ec *executionContext) field_BigQueryDataset_access_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -26405,6 +26614,34 @@ func (ec *executionContext) field_Job_valkeys_argsOrderBy( return zeroVal, nil } +func (ec *executionContext) field_Job_vulnerabilityFixHistory_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Job_vulnerabilityFixHistory_argsFrom(ctx, rawArgs) + if err != nil { + return nil, err + } + args["from"] = arg0 + return args, nil +} +func (ec *executionContext) field_Job_vulnerabilityFixHistory_argsFrom( + ctx context.Context, + rawArgs map[string]any, +) (scalar.Date, error) { + if _, ok := rawArgs["from"]; !ok { + var zeroVal scalar.Date + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("from")) + if tmp, ok := rawArgs["from"]; ok { + return ec.unmarshalNDate2githubᚗcomᚋnaisᚋapiᚋinternalᚋgraphᚋscalarᚐDate(ctx, tmp) + } + + var zeroVal scalar.Date + return zeroVal, nil +} + func (ec *executionContext) field_KafkaTopic_acl_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -29306,6 +29543,34 @@ func (ec *executionContext) field_Query_users_argsOrderBy( return zeroVal, nil } +func (ec *executionContext) field_Query_vulnerabilityFixHistory_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Query_vulnerabilityFixHistory_argsFrom(ctx, rawArgs) + if err != nil { + return nil, err + } + args["from"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query_vulnerabilityFixHistory_argsFrom( + ctx context.Context, + rawArgs map[string]any, +) (scalar.Date, error) { + if _, ok := rawArgs["from"]; !ok { + var zeroVal scalar.Date + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("from")) + if tmp, ok := rawArgs["from"]; ok { + return ec.unmarshalNDate2githubᚗcomᚋnaisᚋapiᚋinternalᚋgraphᚋscalarᚐDate(ctx, tmp) + } + + var zeroVal scalar.Date + return zeroVal, nil +} + func (ec *executionContext) field_Reconciler_activityLog_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -32971,6 +33236,34 @@ func (ec *executionContext) field_Team_valkeys_argsOrderBy( return zeroVal, nil } +func (ec *executionContext) field_Team_vulnerabilityFixHistory_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Team_vulnerabilityFixHistory_argsFrom(ctx, rawArgs) + if err != nil { + return nil, err + } + args["from"] = arg0 + return args, nil +} +func (ec *executionContext) field_Team_vulnerabilityFixHistory_argsFrom( + ctx context.Context, + rawArgs map[string]any, +) (scalar.Date, error) { + if _, ok := rawArgs["from"]; !ok { + var zeroVal scalar.Date + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("from")) + if tmp, ok := rawArgs["from"]; ok { + return ec.unmarshalNDate2githubᚗcomᚋnaisᚋapiᚋinternalᚋgraphᚋscalarᚐDate(ctx, tmp) + } + + var zeroVal scalar.Date + return zeroVal, nil +} + func (ec *executionContext) field_Team_vulnerabilitySummaries_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -35256,6 +35549,8 @@ func (ec *executionContext) fieldContext_Application_team(_ context.Context, fie return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -36742,6 +37037,65 @@ func (ec *executionContext) fieldContext_Application_imageVulnerabilityHistory(c return fc, nil } +func (ec *executionContext) _Application_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField, obj *application.Application) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Application_vulnerabilityFixHistory(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Application().VulnerabilityFixHistory(rctx, obj, fc.Args["from"].(scalar.Date)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*vulnerability.VulnerabilityFixHistory) + fc.Result = res + return ec.marshalNVulnerabilityFixHistory2ᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Application_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Application", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "samples": + return ec.fieldContext_VulnerabilityFixHistory_samples(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VulnerabilityFixHistory", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Application_vulnerabilityFixHistory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _ApplicationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *pagination.Connection[*application.Application]) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ApplicationConnection_pageInfo(ctx, field) if err != nil { @@ -36897,6 +37251,8 @@ func (ec *executionContext) fieldContext_ApplicationConnection_nodes(_ context.C return ec.fieldContext_Application_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Application_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Application_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Application", field.Name) }, @@ -37442,6 +37798,8 @@ func (ec *executionContext) fieldContext_ApplicationEdge_node(_ context.Context, return ec.fieldContext_Application_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Application_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Application_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Application", field.Name) }, @@ -39628,6 +39986,8 @@ func (ec *executionContext) fieldContext_BigQueryDataset_team(_ context.Context, return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -41050,6 +41410,8 @@ func (ec *executionContext) fieldContext_Bucket_team(_ context.Context, field gr return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -43546,6 +43908,8 @@ func (ec *executionContext) fieldContext_CreateTeamPayload_team(_ context.Contex return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -43898,6 +44262,8 @@ func (ec *executionContext) fieldContext_DeleteApplicationPayload_team(_ context return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -44058,6 +44424,8 @@ func (ec *executionContext) fieldContext_DeleteJobPayload_team(_ context.Context return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -46921,6 +47289,8 @@ func (ec *executionContext) fieldContext_DeprecatedIngressIssue_application(_ co return ec.fieldContext_Application_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Application_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Application_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Application", field.Name) }, @@ -48122,6 +48492,8 @@ func (ec *executionContext) fieldContext_FailedJobRunsIssue_job(_ context.Contex return ec.fieldContext_Job_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Job_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Job_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Job", field.Name) }, @@ -51384,6 +51756,8 @@ func (ec *executionContext) fieldContext_Job_team(_ context.Context, field graph return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -52803,6 +53177,65 @@ func (ec *executionContext) fieldContext_Job_imageVulnerabilityHistory(ctx conte return fc, nil } +func (ec *executionContext) _Job_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField, obj *job.Job) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Job_vulnerabilityFixHistory(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Job().VulnerabilityFixHistory(rctx, obj, fc.Args["from"].(scalar.Date)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*vulnerability.VulnerabilityFixHistory) + fc.Result = res + return ec.marshalNVulnerabilityFixHistory2ᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Job_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Job", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "samples": + return ec.fieldContext_VulnerabilityFixHistory_samples(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VulnerabilityFixHistory", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Job_vulnerabilityFixHistory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _JobConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *pagination.Connection[*job.Job]) (ret graphql.Marshaler) { fc, err := ec.fieldContext_JobConnection_pageInfo(ctx, field) if err != nil { @@ -52956,6 +53389,8 @@ func (ec *executionContext) fieldContext_JobConnection_nodes(_ context.Context, return ec.fieldContext_Job_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Job_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Job_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Job", field.Name) }, @@ -53499,6 +53934,8 @@ func (ec *executionContext) fieldContext_JobEdge_node(_ context.Context, field g return ec.fieldContext_Job_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Job_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Job_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Job", field.Name) }, @@ -55656,6 +56093,8 @@ func (ec *executionContext) fieldContext_KafkaTopic_team(_ context.Context, fiel return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -56237,6 +56676,8 @@ func (ec *executionContext) fieldContext_KafkaTopicAcl_team(_ context.Context, f return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -60681,6 +61122,8 @@ func (ec *executionContext) fieldContext_NetworkPolicyRule_targetTeam(_ context. return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -61193,6 +61636,8 @@ func (ec *executionContext) fieldContext_OpenSearch_team(_ context.Context, fiel return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -65813,6 +66258,8 @@ func (ec *executionContext) fieldContext_PrometheusAlert_team(_ context.Context, return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -66984,6 +67431,8 @@ func (ec *executionContext) fieldContext_Query_team(ctx context.Context, field g return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -67433,6 +67882,65 @@ func (ec *executionContext) fieldContext_Query_vulnerabilitySummary(_ context.Co return fc, nil } +func (ec *executionContext) _Query_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_vulnerabilityFixHistory(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().VulnerabilityFixHistory(rctx, fc.Args["from"].(scalar.Date)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*vulnerability.VulnerabilityFixHistory) + fc.Result = res + return ec.marshalNVulnerabilityFixHistory2ᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "samples": + return ec.fieldContext_VulnerabilityFixHistory_samples(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VulnerabilityFixHistory", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_vulnerabilityFixHistory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Query___type(ctx, field) if err != nil { @@ -69983,6 +70491,8 @@ func (ec *executionContext) fieldContext_ReconcilerError_team(_ context.Context, return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -70529,6 +71039,8 @@ func (ec *executionContext) fieldContext_RemoveTeamMemberPayload_team(_ context. return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -70739,6 +71251,8 @@ func (ec *executionContext) fieldContext_Repository_team(_ context.Context, fiel return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -71849,6 +72363,8 @@ func (ec *executionContext) fieldContext_RestartApplicationPayload_application(_ return ec.fieldContext_Application_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Application_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Application_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Application", field.Name) }, @@ -74465,6 +74981,8 @@ func (ec *executionContext) fieldContext_Secret_team(_ context.Context, field gr return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -77579,6 +78097,8 @@ func (ec *executionContext) fieldContext_ServiceAccount_team(_ context.Context, return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -82109,6 +82629,8 @@ func (ec *executionContext) fieldContext_SqlDatabase_team(_ context.Context, fie return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -82650,6 +83172,8 @@ func (ec *executionContext) fieldContext_SqlInstance_team(_ context.Context, fie return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -88714,6 +89238,65 @@ func (ec *executionContext) fieldContext_Team_vulnerabilitySummaries(ctx context return fc, nil } +func (ec *executionContext) _Team_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField, obj *team.Team) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Team().VulnerabilityFixHistory(rctx, obj, fc.Args["from"].(scalar.Date)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*vulnerability.VulnerabilityFixHistory) + fc.Result = res + return ec.marshalNVulnerabilityFixHistory2ᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixHistory(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Team_vulnerabilityFixHistory(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Team", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "samples": + return ec.fieldContext_VulnerabilityFixHistory_samples(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VulnerabilityFixHistory", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Team_vulnerabilityFixHistory_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Team_workloads(ctx context.Context, field graphql.CollectedField, obj *team.Team) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Team_workloads(ctx, field) if err != nil { @@ -89343,6 +89926,8 @@ func (ec *executionContext) fieldContext_TeamConnection_nodes(_ context.Context, return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -90792,6 +91377,8 @@ func (ec *executionContext) fieldContext_TeamDeleteKey_team(_ context.Context, f return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -91307,6 +91894,8 @@ func (ec *executionContext) fieldContext_TeamEdge_node(_ context.Context, field return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -91646,6 +92235,8 @@ func (ec *executionContext) fieldContext_TeamEnvironment_team(_ context.Context, return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -91813,6 +92404,8 @@ func (ec *executionContext) fieldContext_TeamEnvironment_application(ctx context return ec.fieldContext_Application_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Application_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Application_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Application", field.Name) }, @@ -92178,6 +92771,8 @@ func (ec *executionContext) fieldContext_TeamEnvironment_job(ctx context.Context return ec.fieldContext_Job_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Job_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Job_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Job", field.Name) }, @@ -94630,6 +95225,8 @@ func (ec *executionContext) fieldContext_TeamMember_team(_ context.Context, fiel return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -97844,6 +98441,8 @@ func (ec *executionContext) fieldContext_TeamUtilizationData_team(_ context.Cont return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -99069,6 +99668,8 @@ func (ec *executionContext) fieldContext_TriggerJobPayload_job(_ context.Context return ec.fieldContext_Job_valkeys(ctx, field) case "imageVulnerabilityHistory": return ec.fieldContext_Job_imageVulnerabilityHistory(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Job_vulnerabilityFixHistory(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Job", field.Name) }, @@ -101267,6 +101868,8 @@ func (ec *executionContext) fieldContext_UpdateTeamPayload_team(_ context.Contex return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -103406,6 +104009,8 @@ func (ec *executionContext) fieldContext_Valkey_team(_ context.Context, field gr return ec.fieldContext_Team_vulnerabilitySummary(ctx, field) case "vulnerabilitySummaries": return ec.fieldContext_Team_vulnerabilitySummaries(ctx, field) + case "vulnerabilityFixHistory": + return ec.fieldContext_Team_vulnerabilityFixHistory(ctx, field) case "workloads": return ec.fieldContext_Team_workloads(ctx, field) } @@ -107153,6 +107758,368 @@ func (ec *executionContext) fieldContext_VulnerabilityActivityLogEntryData_newSu return fc, nil } +func (ec *executionContext) _VulnerabilityFixHistory_samples(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixHistory) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixHistory_samples(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Samples, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*vulnerability.VulnerabilityFixSample) + fc.Result = res + return ec.marshalNVulnerabilityFixSample2ᚕᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixSampleᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixHistory_samples(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixHistory", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "severity": + return ec.fieldContext_VulnerabilityFixSample_severity(ctx, field) + case "date": + return ec.fieldContext_VulnerabilityFixSample_date(ctx, field) + case "days": + return ec.fieldContext_VulnerabilityFixSample_days(ctx, field) + case "fixedCount": + return ec.fieldContext_VulnerabilityFixSample_fixedCount(ctx, field) + case "firstFixedAt": + return ec.fieldContext_VulnerabilityFixSample_firstFixedAt(ctx, field) + case "lastFixedAt": + return ec.fieldContext_VulnerabilityFixSample_lastFixedAt(ctx, field) + case "totalWorkloads": + return ec.fieldContext_VulnerabilityFixSample_totalWorkloads(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type VulnerabilityFixSample", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _VulnerabilityFixSample_severity(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixSample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixSample_severity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Severity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(vulnerability.ImageVulnerabilitySeverity) + fc.Result = res + return ec.marshalNImageVulnerabilitySeverity2githubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐImageVulnerabilitySeverity(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixSample_severity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixSample", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ImageVulnerabilitySeverity does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VulnerabilityFixSample_date(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixSample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixSample_date(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Date, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixSample_date(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixSample", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VulnerabilityFixSample_days(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixSample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixSample_days(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Days, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixSample_days(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixSample", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VulnerabilityFixSample_fixedCount(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixSample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixSample_fixedCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.FixedCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixSample_fixedCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixSample", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VulnerabilityFixSample_firstFixedAt(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixSample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixSample_firstFixedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.FirstFixedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixSample_firstFixedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixSample", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VulnerabilityFixSample_lastFixedAt(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixSample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixSample_lastFixedAt(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastFixedAt, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixSample_lastFixedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixSample", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _VulnerabilityFixSample_totalWorkloads(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityFixSample) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_VulnerabilityFixSample_totalWorkloads(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.TotalWorkloads, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_VulnerabilityFixSample_totalWorkloads(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "VulnerabilityFixSample", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _VulnerabilityUpdatedActivityLogEntry_id(ctx context.Context, field graphql.CollectedField, obj *vulnerability.VulnerabilityUpdatedActivityLogEntry) (ret graphql.Marshaler) { fc, err := ec.fieldContext_VulnerabilityUpdatedActivityLogEntry_id(ctx, field) if err != nil { @@ -117739,220 +118706,256 @@ func (ec *executionContext) _Application(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "kafkaTopicAcls": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Application_kafkaTopicAcls(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "logDestinations": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Application_logDestinations(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "networkPolicy": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Application_networkPolicy(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "openSearch": - field := field - - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Application_openSearch(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "secrets": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Application_secrets(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "sqlInstances": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Application_sqlInstances(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "utilization": + case "kafkaTopicAcls": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Application_kafkaTopicAcls(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "logDestinations": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Application_logDestinations(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "networkPolicy": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Application_networkPolicy(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "openSearch": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Application_openSearch(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "secrets": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Application_secrets(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "sqlInstances": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Application_sqlInstances(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "utilization": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Application_utilization(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "valkeys": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -117961,7 +118964,7 @@ func (ec *executionContext) _Application(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Application_utilization(ctx, field, obj) + res = ec._Application_valkeys(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -117988,7 +118991,7 @@ func (ec *executionContext) _Application(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "valkeys": + case "imageVulnerabilityHistory": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -117997,7 +119000,7 @@ func (ec *executionContext) _Application(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Application_valkeys(ctx, field, obj) + res = ec._Application_imageVulnerabilityHistory(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -118024,7 +119027,7 @@ func (ec *executionContext) _Application(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "imageVulnerabilityHistory": + case "vulnerabilityFixHistory": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -118033,7 +119036,7 @@ func (ec *executionContext) _Application(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Application_imageVulnerabilityHistory(ctx, field, obj) + res = ec._Application_vulnerabilityFixHistory(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124047,7 +125050,43 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "state": + case "state": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Job_state(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "issues": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124056,7 +125095,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_state(ctx, field, obj) + res = ec._Job_issues(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124083,7 +125122,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "issues": + case "bigQueryDatasets": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124092,7 +125131,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_issues(ctx, field, obj) + res = ec._Job_bigQueryDatasets(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124119,7 +125158,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "bigQueryDatasets": + case "buckets": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124128,7 +125167,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_bigQueryDatasets(ctx, field, obj) + res = ec._Job_buckets(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124155,7 +125194,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "buckets": + case "cost": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124164,7 +125203,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_buckets(ctx, field, obj) + res = ec._Job_cost(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124191,7 +125230,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "cost": + case "deployments": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124200,7 +125239,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_cost(ctx, field, obj) + res = ec._Job_deployments(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124227,7 +125266,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "deployments": + case "kafkaTopicAcls": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124236,7 +125275,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_deployments(ctx, field, obj) + res = ec._Job_kafkaTopicAcls(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124263,7 +125302,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "kafkaTopicAcls": + case "logDestinations": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124272,7 +125311,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_kafkaTopicAcls(ctx, field, obj) + res = ec._Job_logDestinations(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124299,7 +125338,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "logDestinations": + case "networkPolicy": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124308,7 +125347,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_logDestinations(ctx, field, obj) + res = ec._Job_networkPolicy(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124335,19 +125374,16 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "networkPolicy": + case "openSearch": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_networkPolicy(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._Job_openSearch(ctx, field, obj) return res } @@ -124371,16 +125407,19 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "openSearch": + case "secrets": field := field - innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_openSearch(ctx, field, obj) + res = ec._Job_secrets(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -124404,7 +125443,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "secrets": + case "sqlInstances": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124413,7 +125452,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_secrets(ctx, field, obj) + res = ec._Job_sqlInstances(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124440,7 +125479,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "sqlInstances": + case "valkeys": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124449,7 +125488,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_sqlInstances(ctx, field, obj) + res = ec._Job_valkeys(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124476,7 +125515,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "valkeys": + case "imageVulnerabilityHistory": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124485,7 +125524,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_valkeys(ctx, field, obj) + res = ec._Job_imageVulnerabilityHistory(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -124512,7 +125551,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "imageVulnerabilityHistory": + case "vulnerabilityFixHistory": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -124521,7 +125560,7 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Job_imageVulnerabilityHistory(ctx, field, obj) + res = ec._Job_vulnerabilityFixHistory(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -129254,6 +130293,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "vulnerabilityFixHistory": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_vulnerabilityFixHistory(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "__type": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { @@ -136515,6 +137576,42 @@ func (ec *executionContext) _Team(ctx context.Context, sel ast.SelectionSet, obj continue } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "vulnerabilityFixHistory": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Team_vulnerabilityFixHistory(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "workloads": field := field @@ -143330,6 +144427,108 @@ func (ec *executionContext) _VulnerabilityActivityLogEntryData(ctx context.Conte return out } +var vulnerabilityFixHistoryImplementors = []string{"VulnerabilityFixHistory"} + +func (ec *executionContext) _VulnerabilityFixHistory(ctx context.Context, sel ast.SelectionSet, obj *vulnerability.VulnerabilityFixHistory) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, vulnerabilityFixHistoryImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("VulnerabilityFixHistory") + case "samples": + out.Values[i] = ec._VulnerabilityFixHistory_samples(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var vulnerabilityFixSampleImplementors = []string{"VulnerabilityFixSample"} + +func (ec *executionContext) _VulnerabilityFixSample(ctx context.Context, sel ast.SelectionSet, obj *vulnerability.VulnerabilityFixSample) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, vulnerabilityFixSampleImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("VulnerabilityFixSample") + case "severity": + out.Values[i] = ec._VulnerabilityFixSample_severity(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "date": + out.Values[i] = ec._VulnerabilityFixSample_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "days": + out.Values[i] = ec._VulnerabilityFixSample_days(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fixedCount": + out.Values[i] = ec._VulnerabilityFixSample_fixedCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "firstFixedAt": + out.Values[i] = ec._VulnerabilityFixSample_firstFixedAt(ctx, field, obj) + case "lastFixedAt": + out.Values[i] = ec._VulnerabilityFixSample_lastFixedAt(ctx, field, obj) + case "totalWorkloads": + out.Values[i] = ec._VulnerabilityFixSample_totalWorkloads(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var vulnerabilityUpdatedActivityLogEntryImplementors = []string{"VulnerabilityUpdatedActivityLogEntry", "ActivityLogEntry", "Node"} func (ec *executionContext) _VulnerabilityUpdatedActivityLogEntry(ctx context.Context, sel ast.SelectionSet, obj *vulnerability.VulnerabilityUpdatedActivityLogEntry) graphql.Marshaler { @@ -153535,6 +154734,74 @@ func (ec *executionContext) marshalNVulnerabilityActivityLogEntryData2ᚖgithub return ec._VulnerabilityActivityLogEntryData(ctx, sel, v) } +func (ec *executionContext) marshalNVulnerabilityFixHistory2githubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixHistory(ctx context.Context, sel ast.SelectionSet, v vulnerability.VulnerabilityFixHistory) graphql.Marshaler { + return ec._VulnerabilityFixHistory(ctx, sel, &v) +} + +func (ec *executionContext) marshalNVulnerabilityFixHistory2ᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixHistory(ctx context.Context, sel ast.SelectionSet, v *vulnerability.VulnerabilityFixHistory) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._VulnerabilityFixHistory(ctx, sel, v) +} + +func (ec *executionContext) marshalNVulnerabilityFixSample2ᚕᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixSampleᚄ(ctx context.Context, sel ast.SelectionSet, v []*vulnerability.VulnerabilityFixSample) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNVulnerabilityFixSample2ᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixSample(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNVulnerabilityFixSample2ᚖgithubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilityFixSample(ctx context.Context, sel ast.SelectionSet, v *vulnerability.VulnerabilityFixSample) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._VulnerabilityFixSample(ctx, sel, v) +} + func (ec *executionContext) unmarshalNVulnerabilitySummaryOrderByField2githubᚗcomᚋnaisᚋapiᚋinternalᚋvulnerabilityᚐVulnerabilitySummaryOrderByField(ctx context.Context, v any) (vulnerability.VulnerabilitySummaryOrderByField, error) { var res vulnerability.VulnerabilitySummaryOrderByField err := res.UnmarshalGQL(v) diff --git a/internal/graph/schema/vulnerability.graphqls b/internal/graph/schema/vulnerability.graphqls index 7e8d6bc38..097c91f36 100644 --- a/internal/graph/schema/vulnerability.graphqls +++ b/internal/graph/schema/vulnerability.graphqls @@ -545,3 +545,58 @@ extend enum ActivityLogActivityType { "Activity log entry for when a vulnerability is updated." VULNERABILITY_UPDATED } + +extend type Query { + "Get the mean time to fix history for all teams." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! +} + +extend interface Workload { + "Get the mean time to fix history for a workload." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! +} + +extend type Application { + "Get the mean time to fix history for an application." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! +} + +extend type Job { + "Get the mean time to fix history for a job." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! +} + +extend type Team { + "Get the mean time to fix history for a team." + vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! +} + +"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 { + "Severity of vulnerabilities in this sample." + severity: ImageVulnerabilitySeverity! + + "Snapshot date of the sample." + date: Time! + + "Mean time to fix in days." + days: Int! + + "Number of vulnerabilities fixed in this sample." + fixedCount: Int! + + "Earliest time a vulnerability was fixed in this sample." + firstFixedAt: Time + + "Latest time a vulnerability was fixed in this sample." + lastFixedAt: Time + + "Total number of workloads with this severity of vulnerabilities." + totalWorkloads: Int! +} diff --git a/internal/graph/vulnerability.resolvers.go b/internal/graph/vulnerability.resolvers.go index 97e5748c4..131e2facc 100644 --- a/internal/graph/vulnerability.resolvers.go +++ b/internal/graph/vulnerability.resolvers.go @@ -20,6 +20,10 @@ func (r *applicationResolver) ImageVulnerabilityHistory(ctx context.Context, obj return vulnerability.GetWorkloadVulnerabilityHistoryForWorkload(ctx, obj, from.Time()) } +func (r *applicationResolver) VulnerabilityFixHistory(ctx context.Context, obj *application.Application, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) { + return vulnerability.GetVulnerabilityMeanTimeToFixHistoryForWorkload(ctx, obj, from.Time()) +} + func (r *containerImageResolver) HasSbom(ctx context.Context, obj *workload.ContainerImage) (bool, error) { return vulnerability.GetImageHasSBOM(ctx, obj.Ref()) } @@ -54,6 +58,10 @@ func (r *jobResolver) ImageVulnerabilityHistory(ctx context.Context, obj *job.Jo return vulnerability.GetWorkloadVulnerabilityHistoryForWorkload(ctx, obj, from.Time()) } +func (r *jobResolver) VulnerabilityFixHistory(ctx context.Context, obj *job.Job, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) { + return vulnerability.GetVulnerabilityMeanTimeToFixHistoryForWorkload(ctx, obj, from.Time()) +} + func (r *mutationResolver) UpdateImageVulnerability(ctx context.Context, input vulnerability.UpdateImageVulnerabilityInput) (*vulnerability.UpdateImageVulnerabilityPayload, error) { vulnWorkloads, err := vulnerability.ListWorkloadsForVulnerabilityByID(ctx, input.VulnerabilityID.ID) if err != nil { @@ -83,6 +91,10 @@ func (r *queryResolver) VulnerabilitySummary(ctx context.Context) (*vulnerabilit return vulnerability.GetTenantVulnerabilitySummary(ctx) } +func (r *queryResolver) VulnerabilityFixHistory(ctx context.Context, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) { + return vulnerability.GetVulnerabilityMeanTimeToFixHistory(ctx, from.Time()) +} + func (r *teamResolver) ImageVulnerabilityHistory(ctx context.Context, obj *team.Team, from scalar.Date) (*vulnerability.ImageVulnerabilityHistory, error) { return vulnerability.GetWorkloadVulnerabilityHistoryForTeam(ctx, obj.Slug, from.Time()) } @@ -100,6 +112,10 @@ func (r *teamResolver) VulnerabilitySummaries(ctx context.Context, obj *team.Tea return vulnerability.ListVulnerabilitySummaries(ctx, obj.Slug, filter, page, orderBy) } +func (r *teamResolver) VulnerabilityFixHistory(ctx context.Context, obj *team.Team, from scalar.Date) (*vulnerability.VulnerabilityFixHistory, error) { + return vulnerability.GetVulnerabilityMeanTimeToFixHistoryForTeam(ctx, obj.Slug, from.Time()) +} + func (r *teamVulnerabilitySummaryResolver) RiskScoreTrend(ctx context.Context, obj *vulnerability.TeamVulnerabilitySummary) (vulnerability.TeamVulnerabilityRiskScoreTrend, error) { return vulnerability.GetTeamRiskScoreTrend(ctx, obj.TeamSlug) } diff --git a/internal/vulnerability/models.go b/internal/vulnerability/models.go index b39290fd4..7b5cf36cf 100644 --- a/internal/vulnerability/models.go +++ b/internal/vulnerability/models.go @@ -376,3 +376,17 @@ type TenantVulnerabilitySummary struct { Coverage float64 `json:"coverage"` LastUpdated *time.Time `json:"lastUpdated"` } + +type VulnerabilityFixHistory struct { + Samples []*VulnerabilityFixSample `json:"samples"` +} + +type VulnerabilityFixSample struct { + Severity ImageVulnerabilitySeverity `json:"severity"` + Date time.Time `json:"date"` + Days int `json:"days"` + FixedCount int `json:"fixedCount"` + FirstFixedAt *time.Time `json:"firstFixedAt,omitempty"` + LastFixedAt *time.Time `json:"lastFixedAt,omitempty"` + TotalWorkloads int `json:"totalWorkloads"` +} diff --git a/internal/vulnerability/queries.go b/internal/vulnerability/queries.go index 8de92272b..5c94bc273 100644 --- a/internal/vulnerability/queries.go +++ b/internal/vulnerability/queries.go @@ -557,6 +557,111 @@ func GetVulnerabilitySummary(ctx context.Context, s slug.Slug, filter *TeamVulne }, nil } +func GetVulnerabilityMeanTimeToFixHistoryForWorkload(ctx context.Context, obj workload.Workload, from time.Time) (*VulnerabilityFixHistory, error) { + workloadType, err := getWorkloadType(obj.GetType()) + if err != nil { + return nil, err + } + + if from.Before(time.Now().AddDate(-1, 0, 0)) { + return nil, apierror.Errorf("`from` cannot be older than 1 year") + } + if from.After(time.Now()) { + return nil, apierror.Errorf("`from` cannot be in the future") + } + + since := normalizeFromDate(from) + opts := []vulnerabilities.Option{ + vulnerabilities.Since(since), + vulnerabilities.ClusterFilter(environmentmapper.ClusterName(obj.GetEnvironmentName())), + vulnerabilities.NamespaceFilter(obj.GetTeamSlug().String()), + vulnerabilities.WorkloadFilter(obj.GetName()), + vulnerabilities.WorkloadTypeFilter(workloadType), + } + + return getVulnerabilityMeanTimeToFixHistory(ctx, opts) +} + +func GetVulnerabilityMeanTimeToFixHistoryForTeam(ctx context.Context, slug slug.Slug, from time.Time) (*VulnerabilityFixHistory, error) { + if from.Before(time.Now().AddDate(-1, 0, 0)) { + return nil, apierror.Errorf("`from` cannot be older than 1 year") + } + if from.After(time.Now()) { + return nil, apierror.Errorf("`from` cannot be in the future") + } + + since := normalizeFromDate(from) + + opts := []vulnerabilities.Option{} + opts = append(opts, vulnerabilities.Since(since)) + opts = append(opts, vulnerabilities.NamespaceFilter(slug.String())) + + return getVulnerabilityMeanTimeToFixHistory(ctx, opts) +} + +func GetVulnerabilityMeanTimeToFixHistory(ctx context.Context, from time.Time) (*VulnerabilityFixHistory, error) { + var opts []vulnerabilities.Option + opts = append(opts, vulnerabilities.Since(from)) + return getVulnerabilityMeanTimeToFixHistory(ctx, opts) +} + +func getVulnerabilityMeanTimeToFixHistory(ctx context.Context, opts []vulnerabilities.Option) (*VulnerabilityFixHistory, error) { + resp, err := fromContext(ctx).Client.ListMeanTimeToFixTrendBySeverity(ctx, opts...) + if err != nil { + return nil, apierror.Errorf("list mean time to fix trend by severity: %v", err) + } + + samples := make([]*VulnerabilityFixSample, 0, len(resp.GetPoints())) + for _, point := range resp.GetPoints() { + firstFixedAt := point.GetFirstFixedAt().AsTime() + lastFixedAt := point.GetLastFixedAt().AsTime() + sample := &VulnerabilityFixSample{ + Severity: parseSeverity(point.Severity), + Date: point.SnapshotDate.AsTime(), + Days: int(point.GetMeanTimeToFixDays()), + FixedCount: int(point.FixedCount), + FirstFixedAt: &firstFixedAt, + LastFixedAt: &lastFixedAt, + TotalWorkloads: int(point.WorkloadCount), + } + samples = append(samples, sample) + } + + sort.Slice(samples, func(i, j int) bool { + return samples[i].Date.After(samples[j].Date) + }) + + return &VulnerabilityFixHistory{ + Samples: samples, + }, nil +} + +func getWorkloadType(workloadType workload.Type) (string, error) { + switch workloadType { + case workload.TypeApplication: + return "app", nil + case workload.TypeJob: + return "job", nil + default: + return "", apierror.Errorf("invalid workload type: %s", workloadType) + } +} + +func parseSeverity(s vulnerabilities.Severity) ImageVulnerabilitySeverity { + switch s { + case vulnerabilities.Severity_CRITICAL: + return ImageVulnerabilitySeverityCritical + case vulnerabilities.Severity_HIGH: + return ImageVulnerabilitySeverityHigh + case vulnerabilities.Severity_MEDIUM: + return ImageVulnerabilitySeverityMedium + case vulnerabilities.Severity_LOW: + return ImageVulnerabilitySeverityLow + default: + return ImageVulnerabilitySeverityUnassigned + } +} + func getVulnerabilityByIdent(ctx context.Context, id ident.Ident) (*ImageVulnerability, error) { resp, err := fromContext(ctx).Client.GetVulnerabilityById(ctx, id.ID) if err != nil {