mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-11-04 01:25:06 +01:00 
			
		
		
		
	Merge branch 'master' into 40_45_82_update_roles
This commit is contained in:
		@@ -88,6 +88,7 @@ type ComplexityRoot struct {
 | 
			
		||||
		Exclusive        func(childComplexity int) int
 | 
			
		||||
		ID               func(childComplexity int) int
 | 
			
		||||
		JobID            func(childComplexity int) int
 | 
			
		||||
		JobName          func(childComplexity int) int
 | 
			
		||||
		MetaData         func(childComplexity int) int
 | 
			
		||||
		MonitoringStatus func(childComplexity int) int
 | 
			
		||||
		NumAcc           func(childComplexity int) int
 | 
			
		||||
@@ -130,6 +131,7 @@ type ComplexityRoot struct {
 | 
			
		||||
		HistDuration   func(childComplexity int) int
 | 
			
		||||
		HistNumNodes   func(childComplexity int) int
 | 
			
		||||
		ID             func(childComplexity int) int
 | 
			
		||||
		Name           func(childComplexity int) int
 | 
			
		||||
		ShortJobs      func(childComplexity int) int
 | 
			
		||||
		TotalCoreHours func(childComplexity int) int
 | 
			
		||||
		TotalJobs      func(childComplexity int) int
 | 
			
		||||
@@ -263,6 +265,8 @@ type ClusterResolver interface {
 | 
			
		||||
	Partitions(ctx context.Context, obj *schema.Cluster) ([]string, error)
 | 
			
		||||
}
 | 
			
		||||
type JobResolver interface {
 | 
			
		||||
	JobName(ctx context.Context, obj *schema.Job) (*string, error)
 | 
			
		||||
 | 
			
		||||
	Tags(ctx context.Context, obj *schema.Job) ([]*schema.Tag, error)
 | 
			
		||||
 | 
			
		||||
	MetaData(ctx context.Context, obj *schema.Job) (interface{}, error)
 | 
			
		||||
@@ -452,6 +456,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
 | 
			
		||||
 | 
			
		||||
		return e.complexity.Job.JobID(childComplexity), true
 | 
			
		||||
 | 
			
		||||
	case "Job.jobName":
 | 
			
		||||
		if e.complexity.Job.JobName == nil {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return e.complexity.Job.JobName(childComplexity), true
 | 
			
		||||
 | 
			
		||||
	case "Job.metaData":
 | 
			
		||||
		if e.complexity.Job.MetaData == nil {
 | 
			
		||||
			break
 | 
			
		||||
@@ -662,6 +673,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
 | 
			
		||||
 | 
			
		||||
		return e.complexity.JobsStatistics.ID(childComplexity), true
 | 
			
		||||
 | 
			
		||||
	case "JobsStatistics.name":
 | 
			
		||||
		if e.complexity.JobsStatistics.Name == nil {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return e.complexity.JobsStatistics.Name(childComplexity), true
 | 
			
		||||
 | 
			
		||||
	case "JobsStatistics.shortJobs":
 | 
			
		||||
		if e.complexity.JobsStatistics.ShortJobs == nil {
 | 
			
		||||
			break
 | 
			
		||||
@@ -1391,6 +1409,7 @@ type Job {
 | 
			
		||||
  jobId:            Int!
 | 
			
		||||
  user:             String!
 | 
			
		||||
  project:          String!
 | 
			
		||||
  jobName:          String
 | 
			
		||||
  cluster:          String!
 | 
			
		||||
  subCluster:       String!
 | 
			
		||||
  startTime:        Time!
 | 
			
		||||
@@ -1578,14 +1597,15 @@ type IntRangeOutput { from: Int!, to: Int! }
 | 
			
		||||
type TimeRangeOutput { from: Time!, to: Time! }
 | 
			
		||||
 | 
			
		||||
input JobFilter {
 | 
			
		||||
  tags:         [ID!]
 | 
			
		||||
  jobId:        StringInput
 | 
			
		||||
  arrayJobId:   Int
 | 
			
		||||
  user:         StringInput
 | 
			
		||||
  project:      StringInput
 | 
			
		||||
  cluster:      StringInput
 | 
			
		||||
  partition:    StringInput
 | 
			
		||||
  duration:     IntRange
 | 
			
		||||
  tags:        [ID!]
 | 
			
		||||
  jobId:       StringInput
 | 
			
		||||
  arrayJobId:  Int
 | 
			
		||||
  user:        StringInput
 | 
			
		||||
  project:     StringInput
 | 
			
		||||
  jobName:     StringInput
 | 
			
		||||
  cluster:     StringInput
 | 
			
		||||
  partition:   StringInput
 | 
			
		||||
  duration:    IntRange
 | 
			
		||||
 | 
			
		||||
  minRunningFor: Int
 | 
			
		||||
 | 
			
		||||
@@ -1616,6 +1636,7 @@ input StringInput {
 | 
			
		||||
  contains:   String
 | 
			
		||||
  startsWith: String
 | 
			
		||||
  endsWith:   String
 | 
			
		||||
  in:         [String!]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
input IntRange   { from: Int!,   to: Int! }
 | 
			
		||||
@@ -1636,6 +1657,7 @@ type HistoPoint {
 | 
			
		||||
 | 
			
		||||
type JobsStatistics  {
 | 
			
		||||
  id:             ID!            # If ` + "`" + `groupBy` + "`" + ` was used, ID of the user/project/cluster
 | 
			
		||||
  name:           String         # if User-Statistics: Given Name of Account (ID) Owner
 | 
			
		||||
  totalJobs:      Int!           # Number of jobs that matched
 | 
			
		||||
  shortJobs:      Int!           # Number of jobs with a duration of less than 2 minutes
 | 
			
		||||
  totalWalltime:  Int!           # Sum of the duration of all matched jobs in hours
 | 
			
		||||
@@ -3038,6 +3060,47 @@ func (ec *executionContext) fieldContext_Job_project(ctx context.Context, field
 | 
			
		||||
	return fc, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ec *executionContext) _Job_jobName(ctx context.Context, field graphql.CollectedField, obj *schema.Job) (ret graphql.Marshaler) {
 | 
			
		||||
	fc, err := ec.fieldContext_Job_jobName(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) (interface{}, error) {
 | 
			
		||||
		ctx = rctx // use context from middleware stack in children
 | 
			
		||||
		return ec.resolvers.Job().JobName(rctx, obj)
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		ec.Error(ctx, err)
 | 
			
		||||
		return graphql.Null
 | 
			
		||||
	}
 | 
			
		||||
	if resTmp == nil {
 | 
			
		||||
		return graphql.Null
 | 
			
		||||
	}
 | 
			
		||||
	res := resTmp.(*string)
 | 
			
		||||
	fc.Result = res
 | 
			
		||||
	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ec *executionContext) fieldContext_Job_jobName(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) {
 | 
			
		||||
			return nil, errors.New("field of type String does not have child fields")
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
	return fc, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ec *executionContext) _Job_cluster(ctx context.Context, field graphql.CollectedField, obj *schema.Job) (ret graphql.Marshaler) {
 | 
			
		||||
	fc, err := ec.fieldContext_Job_cluster(ctx, field)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
@@ -4231,6 +4294,8 @@ func (ec *executionContext) fieldContext_JobResultList_items(ctx context.Context
 | 
			
		||||
				return ec.fieldContext_Job_user(ctx, field)
 | 
			
		||||
			case "project":
 | 
			
		||||
				return ec.fieldContext_Job_project(ctx, field)
 | 
			
		||||
			case "jobName":
 | 
			
		||||
				return ec.fieldContext_Job_jobName(ctx, field)
 | 
			
		||||
			case "cluster":
 | 
			
		||||
				return ec.fieldContext_Job_cluster(ctx, field)
 | 
			
		||||
			case "subCluster":
 | 
			
		||||
@@ -4441,6 +4506,47 @@ func (ec *executionContext) fieldContext_JobsStatistics_id(ctx context.Context,
 | 
			
		||||
	return fc, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ec *executionContext) _JobsStatistics_name(ctx context.Context, field graphql.CollectedField, obj *model.JobsStatistics) (ret graphql.Marshaler) {
 | 
			
		||||
	fc, err := ec.fieldContext_JobsStatistics_name(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) (interface{}, error) {
 | 
			
		||||
		ctx = rctx // use context from middleware stack in children
 | 
			
		||||
		return obj.Name, nil
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		ec.Error(ctx, err)
 | 
			
		||||
		return graphql.Null
 | 
			
		||||
	}
 | 
			
		||||
	if resTmp == nil {
 | 
			
		||||
		return graphql.Null
 | 
			
		||||
	}
 | 
			
		||||
	res := resTmp.(*string)
 | 
			
		||||
	fc.Result = res
 | 
			
		||||
	return ec.marshalOString2ᚖstring(ctx, field.Selections, res)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ec *executionContext) fieldContext_JobsStatistics_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
 | 
			
		||||
	fc = &graphql.FieldContext{
 | 
			
		||||
		Object:     "JobsStatistics",
 | 
			
		||||
		Field:      field,
 | 
			
		||||
		IsMethod:   false,
 | 
			
		||||
		IsResolver: false,
 | 
			
		||||
		Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
 | 
			
		||||
			return nil, errors.New("field of type String does not have child fields")
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
	return fc, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ec *executionContext) _JobsStatistics_totalJobs(ctx context.Context, field graphql.CollectedField, obj *model.JobsStatistics) (ret graphql.Marshaler) {
 | 
			
		||||
	fc, err := ec.fieldContext_JobsStatistics_totalJobs(ctx, field)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
@@ -6078,6 +6184,8 @@ func (ec *executionContext) fieldContext_Query_job(ctx context.Context, field gr
 | 
			
		||||
				return ec.fieldContext_Job_user(ctx, field)
 | 
			
		||||
			case "project":
 | 
			
		||||
				return ec.fieldContext_Job_project(ctx, field)
 | 
			
		||||
			case "jobName":
 | 
			
		||||
				return ec.fieldContext_Job_jobName(ctx, field)
 | 
			
		||||
			case "cluster":
 | 
			
		||||
				return ec.fieldContext_Job_cluster(ctx, field)
 | 
			
		||||
			case "subCluster":
 | 
			
		||||
@@ -6357,6 +6465,8 @@ func (ec *executionContext) fieldContext_Query_jobsStatistics(ctx context.Contex
 | 
			
		||||
			switch field.Name {
 | 
			
		||||
			case "id":
 | 
			
		||||
				return ec.fieldContext_JobsStatistics_id(ctx, field)
 | 
			
		||||
			case "name":
 | 
			
		||||
				return ec.fieldContext_JobsStatistics_name(ctx, field)
 | 
			
		||||
			case "totalJobs":
 | 
			
		||||
				return ec.fieldContext_JobsStatistics_totalJobs(ctx, field)
 | 
			
		||||
			case "shortJobs":
 | 
			
		||||
@@ -10389,7 +10499,7 @@ func (ec *executionContext) unmarshalInputJobFilter(ctx context.Context, obj int
 | 
			
		||||
		asMap[k] = v
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fieldsInOrder := [...]string{"tags", "jobId", "arrayJobId", "user", "project", "cluster", "partition", "duration", "minRunningFor", "numNodes", "numAccelerators", "numHWThreads", "startTime", "state", "flopsAnyAvg", "memBwAvg", "loadAvg", "memUsedMax"}
 | 
			
		||||
	fieldsInOrder := [...]string{"tags", "jobId", "arrayJobId", "user", "project", "jobName", "cluster", "partition", "duration", "minRunningFor", "numNodes", "numAccelerators", "numHWThreads", "startTime", "state", "flopsAnyAvg", "memBwAvg", "loadAvg", "memUsedMax"}
 | 
			
		||||
	for _, k := range fieldsInOrder {
 | 
			
		||||
		v, ok := asMap[k]
 | 
			
		||||
		if !ok {
 | 
			
		||||
@@ -10436,6 +10546,14 @@ func (ec *executionContext) unmarshalInputJobFilter(ctx context.Context, obj int
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return it, err
 | 
			
		||||
			}
 | 
			
		||||
		case "jobName":
 | 
			
		||||
			var err error
 | 
			
		||||
 | 
			
		||||
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("jobName"))
 | 
			
		||||
			it.JobName, err = ec.unmarshalOStringInput2ᚖgithubᚗcomᚋClusterCockpitᚋccᚑbackendᚋinternalᚋgraphᚋmodelᚐStringInput(ctx, v)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return it, err
 | 
			
		||||
			}
 | 
			
		||||
		case "cluster":
 | 
			
		||||
			var err error
 | 
			
		||||
 | 
			
		||||
@@ -10629,7 +10747,7 @@ func (ec *executionContext) unmarshalInputStringInput(ctx context.Context, obj i
 | 
			
		||||
		asMap[k] = v
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fieldsInOrder := [...]string{"eq", "contains", "startsWith", "endsWith"}
 | 
			
		||||
	fieldsInOrder := [...]string{"eq", "contains", "startsWith", "endsWith", "in"}
 | 
			
		||||
	for _, k := range fieldsInOrder {
 | 
			
		||||
		v, ok := asMap[k]
 | 
			
		||||
		if !ok {
 | 
			
		||||
@@ -10668,6 +10786,14 @@ func (ec *executionContext) unmarshalInputStringInput(ctx context.Context, obj i
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return it, err
 | 
			
		||||
			}
 | 
			
		||||
		case "in":
 | 
			
		||||
			var err error
 | 
			
		||||
 | 
			
		||||
			ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in"))
 | 
			
		||||
			it.In, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return it, err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -11000,6 +11126,23 @@ func (ec *executionContext) _Job(ctx context.Context, sel ast.SelectionSet, obj
 | 
			
		||||
			if out.Values[i] == graphql.Null {
 | 
			
		||||
				atomic.AddUint32(&invalids, 1)
 | 
			
		||||
			}
 | 
			
		||||
		case "jobName":
 | 
			
		||||
			field := field
 | 
			
		||||
 | 
			
		||||
			innerFunc := func(ctx context.Context) (res graphql.Marshaler) {
 | 
			
		||||
				defer func() {
 | 
			
		||||
					if r := recover(); r != nil {
 | 
			
		||||
						ec.Error(ctx, ec.Recover(ctx, r))
 | 
			
		||||
					}
 | 
			
		||||
				}()
 | 
			
		||||
				res = ec._Job_jobName(ctx, field, obj)
 | 
			
		||||
				return res
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			out.Concurrently(i, func() graphql.Marshaler {
 | 
			
		||||
				return innerFunc(ctx)
 | 
			
		||||
 | 
			
		||||
			})
 | 
			
		||||
		case "cluster":
 | 
			
		||||
 | 
			
		||||
			out.Values[i] = ec._Job_cluster(ctx, field, obj)
 | 
			
		||||
@@ -11312,6 +11455,10 @@ func (ec *executionContext) _JobsStatistics(ctx context.Context, sel ast.Selecti
 | 
			
		||||
			if out.Values[i] == graphql.Null {
 | 
			
		||||
				invalids++
 | 
			
		||||
			}
 | 
			
		||||
		case "name":
 | 
			
		||||
 | 
			
		||||
			out.Values[i] = ec._JobsStatistics_name(ctx, field, obj)
 | 
			
		||||
 | 
			
		||||
		case "totalJobs":
 | 
			
		||||
 | 
			
		||||
			out.Values[i] = ec._JobsStatistics_totalJobs(ctx, field, obj)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user