From cb2f9c14b63fd0c51a20e1efccbe36ace062d685 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Tue, 17 Sep 2024 14:22:48 +0200 Subject: [PATCH 01/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Move 'CreatedAt', 'DeletedAt' and 'UpdatedAt' to common entity.Info struct Add 'CreatedBy' and 'UpdatedBy' to common entity.Info struct Signed-off-by: Michal Krzyz --- internal/api/graphql/graph/model/models.go | 2 +- internal/database/mariadb/entity.go | 162 +++++++++++------- .../mariadb/internal/mocks/mock_Database.go | 2 +- .../mariadb/internal/mocks/mock_Heureka.go | 2 +- internal/entity/activity.go | 16 +- internal/entity/common.go | 31 +++- internal/entity/component.go | 13 +- internal/entity/component_instance.go | 11 +- internal/entity/component_version.go | 11 +- internal/entity/evidence.go | 9 +- internal/entity/issue.go | 9 +- internal/entity/issue_match.go | 5 +- internal/entity/issue_match_change.go | 9 +- internal/entity/issue_repository.go | 9 +- internal/entity/issue_repository_service.go | 12 +- internal/entity/issue_variant.go | 8 +- internal/entity/service.go | 9 +- internal/entity/severity.go | 1 + internal/entity/support_group.go | 12 +- internal/entity/support_group_service.go | 10 +- internal/entity/support_group_user.go | 10 +- internal/entity/test/activity.go | 8 +- internal/entity/test/component.go | 14 +- internal/entity/test/component_instance.go | 8 +- internal/entity/test/component_version.go | 8 +- internal/entity/test/evidence.go | 8 +- internal/entity/test/issue.go | 8 +- internal/entity/test/issue_match.go | 8 +- internal/entity/test/issue_match_change.go | 8 +- internal/entity/test/issue_repository.go | 14 +- internal/entity/test/issue_variant.go | 8 +- internal/entity/test/service.go | 8 +- internal/entity/test/support_group.go | 12 +- internal/entity/test/user.go | 8 +- internal/entity/user.go | 16 +- 35 files changed, 275 insertions(+), 214 deletions(-) diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index 0952c290..b3cba03d 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -219,7 +219,7 @@ func NewIssueMatchEntity(im *IssueMatchInput) entity.IssueMatch { IssueId: issueId, ComponentInstanceId: ciId, UserId: userId, - CreatedAt: createdAt, + Info: entity.Info{CreatedAt: createdAt}, } } diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index 5a584e6b..c1f135f4 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -96,9 +96,11 @@ func (ir *IssueRow) AsIssue() entity.Issue { IssueVariants: []entity.IssueVariant{}, IssueMatches: []entity.IssueMatch{}, Activity: []entity.Activity{}, - CreatedAt: GetTimeValue(ir.CreatedAt), - DeletedAt: GetTimeValue(ir.DeletedAt), - UpdatedAt: GetTimeValue(ir.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(ir.CreatedAt), + DeletedAt: GetTimeValue(ir.DeletedAt), + UpdatedAt: GetTimeValue(ir.UpdatedAt), + }, } } @@ -136,9 +138,11 @@ func (ibr *GetIssuesByRow) AsIssueWithAggregations() entity.IssueWithAggregation IssueVariants: []entity.IssueVariant{}, IssueMatches: []entity.IssueMatch{}, Activity: []entity.Activity{}, - CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), - DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), - UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), + DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), + UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), + }, }, } } @@ -152,9 +156,11 @@ func (ibr *GetIssuesByRow) AsIssue() entity.Issue { IssueVariants: []entity.IssueVariant{}, IssueMatches: []entity.IssueMatch{}, Activity: []entity.Activity{}, - CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), - DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), - UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), + DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), + UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), + }, } } @@ -208,9 +214,11 @@ func (imr IssueMatchRow) AsIssueMatch() entity.IssueMatch { RemediationDate: GetTimeValue(imr.RemediationDate), TargetRemediationDate: GetTimeValue(imr.TargetRemediationDate), Severity: entity.NewSeverity(GetStringValue(imr.Vector)), - CreatedAt: GetTimeValue(imr.CreatedAt), - DeletedAt: GetTimeValue(imr.DeletedAt), - UpdatedAt: GetTimeValue(imr.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(imr.CreatedAt), + DeletedAt: GetTimeValue(imr.DeletedAt), + UpdatedAt: GetTimeValue(imr.UpdatedAt), + }, } } @@ -259,9 +267,11 @@ func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepo Url: GetStringValue(birr.Url), IssueVariants: nil, Services: nil, - CreatedAt: GetTimeValue(birr.CreatedAt), - DeletedAt: GetTimeValue(birr.DeletedAt), - UpdatedAt: GetTimeValue(birr.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(birr.CreatedAt), + DeletedAt: GetTimeValue(birr.DeletedAt), + UpdatedAt: GetTimeValue(birr.UpdatedAt), + }, } } @@ -273,9 +283,11 @@ func (barr *BaseIssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Url: GetStringValue(barr.Url), IssueVariants: nil, Services: nil, - CreatedAt: GetTimeValue(barr.CreatedAt), - DeletedAt: GetTimeValue(barr.DeletedAt), - UpdatedAt: GetTimeValue(barr.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(barr.CreatedAt), + DeletedAt: GetTimeValue(barr.DeletedAt), + UpdatedAt: GetTimeValue(barr.UpdatedAt), + }, }, } } @@ -288,9 +300,11 @@ func (irr *IssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Url: GetStringValue(irr.Url), IssueVariants: nil, Services: nil, - CreatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.CreatedAt), - DeletedAt: GetTimeValue(irr.BaseIssueRepositoryRow.DeletedAt), - UpdatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.CreatedAt), + DeletedAt: GetTimeValue(irr.BaseIssueRepositoryRow.DeletedAt), + UpdatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.UpdatedAt), + }, }, IssueRepositoryService: entity.IssueRepositoryService{ ServiceId: GetInt64Value(irr.ServiceId), @@ -322,9 +336,11 @@ func (ivr *IssueVariantRow) AsIssueVariant(repository *entity.IssueRepository) e Issue: nil, Severity: entity.NewSeverity(GetStringValue(ivr.Vector)), Description: GetStringValue(ivr.Description), - CreatedAt: GetTimeValue(ivr.CreatedAt), - DeletedAt: GetTimeValue(ivr.DeletedAt), - UpdatedAt: GetTimeValue(ivr.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(ivr.CreatedAt), + DeletedAt: GetTimeValue(ivr.DeletedAt), + UpdatedAt: GetTimeValue(ivr.UpdatedAt), + }, } } @@ -357,9 +373,11 @@ func (ivwr *IssueVariantWithRepository) AsIssueVariantEntry() entity.IssueVarian Issue: nil, Severity: entity.NewSeverity(GetStringValue(ivwr.Vector)), Description: GetStringValue(ivwr.Description), - CreatedAt: GetTimeValue(ivwr.IssueVariantRow.CreatedAt), - DeletedAt: GetTimeValue(ivwr.IssueVariantRow.DeletedAt), - UpdatedAt: GetTimeValue(ivwr.IssueVariantRow.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(ivwr.IssueVariantRow.CreatedAt), + DeletedAt: GetTimeValue(ivwr.IssueVariantRow.DeletedAt), + UpdatedAt: GetTimeValue(ivwr.IssueVariantRow.UpdatedAt), + }, } } @@ -374,12 +392,14 @@ type ComponentRow struct { func (cr *ComponentRow) AsComponent() entity.Component { return entity.Component{ - Id: GetInt64Value(cr.Id), - Name: GetStringValue(cr.Name), - Type: GetStringValue(cr.Type), - CreatedAt: GetTimeValue(cr.CreatedAt), - DeletedAt: GetTimeValue(cr.DeletedAt), - UpdatedAt: GetTimeValue(cr.UpdatedAt), + Id: GetInt64Value(cr.Id), + Name: GetStringValue(cr.Name), + Type: GetStringValue(cr.Type), + Info: entity.Info{ + CreatedAt: GetTimeValue(cr.CreatedAt), + DeletedAt: GetTimeValue(cr.DeletedAt), + UpdatedAt: GetTimeValue(cr.UpdatedAt), + }, } } @@ -406,9 +426,11 @@ func (cvr *ComponentVersionRow) AsComponentVersion() entity.ComponentVersion { Id: GetInt64Value(cvr.Id), Version: GetStringValue(cvr.Version), ComponentId: GetInt64Value(cvr.ComponentId), - CreatedAt: GetTimeValue(cvr.CreatedAt), - DeletedAt: GetTimeValue(cvr.DeletedAt), - UpdatedAt: GetTimeValue(cvr.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(cvr.CreatedAt), + DeletedAt: GetTimeValue(cvr.DeletedAt), + UpdatedAt: GetTimeValue(cvr.UpdatedAt), + }, } } @@ -431,11 +453,13 @@ type SupportGroupRow struct { func (sgr *SupportGroupRow) AsSupportGroup() entity.SupportGroup { return entity.SupportGroup{ - Id: GetInt64Value(sgr.Id), - Name: GetStringValue(sgr.Name), - CreatedAt: GetTimeValue(sgr.CreatedAt), - DeletedAt: GetTimeValue(sgr.DeletedAt), - UpdatedAt: GetTimeValue(sgr.UpdatedAt), + Id: GetInt64Value(sgr.Id), + Name: GetStringValue(sgr.Name), + Info: entity.Info{ + CreatedAt: GetTimeValue(sgr.CreatedAt), + DeletedAt: GetTimeValue(sgr.DeletedAt), + UpdatedAt: GetTimeValue(sgr.UpdatedAt), + }, } } @@ -466,9 +490,11 @@ func (bsr *BaseServiceRow) AsBaseService() entity.BaseService { Name: GetStringValue(bsr.Name), Owners: []entity.User{}, Activities: []entity.Activity{}, - CreatedAt: GetTimeValue(bsr.CreatedAt), - DeletedAt: GetTimeValue(bsr.DeletedAt), - UpdatedAt: GetTimeValue(bsr.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(bsr.CreatedAt), + DeletedAt: GetTimeValue(bsr.DeletedAt), + UpdatedAt: GetTimeValue(bsr.UpdatedAt), + }, } } @@ -486,9 +512,11 @@ func (sr *ServiceRow) AsService() entity.Service { Name: GetStringValue(sr.Name), Owners: []entity.User{}, Activities: []entity.Activity{}, - CreatedAt: GetTimeValue(sr.BaseServiceRow.CreatedAt), - DeletedAt: GetTimeValue(sr.BaseServiceRow.DeletedAt), - UpdatedAt: GetTimeValue(sr.BaseServiceRow.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(sr.BaseServiceRow.CreatedAt), + DeletedAt: GetTimeValue(sr.BaseServiceRow.DeletedAt), + UpdatedAt: GetTimeValue(sr.BaseServiceRow.UpdatedAt), + }, }, IssueRepositoryService: entity.IssueRepositoryService{ ServiceId: GetInt64Value(sr.ServiceId), @@ -519,9 +547,11 @@ func (ar *ActivityRow) AsActivity() entity.Activity { Status: entity.ActivityStatusValue(GetStringValue(ar.Status)), Issues: []entity.Issue{}, Evidences: []entity.Evidence{}, - CreatedAt: GetTimeValue(ar.CreatedAt), - DeletedAt: GetTimeValue(ar.DeletedAt), - UpdatedAt: GetTimeValue(ar.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(ar.CreatedAt), + DeletedAt: GetTimeValue(ar.DeletedAt), + UpdatedAt: GetTimeValue(ar.UpdatedAt), + }, } } @@ -553,9 +583,11 @@ func (cir *ComponentInstanceRow) AsComponentInstance() entity.ComponentInstance ComponentVersionId: GetInt64Value(cir.ComponentVersionId), Service: nil, ServiceId: GetInt64Value(cir.ServiceId), - CreatedAt: GetTimeValue(cir.CreatedAt), - DeletedAt: GetTimeValue(cir.DeletedAt), - UpdatedAt: GetTimeValue(cir.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(cir.CreatedAt), + DeletedAt: GetTimeValue(cir.DeletedAt), + UpdatedAt: GetTimeValue(cir.UpdatedAt), + }, } } @@ -586,9 +618,11 @@ func (ur *UserRow) AsUser() entity.User { Name: GetStringValue(ur.Name), UniqueUserID: GetStringValue(ur.UniqueUserID), Type: GetUserTypeValue(ur.Type), - CreatedAt: GetTimeValue(ur.CreatedAt), - DeletedAt: GetTimeValue(ur.DeletedAt), - UpdatedAt: GetTimeValue(ur.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(ur.CreatedAt), + DeletedAt: GetTimeValue(ur.DeletedAt), + UpdatedAt: GetTimeValue(ur.UpdatedAt), + }, } } @@ -629,9 +663,11 @@ func (er *EvidenceRow) AsEvidence() entity.Evidence { UserId: GetInt64Value(er.UserId), Activity: nil, ActivityId: GetInt64Value(er.ActivityId), - CreatedAt: GetTimeValue(er.CreatedAt), - DeletedAt: GetTimeValue(er.DeletedAt), - UpdatedAt: GetTimeValue(er.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(er.CreatedAt), + DeletedAt: GetTimeValue(er.DeletedAt), + UpdatedAt: GetTimeValue(er.UpdatedAt), + }, } } @@ -665,9 +701,11 @@ func (imcr *IssueMatchChangeRow) AsIssueMatchChange() entity.IssueMatchChange { IssueMatchId: GetInt64Value(imcr.IssueMatchId), ActivityId: GetInt64Value(imcr.ActivityId), Action: GetStringValue(imcr.Action), - CreatedAt: GetTimeValue(imcr.CreatedAt), - DeletedAt: GetTimeValue(imcr.DeletedAt), - UpdatedAt: GetTimeValue(imcr.UpdatedAt), + Info: entity.Info{ + CreatedAt: GetTimeValue(imcr.CreatedAt), + DeletedAt: GetTimeValue(imcr.DeletedAt), + UpdatedAt: GetTimeValue(imcr.UpdatedAt), + }, } } diff --git a/internal/database/mariadb/internal/mocks/mock_Database.go b/internal/database/mariadb/internal/mocks/mock_Database.go index 94837644..9d742550 100644 --- a/internal/database/mariadb/internal/mocks/mock_Database.go +++ b/internal/database/mariadb/internal/mocks/mock_Database.go @@ -6,8 +6,8 @@ package mocks import ( - mock "github.com/stretchr/testify/mock" entity "github.com/cloudoperators/heureka/internal/entity" + mock "github.com/stretchr/testify/mock" ) // MockDatabase is an autogenerated mock type for the Database type diff --git a/internal/database/mariadb/internal/mocks/mock_Heureka.go b/internal/database/mariadb/internal/mocks/mock_Heureka.go index 89974edc..d5b9bfe8 100644 --- a/internal/database/mariadb/internal/mocks/mock_Heureka.go +++ b/internal/database/mariadb/internal/mocks/mock_Heureka.go @@ -6,8 +6,8 @@ package mocks import ( - mock "github.com/stretchr/testify/mock" entity "github.com/cloudoperators/heureka/internal/entity" + mock "github.com/stretchr/testify/mock" ) // MockHeureka is an autogenerated mock type for the Heureka type diff --git a/internal/entity/activity.go b/internal/entity/activity.go index d5a4e4a6..d637ec6c 100644 --- a/internal/entity/activity.go +++ b/internal/entity/activity.go @@ -3,8 +3,6 @@ package entity -import "time" - type ActivityStatusValue string const ( @@ -36,14 +34,12 @@ var AllActivityStatusValues = []string{ } type Activity struct { + Info Id int64 `json:"id"` Status ActivityStatusValue `json:"status"` Service *Service `json:"service,omitempty"` Issues []Issue `json:"issues,omitempty"` Evidences []Evidence `json:"evidences,omitempty"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } func (a *Activity) GetId() int64 { @@ -51,17 +47,17 @@ func (a *Activity) GetId() int64 { } type ActivityHasIssue struct { - ActivityId int64 `json:"activity_id"` - IssueId int64 `json:"issue_id"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` + Info + ActivityId int64 `json:"activity_id"` + IssueId int64 `json:"issue_id"` } type ActivityAggregations struct { + Info } type ActivityFilter struct { + Info Paginated Status []*string `json:"status"` ServiceName []*string `json:"service_name"` diff --git a/internal/entity/common.go b/internal/entity/common.go index 92f9aa27..be47aa81 100644 --- a/internal/entity/common.go +++ b/internal/entity/common.go @@ -17,10 +17,13 @@ import ( type HeurekaEntity interface { Activity | + ActivityAggregations | ActivityHasIssue | IssueVariant | + IssueVariantAggregations | BaseIssueRepository | IssueRepository | + IssueRepositoryAggregations | ResultList | ListOptions | PageInfo | @@ -28,24 +31,30 @@ type HeurekaEntity interface { Severity | Cvss | Component | - ComponentInstanceAggregations | + ComponentAggregations | ComponentInstance | + ComponentInstanceAggregations | ComponentVersion | + ComponentVersionAggregations | Evidence | + EvidenceAggregations | BaseService | Service | ServiceAggregations | SupportGroup | + SupportGroupAggregations | SupportGroupService | SupportGroupUser | User | + UserAggregations | IssueWithAggregations | IssueAggregations | Issue | IssueMatch | IssueMatchChange | HeurekaFilter | - IssueCount + IssueCount | + IssueTypeCounts } type HeurekaFilter interface { @@ -62,7 +71,8 @@ type HeurekaFilter interface { EvidenceFilter | ComponentFilter | ComponentVersionFilter | - IssueRepositoryFilter + IssueRepositoryFilter | + SeverityFilter } type HasCursor interface { @@ -83,6 +93,7 @@ type ResultList struct { } type ListOptions struct { + Info ShowTotalCount bool `json:"show_total_count"` ShowPageInfo bool `json:"show_page_info"` IncludeAggregations bool `json:"include_aggregations"` @@ -97,6 +108,7 @@ func NewListOptions() *ListOptions { } type PageInfo struct { + Info HasNextPage *bool `json:"has_next_page,omitempty"` HasPreviousPage *bool `json:"has_previous_page,omitempty"` IsValidPage *bool `json:"is_valid_page,omitempty"` @@ -108,6 +120,7 @@ type PageInfo struct { } type Page struct { + Info After *string `json:"after,omitempty"` PageNumber *int `json:"page_number,omitempty"` IsCurrent bool `json:"is_current,omitempty"` @@ -121,11 +134,13 @@ type List[T interface{}] struct { } type TimeFilter struct { + Info After time.Time `json:"after"` Before time.Time `json:"before"` } type Paginated struct { + Info First *int `json:"first"` After *int64 `json:"from"` } @@ -137,6 +152,7 @@ func MaxPaginated() Paginated { } type Severity struct { + Info Value string Score float64 Cvss Cvss @@ -178,8 +194,17 @@ func NewSeverity(url string) Severity { } type Cvss struct { + Info Vector string Base *metric.Base Temporal *metric.Temporal Environmental *metric.Environmental } + +type Info struct { + CreatedAt time.Time `json:"created_at"` + CreatedBy string `json:"created_by"` + UpdatedAt time.Time `json:"updated_at"` + UpdatedBy string `json:"updated_by"` + DeletedAt time.Time `json:"deleted_at,omitempty"` +} diff --git a/internal/entity/component.go b/internal/entity/component.go index 28204808..17efa12a 100644 --- a/internal/entity/component.go +++ b/internal/entity/component.go @@ -3,15 +3,11 @@ package entity -import "time" - type Component struct { - Id int64 `json:"id"` - Name string `json:"name"` - Type string `json:"type"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` + Info + Id int64 `json:"id"` + Name string `json:"name"` + Type string `json:"type"` } type ComponentResult struct { @@ -21,6 +17,7 @@ type ComponentResult struct { } type ComponentFilter struct { + Info Paginated Name []*string `json:"name"` Id []*int64 `json:"id"` diff --git a/internal/entity/component_instance.go b/internal/entity/component_instance.go index 0851a080..36fd81f4 100644 --- a/internal/entity/component_instance.go +++ b/internal/entity/component_instance.go @@ -3,9 +3,8 @@ package entity -import "time" - type ComponentInstanceFilter struct { + Info Paginated IssueMatchId []*int64 `json:"issue_match_id"` ServiceId []*int64 `json:"service_id"` @@ -13,7 +12,9 @@ type ComponentInstanceFilter struct { Id []*int64 `json:"id"` } -type ComponentInstanceAggregations struct{} +type ComponentInstanceAggregations struct { + Info +} type ComponentInstanceResult struct { WithCursor @@ -22,6 +23,7 @@ type ComponentInstanceResult struct { } type ComponentInstance struct { + Info Id int64 `json:"id"` CCRN string `json:"ccrn"` Count int16 `json:"count"` @@ -29,7 +31,4 @@ type ComponentInstance struct { ComponentVersionId int64 `db:"componentinstance_component_version_id"` Service *Service `json:"service,omitempty"` ServiceId int64 `db:"componentinstance_service_id"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } diff --git a/internal/entity/component_version.go b/internal/entity/component_version.go index 9d88b2f2..768fcb1d 100644 --- a/internal/entity/component_version.go +++ b/internal/entity/component_version.go @@ -3,9 +3,8 @@ package entity -import "time" - type ComponentVersionFilter struct { + Info Paginated Id []*int64 `json:"id"` IssueId []*int64 `json:"issue_id"` @@ -13,7 +12,9 @@ type ComponentVersionFilter struct { Version []*string `json:"version"` } -type ComponentVersionAggregations struct{} +type ComponentVersionAggregations struct { + Info +} type ComponentVersionResult struct { WithCursor @@ -22,13 +23,11 @@ type ComponentVersionResult struct { } type ComponentVersion struct { + Info Id int64 `json:"id"` Version string `json:"version"` Component *Component `json:"component,omitempty"` ComponentId int64 `db:"componentversion_component_id"` ComponentInstances []ComponentInstance `json:"component_instances,omitempty"` Issues []Issue `json:"issues,omitempty"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } diff --git a/internal/entity/evidence.go b/internal/entity/evidence.go index a4e0a0e0..a708ef6b 100644 --- a/internal/entity/evidence.go +++ b/internal/entity/evidence.go @@ -42,6 +42,7 @@ var AllEvidenceTypeValues = []string{ } type Evidence struct { + Info Id int64 `json:"id"` Description string `json:"description"` Type EvidenceType `json:"type"` @@ -51,19 +52,19 @@ type Evidence struct { UserId int64 `db:"evidence_author_id"` Activity *Activity `json:"activity,omitempty"` ActivityId int64 `db:"evidence_activity_id"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } type EvidenceFilter struct { + Info Paginated Id []*int64 `json:"id"` ActivityId []*int64 `json:"activity_id"` IssueMatchId []*int64 `json:"issue_match_id"` UserId []*int64 `json:"user_id"` } -type EvidenceAggregations struct{} +type EvidenceAggregations struct { + Info +} type EvidenceResult struct { WithCursor diff --git a/internal/entity/issue.go b/internal/entity/issue.go index 6b114872..7eb80503 100644 --- a/internal/entity/issue.go +++ b/internal/entity/issue.go @@ -8,6 +8,7 @@ import ( ) type IssueWithAggregations struct { + Info IssueAggregations Issue } @@ -50,6 +51,7 @@ type IssueResult struct { } type IssueFilter struct { + Info Paginated PrimaryName []*string `json:"primary_name"` ServiceName []*string `json:"service_name"` @@ -66,6 +68,7 @@ type IssueFilter struct { } type IssueAggregations struct { + Info Activites int64 IssueMatches int64 AffectedServices int64 @@ -76,6 +79,7 @@ type IssueAggregations struct { } type Issue struct { + Info Id int64 `json:"id"` Type IssueType `json:"type"` PrimaryName string `json:"primary_name"` @@ -84,17 +88,16 @@ type Issue struct { IssueMatches []IssueMatch `json:"issue_matches,omitempty"` ComponentVersions []ComponentVersion `json:"component_versions,omitempty"` Activity []Activity `json:"activity,omitempty"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_lsat"` } type IssueCount struct { + Info Count int64 `json:"count"` Type IssueType `json:"type"` } type IssueTypeCounts struct { + Info VulnerabilityCount int64 `json:"vulnerability_count"` PolicyViolationCount int64 `json:"policy_violation_count"` SecurityEventCount int64 `json:"security_event_count"` diff --git a/internal/entity/issue_match.go b/internal/entity/issue_match.go index d79c8a83..e5d95609 100644 --- a/internal/entity/issue_match.go +++ b/internal/entity/issue_match.go @@ -39,6 +39,7 @@ var AllIssueMatchStatusValues = []string{ } type IssueMatch struct { + Info Id int64 `json:"id"` Status IssueMatchStatusValue `json:"status"` User *User `json:"user,omitempty"` @@ -51,12 +52,10 @@ type IssueMatch struct { IssueId int64 `json:"issue_id"` RemediationDate time.Time `json:"remediation_date"` TargetRemediationDate time.Time `json:"target_remediation_date"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } type IssueMatchFilter struct { + Info Paginated Id []*int64 `json:"id"` AffectedServiceName []*string `json:"affected_service_name"` diff --git a/internal/entity/issue_match_change.go b/internal/entity/issue_match_change.go index 416b029a..ea66f9db 100644 --- a/internal/entity/issue_match_change.go +++ b/internal/entity/issue_match_change.go @@ -3,8 +3,6 @@ package entity -import "time" - type IssueMatchChangeAction string const ( @@ -32,18 +30,17 @@ var AllIssueMatchChangeActions = []string{ } type IssueMatchChange struct { + Info Id int64 `json:"id"` ActivityId int64 `json:"activity_id"` Activity *Activity IssueMatchId int64 `json:"issue_match_id"` IssueMatch *IssueMatch - Action string `json:"action"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at"` - UpdatedAt time.Time `json:"updated_at"` + Action string `json:"action"` } type IssueMatchChangeFilter struct { + Info Paginated Id []*int64 `json:"id"` ActivityId []*int64 `json:"activity_id"` diff --git a/internal/entity/issue_repository.go b/internal/entity/issue_repository.go index 0be984f5..2577d96f 100644 --- a/internal/entity/issue_repository.go +++ b/internal/entity/issue_repository.go @@ -3,20 +3,17 @@ package entity -import "time" - type BaseIssueRepository struct { + Info Id int64 `json:"id"` Name string `json:"name"` Url string `json:"url"` IssueVariants []IssueVariant `json:"issue_variants,omitempty"` Services []Service `json:"services,omitempty"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } type IssueRepositoryFilter struct { + Info Paginated Id []*int64 `json:"id"` ServiceId []*int64 `json:"service_id"` @@ -38,9 +35,11 @@ func NewIssueRepositoryFilter() *IssueRepositoryFilter { } type IssueRepositoryAggregations struct { + Info } type IssueRepository struct { + Info BaseIssueRepository IssueRepositoryService } diff --git a/internal/entity/issue_repository_service.go b/internal/entity/issue_repository_service.go index fddbc449..83b40703 100644 --- a/internal/entity/issue_repository_service.go +++ b/internal/entity/issue_repository_service.go @@ -3,13 +3,9 @@ package entity -import "time" - type IssueRepositoryService struct { - ServiceId int64 `json:"service_id"` - IssueRepositoryId int64 `json:"issue_repository_id"` - Priority int64 `json:"priority"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` + Info + ServiceId int64 `json:"service_id"` + IssueRepositoryId int64 `json:"issue_repository_id"` + Priority int64 `json:"priority"` } diff --git a/internal/entity/issue_variant.go b/internal/entity/issue_variant.go index e7516a07..745ab991 100644 --- a/internal/entity/issue_variant.go +++ b/internal/entity/issue_variant.go @@ -3,9 +3,8 @@ package entity -import "time" - type IssueVariant struct { + Info Id int64 `json:"id"` IssueRepositoryId int64 `json:"issue_repository_id"` IssueRepository *IssueRepository `json:"issue_repository"` @@ -14,12 +13,10 @@ type IssueVariant struct { Issue *Issue `json:"issue"` Severity Severity `json:"severity"` Description string `json:"description"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } type IssueVariantFilter struct { + Info Paginated Id []*int64 `json:"id"` SecondaryName []*string `json:"secondary_name"` @@ -45,6 +42,7 @@ func NewIssueVariantFilter() *IssueVariantFilter { } type IssueVariantAggregations struct { + Info } type IssueVariantResult struct { diff --git a/internal/entity/service.go b/internal/entity/service.go index cb7c7e67..ee62309a 100644 --- a/internal/entity/service.go +++ b/internal/entity/service.go @@ -3,9 +3,8 @@ package entity -import "time" - type BaseService struct { + Info Id int64 `json:"id"` Name string `json:"name"` SupportGroup *SupportGroup `json:"support_group,omitempty"` @@ -13,15 +12,14 @@ type BaseService struct { Owners []User `json:"owners,omitempty"` Activities []Activity `json:"activities,omitempty"` Priority int64 `json:"priority"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` } type ServiceAggregations struct { + Info } type ServiceFilter struct { + Info Paginated SupportGroupName []*string `json:"support_group_name"` Id []*int64 `json:"id"` @@ -36,6 +34,7 @@ type ServiceFilter struct { } type Service struct { + Info BaseService IssueRepositoryService } diff --git a/internal/entity/severity.go b/internal/entity/severity.go index ca9e7541..bc9a7b26 100644 --- a/internal/entity/severity.go +++ b/internal/entity/severity.go @@ -4,6 +4,7 @@ package entity type SeverityFilter struct { + Info IssueMatchId []*int64 `json:"issue_match_id"` IssueId []*int64 `json:"issue_id"` } diff --git a/internal/entity/support_group.go b/internal/entity/support_group.go index ca280db0..7a94d65e 100644 --- a/internal/entity/support_group.go +++ b/internal/entity/support_group.go @@ -3,17 +3,14 @@ package entity -import "time" - type SupportGroup struct { - Id int64 `json:"id"` - Name string `json:"name"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` + Info + Id int64 `json:"id"` + Name string `json:"name"` } type SupportGroupFilter struct { + Info Paginated Id []*int64 `json:"id"` ServiceId []*int64 `json:"service_id"` @@ -22,6 +19,7 @@ type SupportGroupFilter struct { } type SupportGroupAggregations struct { + Info } type SupportGroupResult struct { diff --git a/internal/entity/support_group_service.go b/internal/entity/support_group_service.go index 1e0e42c4..af070b4f 100644 --- a/internal/entity/support_group_service.go +++ b/internal/entity/support_group_service.go @@ -3,12 +3,8 @@ package entity -import "time" - type SupportGroupService struct { - SupportGroupId int64 `json:"support_group_id"` - ServiceId int64 `json:"service_id"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` + Info + SupportGroupId int64 `json:"support_group_id"` + ServiceId int64 `json:"service_id"` } diff --git a/internal/entity/support_group_user.go b/internal/entity/support_group_user.go index e35ad945..2c781add 100644 --- a/internal/entity/support_group_user.go +++ b/internal/entity/support_group_user.go @@ -3,12 +3,8 @@ package entity -import "time" - type SupportGroupUser struct { - SupportGroupId int64 `json:"support_group_id"` - UserId int64 `json:"user_id"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` + Info + SupportGroupId int64 `json:"support_group_id"` + UserId int64 `json:"user_id"` } diff --git a/internal/entity/test/activity.go b/internal/entity/test/activity.go index a182335b..4df12e1e 100644 --- a/internal/entity/test/activity.go +++ b/internal/entity/test/activity.go @@ -15,9 +15,11 @@ func NewFakeActivityEntity() entity.Activity { Issues: nil, Evidences: nil, Service: nil, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/component.go b/internal/entity/test/component.go index 3b12ede3..fcac3f6b 100644 --- a/internal/entity/test/component.go +++ b/internal/entity/test/component.go @@ -10,12 +10,14 @@ import ( func NewFakeComponentEntity() entity.Component { return entity.Component{ - Id: int64(gofakeit.Number(1, 10000000)), - Name: gofakeit.Name(), - Type: gofakeit.Word(), - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Id: int64(gofakeit.Number(1, 10000000)), + Name: gofakeit.Name(), + Type: gofakeit.Word(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/component_instance.go b/internal/entity/test/component_instance.go index 217f25cc..12052b5f 100644 --- a/internal/entity/test/component_instance.go +++ b/internal/entity/test/component_instance.go @@ -17,9 +17,11 @@ func NewFakeComponentInstanceEntity() entity.ComponentInstance { ComponentVersionId: int64(gofakeit.Number(1, 10000000)), Service: nil, ServiceId: int64(gofakeit.Number(1, 10000000)), - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/component_version.go b/internal/entity/test/component_version.go index a44b32a3..97848fdf 100644 --- a/internal/entity/test/component_version.go +++ b/internal/entity/test/component_version.go @@ -15,9 +15,11 @@ func NewFakeComponentVersionEntity() entity.ComponentVersion { ComponentId: 0, ComponentInstances: nil, Issues: nil, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/evidence.go b/internal/entity/test/evidence.go index d0c561b8..4a1380a8 100644 --- a/internal/entity/test/evidence.go +++ b/internal/entity/test/evidence.go @@ -19,9 +19,11 @@ func NewFakeEvidenceEntity() entity.Evidence { RaaEnd: gofakeit.Date(), Type: entity.NewEvidenceTypeValue(t), Severity: severity, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/issue.go b/internal/entity/test/issue.go index 705fd9ff..a6053737 100644 --- a/internal/entity/test/issue.go +++ b/internal/entity/test/issue.go @@ -22,9 +22,11 @@ func NewFakeIssueEntity() entity.Issue { IssueMatches: nil, ComponentVersions: nil, Activity: nil, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/issue_match.go b/internal/entity/test/issue_match.go index e0b839d0..a62ec3a8 100644 --- a/internal/entity/test/issue_match.go +++ b/internal/entity/test/issue_match.go @@ -25,9 +25,11 @@ func NewFakeIssueMatch() entity.IssueMatch { Issue: nil, RemediationDate: gofakeit.Date(), TargetRemediationDate: gofakeit.Date(), - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/issue_match_change.go b/internal/entity/test/issue_match_change.go index ea11442a..83236092 100644 --- a/internal/entity/test/issue_match_change.go +++ b/internal/entity/test/issue_match_change.go @@ -15,9 +15,11 @@ func NewFakeIssueMatchChange() entity.IssueMatchChange { Action: gofakeit.RandomString(actions), IssueMatch: nil, Activity: nil, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/issue_repository.go b/internal/entity/test/issue_repository.go index f61af12b..a3511a01 100644 --- a/internal/entity/test/issue_repository.go +++ b/internal/entity/test/issue_repository.go @@ -11,12 +11,14 @@ import ( func NewFakeIssueRepositoryEntity() entity.IssueRepository { return entity.IssueRepository{ BaseIssueRepository: entity.BaseIssueRepository{ - Id: int64(gofakeit.Number(1, 10000000)), - Name: gofakeit.Noun(), - Url: gofakeit.URL(), - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Id: int64(gofakeit.Number(1, 10000000)), + Name: gofakeit.Noun(), + Url: gofakeit.URL(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, }, IssueRepositoryService: entity.IssueRepositoryService{ Priority: int64(gofakeit.Number(1, 10)), diff --git a/internal/entity/test/issue_variant.go b/internal/entity/test/issue_variant.go index 0a36a034..22df8d29 100644 --- a/internal/entity/test/issue_variant.go +++ b/internal/entity/test/issue_variant.go @@ -21,9 +21,11 @@ func NewFakeIssueVariantEntity() entity.IssueVariant { Issue: nil, IssueRepositoryId: 0, IssueRepository: nil, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/service.go b/internal/entity/test/service.go index fb695bcc..6a6aabb3 100644 --- a/internal/entity/test/service.go +++ b/internal/entity/test/service.go @@ -16,9 +16,11 @@ func NewFakeServiceEntity() entity.Service { SupportGroup: nil, Activities: nil, Owners: nil, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, }, } } diff --git a/internal/entity/test/support_group.go b/internal/entity/test/support_group.go index fc72b935..9a6d6b02 100644 --- a/internal/entity/test/support_group.go +++ b/internal/entity/test/support_group.go @@ -10,11 +10,13 @@ import ( func NewFakeSupportGroupEntity() entity.SupportGroup { return entity.SupportGroup{ - Id: int64(gofakeit.Number(1, 10000000)), - Name: gofakeit.AppName(), - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Id: int64(gofakeit.Number(1, 10000000)), + Name: gofakeit.AppName(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/test/user.go b/internal/entity/test/user.go index c06d95af..eb25ce79 100644 --- a/internal/entity/test/user.go +++ b/internal/entity/test/user.go @@ -17,9 +17,11 @@ func NewFakeUserEntity() entity.User { Name: gofakeit.Name(), UniqueUserID: uniqueUserId, Type: entity.HumanUserType, - CreatedAt: gofakeit.Date(), - DeletedAt: gofakeit.Date(), - UpdatedAt: gofakeit.Date(), + Info: entity.Info{ + CreatedAt: gofakeit.Date(), + DeletedAt: gofakeit.Date(), + UpdatedAt: gofakeit.Date(), + }, } } diff --git a/internal/entity/user.go b/internal/entity/user.go index 324a7782..77c7a34f 100644 --- a/internal/entity/user.go +++ b/internal/entity/user.go @@ -3,8 +3,6 @@ package entity -import "time" - type UserType int const ( @@ -14,16 +12,15 @@ const ( ) type User struct { - Id int64 `json:"id"` - Name string `json:"name"` - UniqueUserID string `json:"uniqueUserId"` - Type UserType `json:"type"` - CreatedAt time.Time `json:"created_at"` - DeletedAt time.Time `json:"deleted_at,omitempty"` - UpdatedAt time.Time `json:"updated_at"` + Info + Id int64 `json:"id"` + Name string `json:"name"` + UniqueUserID string `json:"uniqueUserId"` + Type UserType `json:"type"` } type UserFilter struct { + Info Paginated Name []*string `json:"name"` UniqueUserID []*string `json:"uniqueUserId"` @@ -34,6 +31,7 @@ type UserFilter struct { } type UserAggregations struct { + Info } type UserResult struct { From 419e4124dbd70510e19219b8289ee6b0b9b52e85 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 25 Sep 2024 11:27:37 +0200 Subject: [PATCH 02/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Add metadata for user Add tests --- internal/api/graphql/graph/generated.go | 16367 ++++++++++++---- internal/api/graphql/graph/model/models.go | 16 +- .../api/graphql/graph/model/models_gen.go | 12 +- .../queryCollection/user/listUsers.graphql | 27 + .../api/graphql/graph/resolver/activity.go | 5 +- .../api/graphql/graph/resolver/component.go | 5 +- .../graph/resolver/component_instance.go | 5 +- .../graph/resolver/component_version.go | 5 +- .../api/graphql/graph/resolver/evidence.go | 5 +- internal/api/graphql/graph/resolver/issue.go | 5 +- .../api/graphql/graph/resolver/issue_match.go | 5 +- .../graph/resolver/issue_match_change.go | 5 +- .../resolver/issue_match_filter_value.go | 5 +- .../graph/resolver/issue_repository.go | 5 +- .../graphql/graph/resolver/issue_variant.go | 5 +- .../api/graphql/graph/resolver/mutation.go | 5 +- internal/api/graphql/graph/resolver/query.go | 5 +- .../api/graphql/graph/resolver/service.go | 5 +- .../graphql/graph/resolver/service_filter.go | 5 +- .../graphql/graph/resolver/support_group.go | 5 +- internal/api/graphql/graph/resolver/user.go | 5 +- .../api/graphql/graph/schema/common.graphqls | 10 +- .../api/graphql/graph/schema/user.graphqls | 1 + internal/app/user/user_handler.go | 2 + internal/database/mariadb/entity.go | 44 +- internal/database/mariadb/init/schema.sql | 2 + internal/database/mariadb/user.go | 10 +- internal/e2e/metadata_test.go | 189 + internal/entity/activity.go | 8 +- internal/entity/common.go | 16 +- internal/entity/component.go | 5 +- internal/entity/component_instance.go | 6 +- internal/entity/component_version.go | 6 +- internal/entity/evidence.go | 6 +- internal/entity/issue.go | 12 +- internal/entity/issue_match.go | 4 +- internal/entity/issue_match_change.go | 4 +- internal/entity/issue_repository.go | 8 +- internal/entity/issue_repository_service.go | 2 +- internal/entity/issue_variant.go | 6 +- internal/entity/service.go | 8 +- internal/entity/severity.go | 2 +- internal/entity/support_group.go | 6 +- internal/entity/support_group_service.go | 2 +- internal/entity/support_group_user.go | 2 +- internal/entity/test/activity.go | 2 +- internal/entity/test/component.go | 2 +- internal/entity/test/component_instance.go | 2 +- internal/entity/test/component_version.go | 2 +- internal/entity/test/evidence.go | 2 +- internal/entity/test/issue.go | 2 +- internal/entity/test/issue_match.go | 2 +- internal/entity/test/issue_match_change.go | 2 +- internal/entity/test/issue_repository.go | 2 +- internal/entity/test/issue_variant.go | 2 +- internal/entity/test/service.go | 2 +- internal/entity/test/support_group.go | 2 +- internal/entity/test/user.go | 2 +- internal/entity/user.go | 6 +- 59 files changed, 12771 insertions(+), 4129 deletions(-) create mode 100644 internal/api/graphql/graph/queryCollection/user/listUsers.graphql create mode 100644 internal/e2e/metadata_test.go diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index f7fba360..30881953 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. package graph @@ -22,7 +19,9 @@ import ( "github.com/vektah/gqlparser/v2/ast" ) -// region ************************** generated!.gotpl *******github.com/cloudoperatorsewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { return &executableSchema{ schema: cfg.Schema, @@ -367,6 +366,14 @@ type ComplexityRoot struct { UpdatedAt func(childComplexity int) int } + Metadata struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + DeletedAt func(childComplexity int) int + UpdatedAt func(childComplexity int) int + UpdatedBy func(childComplexity int) int + } + Mutation struct { AddComponentVersionToIssue func(childComplexity int, issueID string, componentVersionID string) int AddEvidenceToIssueMatch func(childComplexity int, issueMatchID string, evidenceID string) int @@ -514,6 +521,7 @@ type ComplexityRoot struct { User struct { ID func(childComplexity int) int + Metadata func(childComplexity int) int Name func(childComplexity int) int Services func(childComplexity int, filter *model.ServiceFilter, first *int, after *string) int SupportGroups func(childComplexity int, filter *model.SupportGroupFilter, first *int, after *string) int @@ -2150,6 +2158,41 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueVariantEdge.UpdatedAt(childComplexity), true + case "Metadata.created_at": + if e.complexity.Metadata.CreatedAt == nil { + break + } + + return e.complexity.Metadata.CreatedAt(childComplexity), true + + case "Metadata.created_by": + if e.complexity.Metadata.CreatedBy == nil { + break + } + + return e.complexity.Metadata.CreatedBy(childComplexity), true + + case "Metadata.deleted_at": + if e.complexity.Metadata.DeletedAt == nil { + break + } + + return e.complexity.Metadata.DeletedAt(childComplexity), true + + case "Metadata.updated_at": + if e.complexity.Metadata.UpdatedAt == nil { + break + } + + return e.complexity.Metadata.UpdatedAt(childComplexity), true + + case "Metadata.updated_by": + if e.complexity.Metadata.UpdatedBy == nil { + break + } + + return e.complexity.Metadata.UpdatedBy(childComplexity), true + case "Mutation.addComponentVersionToIssue": if e.complexity.Mutation.AddComponentVersionToIssue == nil { break @@ -3315,6 +3358,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.User.ID(childComplexity), true + case "User.metadata": + if e.complexity.User.Metadata == nil { + break + } + + return e.complexity.User.Metadata(childComplexity), true + case "User.name": if e.complexity.User.Name == nil { break @@ -3567,2906 +3617,6321 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) func (ec *executionContext) field_Activity_evidences_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.EvidenceFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOEvidenceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Activity_evidences_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Activity_evidences_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Activity_evidences_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Activity_evidences_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.EvidenceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.EvidenceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOEvidenceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceFilter(ctx, tmp) + } + + var zeroVal *model.EvidenceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_evidences_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_evidences_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_Activity_issueMatchChanges_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueMatchChangeFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueMatchChangeFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Activity_issueMatchChanges_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Activity_issueMatchChanges_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Activity_issueMatchChanges_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Activity_issueMatchChanges_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueMatchChangeFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueMatchChangeFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueMatchChangeFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeFilter(ctx, tmp) + } + + var zeroVal *model.IssueMatchChangeFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_issueMatchChanges_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_issueMatchChanges_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_Activity_issues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Activity_issues_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Activity_issues_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Activity_issues_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Activity_issues_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueFilter(ctx, tmp) + } + + var zeroVal *model.IssueFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_issues_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_issues_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_Activity_services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ServiceFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Activity_services_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Activity_services_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Activity_services_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Activity_services_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ServiceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ServiceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) + } + + var zeroVal *model.ServiceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_services_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Activity_services_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_ComponentInstance_issueMatches_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueMatchFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_ComponentInstance_issueMatches_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_ComponentInstance_issueMatches_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_ComponentInstance_issueMatches_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_ComponentInstance_issueMatches_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueMatchFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueMatchFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) + } + + var zeroVal *model.IssueMatchFilter + return zeroVal, nil +} + +func (ec *executionContext) field_ComponentInstance_issueMatches_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_ComponentInstance_issueMatches_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_ComponentVersion_componentInstances_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_ComponentVersion_componentInstances_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_ComponentVersion_componentInstances_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg1 return args, nil } +func (ec *executionContext) field_ComponentVersion_componentInstances_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_ComponentVersion_componentInstances_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_ComponentVersion_issues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg0, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_ComponentVersion_issues_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_ComponentVersion_issues_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg1 return args, nil } +func (ec *executionContext) field_ComponentVersion_issues_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_ComponentVersion_issues_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_Component_componentVersions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ComponentVersionFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOComponentVersionFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Component_componentVersions_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Component_componentVersions_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Component_componentVersions_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Component_componentVersions_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ComponentVersionFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ComponentVersionFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOComponentVersionFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionFilter(ctx, tmp) + } + + var zeroVal *model.ComponentVersionFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Component_componentVersions_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Component_componentVersions_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_Evidence_issueMatches_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueMatchFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Evidence_issueMatches_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Evidence_issueMatches_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Evidence_issueMatches_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Evidence_issueMatches_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueMatchFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueMatchFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) + } + + var zeroVal *model.IssueMatchFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Evidence_issueMatches_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Evidence_issueMatches_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_IssueMatchFilterValue_affectedService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ServiceFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueMatchFilterValue_affectedService_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_IssueMatchFilterValue_affectedService_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ServiceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ServiceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) + } + + var zeroVal *model.ServiceFilter + return zeroVal, nil +} func (ec *executionContext) field_IssueMatchFilterValue_componentName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ComponentFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOComponentFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueMatchFilterValue_componentName_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_IssueMatchFilterValue_componentName_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ComponentFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ComponentFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOComponentFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentFilter(ctx, tmp) + } + + var zeroVal *model.ComponentFilter + return zeroVal, nil +} func (ec *executionContext) field_IssueMatchFilterValue_primaryName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueMatchFilterValue_primaryName_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_IssueMatchFilterValue_primaryName_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueFilter(ctx, tmp) + } + + var zeroVal *model.IssueFilter + return zeroVal, nil +} func (ec *executionContext) field_IssueMatchFilterValue_supportGroupName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.SupportGroupFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueMatchFilterValue_supportGroupName_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 return args, nil } +func (ec *executionContext) field_IssueMatchFilterValue_supportGroupName_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.SupportGroupFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.SupportGroupFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) + } + + var zeroVal *model.SupportGroupFilter + return zeroVal, nil +} func (ec *executionContext) field_IssueMatch_effectiveIssueVariants_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueVariantFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueMatch_effectiveIssueVariants_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_IssueMatch_effectiveIssueVariants_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_IssueMatch_effectiveIssueVariants_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_IssueMatch_effectiveIssueVariants_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueVariantFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueVariantFilter + return zeroVal, nil + } -func (ec *executionContext) field_IssueMatch_evidences_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.EvidenceFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOEvidenceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.IssueVariantFilter + return zeroVal, nil +} + +func (ec *executionContext) field_IssueMatch_effectiveIssueVariants_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_IssueMatch_effectiveIssueVariants_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_IssueMatch_issueMatchChanges_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_IssueMatch_evidences_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueMatchChangeFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueMatchChangeFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueMatch_evidences_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_IssueMatch_evidences_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_IssueMatch_evidences_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_IssueMatch_evidences_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.EvidenceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.EvidenceFilter + return zeroVal, nil + } -func (ec *executionContext) field_IssueRepository_issueVariants_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.IssueVariantFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOEvidenceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.EvidenceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_IssueMatch_evidences_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_IssueMatch_evidences_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_IssueRepository_services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_IssueMatch_issueMatchChanges_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ServiceFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueMatch_issueMatchChanges_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_IssueMatch_issueMatchChanges_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_IssueMatch_issueMatchChanges_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_IssueMatch_issueMatchChanges_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueMatchChangeFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueMatchChangeFilter + return zeroVal, nil + } -func (ec *executionContext) field_Issue_activities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.ActivityFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOActivityFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOIssueMatchChangeFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.IssueMatchChangeFilter + return zeroVal, nil +} + +func (ec *executionContext) field_IssueMatch_issueMatchChanges_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_IssueMatch_issueMatchChanges_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_Issue_componentVersions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_IssueRepository_issueVariants_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ComponentVersionFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOComponentVersionFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_IssueRepository_issueVariants_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_IssueRepository_issueVariants_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_IssueRepository_issueVariants_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_IssueRepository_issueVariants_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueVariantFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueVariantFilter + return zeroVal, nil + } -func (ec *executionContext) field_Issue_issueMatches_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) + } + + var zeroVal *model.IssueVariantFilter + return zeroVal, nil +} + +func (ec *executionContext) field_IssueRepository_issueVariants_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_IssueRepository_issueVariants_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_IssueRepository_services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueMatchFilter + arg0, err := ec.field_IssueRepository_services_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_IssueRepository_services_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_IssueRepository_services_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_IssueRepository_services_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ServiceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ServiceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) + } + + var zeroVal *model.ServiceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_IssueRepository_services_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_IssueRepository_services_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_activities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Issue_activities_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int + arg1, err := ec.field_Issue_activities_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Issue_activities_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_Issue_activities_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ActivityFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ActivityFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOActivityFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityFilter(ctx, tmp) + } + + var zeroVal *model.ActivityFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_activities_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_activities_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_componentVersions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Issue_componentVersions_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_Issue_componentVersions_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string + arg2, err := ec.field_Issue_componentVersions_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_Issue_componentVersions_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ComponentVersionFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ComponentVersionFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOComponentVersionFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionFilter(ctx, tmp) + } + + var zeroVal *model.ComponentVersionFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_componentVersions_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_componentVersions_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_issueMatches_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Issue_issueMatches_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_Issue_issueMatches_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Issue_issueMatches_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Issue_issueMatches_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueMatchFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueMatchFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) + } + + var zeroVal *model.IssueMatchFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_issueMatches_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_issueMatches_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_Issue_issueVariants_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueVariantFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Issue_issueVariants_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Issue_issueVariants_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Issue_issueVariants_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Issue_issueVariants_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueVariantFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueVariantFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) + } + + var zeroVal *model.IssueVariantFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_issueVariants_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Issue_issueVariants_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addComponentVersionToIssue_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["issueId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addComponentVersionToIssue_argsIssueID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["componentVersionId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("componentVersionId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addComponentVersionToIssue_argsComponentVersionID(ctx, rawArgs) + if err != nil { + return nil, err } args["componentVersionId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_addComponentVersionToIssue_argsIssueID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) + if tmp, ok := rawArgs["issueId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addComponentVersionToIssue_argsComponentVersionID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["componentVersionId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("componentVersionId")) + if tmp, ok := rawArgs["componentVersionId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addEvidenceToIssueMatch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["issueMatchId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueMatchId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addEvidenceToIssueMatch_argsIssueMatchID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueMatchId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["evidenceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("evidenceId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addEvidenceToIssueMatch_argsEvidenceID(ctx, rawArgs) + if err != nil { + return nil, err } args["evidenceId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_addEvidenceToIssueMatch_argsIssueMatchID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueMatchId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueMatchId")) + if tmp, ok := rawArgs["issueMatchId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addEvidenceToIssueMatch_argsEvidenceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["evidenceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("evidenceId")) + if tmp, ok := rawArgs["evidenceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addIssueRepositoryToService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addIssueRepositoryToService_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["issueRepositoryId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueRepositoryId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addIssueRepositoryToService_argsIssueRepositoryID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueRepositoryId"] = arg1 - var arg2 int - if tmp, ok := rawArgs["priority"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) - arg2, err = ec.unmarshalNInt2int(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Mutation_addIssueRepositoryToService_argsPriority(ctx, rawArgs) + if err != nil { + return nil, err } args["priority"] = arg2 return args, nil } +func (ec *executionContext) field_Mutation_addIssueRepositoryToService_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addIssueRepositoryToService_argsIssueRepositoryID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueRepositoryId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueRepositoryId")) + if tmp, ok := rawArgs["issueRepositoryId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addIssueRepositoryToService_argsPriority( + ctx context.Context, + rawArgs map[string]interface{}, +) (int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["priority"] + if !ok { + var zeroVal int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("priority")) + if tmp, ok := rawArgs["priority"]; ok { + return ec.unmarshalNInt2int(ctx, tmp) + } + + var zeroVal int + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addIssueToActivity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["activityId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addIssueToActivity_argsActivityID(ctx, rawArgs) + if err != nil { + return nil, err } args["activityId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["issueId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addIssueToActivity_argsIssueID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_addIssueToActivity_argsActivityID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["activityId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) + if tmp, ok := rawArgs["activityId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addIssueToActivity_argsIssueID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) + if tmp, ok := rawArgs["issueId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addOwnerToService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addOwnerToService_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["userId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addOwnerToService_argsUserID(ctx, rawArgs) + if err != nil { + return nil, err } args["userId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_addOwnerToService_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addOwnerToService_argsUserID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["userId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) + if tmp, ok := rawArgs["userId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addServiceToActivity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["activityId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addServiceToActivity_argsActivityID(ctx, rawArgs) + if err != nil { + return nil, err } args["activityId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addServiceToActivity_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_addServiceToActivity_argsActivityID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["activityId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) + if tmp, ok := rawArgs["activityId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addServiceToActivity_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addServiceToSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["supportGroupId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addServiceToSupportGroup_argsSupportGroupID(ctx, rawArgs) + if err != nil { + return nil, err } args["supportGroupId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addServiceToSupportGroup_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_addServiceToSupportGroup_argsSupportGroupID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["supportGroupId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) + if tmp, ok := rawArgs["supportGroupId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addServiceToSupportGroup_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_addUserToSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["supportGroupId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_addUserToSupportGroup_argsSupportGroupID(ctx, rawArgs) + if err != nil { + return nil, err } args["supportGroupId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["userId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_addUserToSupportGroup_argsUserID(ctx, rawArgs) + if err != nil { + return nil, err } args["userId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_addUserToSupportGroup_argsSupportGroupID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["supportGroupId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) + if tmp, ok := rawArgs["supportGroupId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_addUserToSupportGroup_argsUserID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["userId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) + if tmp, ok := rawArgs["userId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createActivity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.ActivityInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNActivityInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createActivity_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createActivity_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ActivityInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ActivityInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNActivityInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityInput(ctx, tmp) + } + + var zeroVal model.ActivityInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createComponentInstance_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.ComponentInstanceInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNComponentInstanceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createComponentInstance_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createComponentInstance_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ComponentInstanceInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ComponentInstanceInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNComponentInstanceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceInput(ctx, tmp) + } + + var zeroVal model.ComponentInstanceInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createComponentVersion_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.ComponentVersionInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNComponentVersionInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createComponentVersion_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createComponentVersion_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ComponentVersionInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ComponentVersionInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNComponentVersionInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionInput(ctx, tmp) + } + + var zeroVal model.ComponentVersionInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createComponent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.ComponentInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNComponentInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createComponent_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createComponent_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ComponentInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ComponentInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNComponentInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInput(ctx, tmp) + } + + var zeroVal model.ComponentInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createEvidence_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.EvidenceInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNEvidenceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createEvidence_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createEvidence_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.EvidenceInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.EvidenceInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNEvidenceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceInput(ctx, tmp) + } + + var zeroVal model.EvidenceInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createIssueMatchChange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.IssueMatchChangeInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNIssueMatchChangeInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createIssueMatchChange_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createIssueMatchChange_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueMatchChangeInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueMatchChangeInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueMatchChangeInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeInput(ctx, tmp) + } + + var zeroVal model.IssueMatchChangeInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createIssueMatch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.IssueMatchInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNIssueMatchInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createIssueMatch_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createIssueMatch_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueMatchInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueMatchInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueMatchInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchInput(ctx, tmp) + } + + var zeroVal model.IssueMatchInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createIssueRepository_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.IssueRepositoryInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNIssueRepositoryInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createIssueRepository_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createIssueRepository_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueRepositoryInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueRepositoryInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueRepositoryInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryInput(ctx, tmp) + } + + var zeroVal model.IssueRepositoryInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createIssueVariant_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.IssueVariantInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNIssueVariantInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createIssueVariant_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createIssueVariant_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueVariantInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueVariantInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueVariantInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantInput(ctx, tmp) + } + + var zeroVal model.IssueVariantInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_createIssue_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.IssueInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNIssueInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createIssue_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createIssue_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueInput + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_createService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 model.ServiceInput + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNServiceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceInput(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNIssueInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueInput(ctx, tmp) } - args["input"] = arg0 - return args, nil + + var zeroVal model.IssueInput + return zeroVal, nil } -func (ec *executionContext) field_Mutation_createSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_createService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.SupportGroupInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNSupportGroupInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupInput(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_createService_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createService_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ServiceInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ServiceInput + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_createUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNServiceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceInput(ctx, tmp) + } + + var zeroVal model.ServiceInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_createSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 model.UserInput + arg0, err := ec.field_Mutation_createSupportGroup_argsInput(ctx, rawArgs) + if err != nil { + return nil, err + } + args["input"] = arg0 + return args, nil +} +func (ec *executionContext) field_Mutation_createSupportGroup_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.SupportGroupInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.SupportGroupInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNUserInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserInput(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNSupportGroupInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupInput(ctx, tmp) + } + + var zeroVal model.SupportGroupInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_createUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Mutation_createUser_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_createUser_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.UserInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.UserInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNUserInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserInput(ctx, tmp) + } + + var zeroVal model.UserInput + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteActivity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteActivity_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteActivity_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteComponentInstance_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteComponentInstance_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteComponentInstance_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteComponentVersion_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteComponentVersion_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteComponentVersion_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteComponent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteComponent_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteComponent_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteEvidence_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteEvidence_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteEvidence_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteIssueMatchChange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteIssueMatchChange_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteIssueMatchChange_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteIssueMatch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteIssueMatch_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteIssueMatch_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteIssueRepository_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteIssueRepository_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteIssueRepository_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteIssueVariant_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteIssueVariant_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteIssueVariant_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteIssue_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteIssue_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteIssue_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteService_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteService_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteSupportGroup_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteSupportGroup_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_deleteUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_deleteUser_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 return args, nil } +func (ec *executionContext) field_Mutation_deleteUser_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeComponentVersionFromIssue_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["issueId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeComponentVersionFromIssue_argsIssueID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["componentVersionId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("componentVersionId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeComponentVersionFromIssue_argsComponentVersionID(ctx, rawArgs) + if err != nil { + return nil, err } args["componentVersionId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeComponentVersionFromIssue_argsIssueID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) + if tmp, ok := rawArgs["issueId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeComponentVersionFromIssue_argsComponentVersionID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["componentVersionId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("componentVersionId")) + if tmp, ok := rawArgs["componentVersionId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeEvidenceFromIssueMatch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["issueMatchId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueMatchId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeEvidenceFromIssueMatch_argsIssueMatchID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueMatchId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["evidenceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("evidenceId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeEvidenceFromIssueMatch_argsEvidenceID(ctx, rawArgs) + if err != nil { + return nil, err } args["evidenceId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeEvidenceFromIssueMatch_argsIssueMatchID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueMatchId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueMatchId")) + if tmp, ok := rawArgs["issueMatchId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeEvidenceFromIssueMatch_argsEvidenceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["evidenceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("evidenceId")) + if tmp, ok := rawArgs["evidenceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeIssueFromActivity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["activityId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeIssueFromActivity_argsActivityID(ctx, rawArgs) + if err != nil { + return nil, err } args["activityId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["issueId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeIssueFromActivity_argsIssueID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeIssueFromActivity_argsActivityID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["activityId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) + if tmp, ok := rawArgs["activityId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeIssueFromActivity_argsIssueID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueId")) + if tmp, ok := rawArgs["issueId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeIssueRepositoryFromService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeIssueRepositoryFromService_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["issueRepositoryId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("issueRepositoryId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeIssueRepositoryFromService_argsIssueRepositoryID(ctx, rawArgs) + if err != nil { + return nil, err } args["issueRepositoryId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeIssueRepositoryFromService_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeIssueRepositoryFromService_argsIssueRepositoryID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["issueRepositoryId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("issueRepositoryId")) + if tmp, ok := rawArgs["issueRepositoryId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeOwnerFromService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeOwnerFromService_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["userId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeOwnerFromService_argsUserID(ctx, rawArgs) + if err != nil { + return nil, err } args["userId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeOwnerFromService_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeOwnerFromService_argsUserID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["userId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) + if tmp, ok := rawArgs["userId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeServiceFromActivity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["activityId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeServiceFromActivity_argsActivityID(ctx, rawArgs) + if err != nil { + return nil, err } args["activityId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeServiceFromActivity_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeServiceFromActivity_argsActivityID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["activityId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("activityId")) + if tmp, ok := rawArgs["activityId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeServiceFromActivity_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeServiceFromSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["supportGroupId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeServiceFromSupportGroup_argsSupportGroupID(ctx, rawArgs) + if err != nil { + return nil, err } args["supportGroupId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["serviceId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeServiceFromSupportGroup_argsServiceID(ctx, rawArgs) + if err != nil { + return nil, err } args["serviceId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeServiceFromSupportGroup_argsSupportGroupID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["supportGroupId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) + if tmp, ok := rawArgs["supportGroupId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeServiceFromSupportGroup_argsServiceID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serviceId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serviceId")) + if tmp, ok := rawArgs["serviceId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_removeUserFromSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["supportGroupId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_removeUserFromSupportGroup_argsSupportGroupID(ctx, rawArgs) + if err != nil { + return nil, err } args["supportGroupId"] = arg0 - var arg1 string - if tmp, ok := rawArgs["userId"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) - arg1, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_removeUserFromSupportGroup_argsUserID(ctx, rawArgs) + if err != nil { + return nil, err } args["userId"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_removeUserFromSupportGroup_argsSupportGroupID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["supportGroupId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("supportGroupId")) + if tmp, ok := rawArgs["supportGroupId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_removeUserFromSupportGroup_argsUserID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["userId"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) + if tmp, ok := rawArgs["userId"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Mutation_updateActivity_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateActivity_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.ActivityInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNActivityInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateActivity_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateActivity_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_updateComponentInstance_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNID2string(ctx, tmp) } - args["id"] = arg0 - var arg1 model.ComponentInstanceInput + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateActivity_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ActivityInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ActivityInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNComponentInstanceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceInput(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNActivityInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityInput(ctx, tmp) } - args["input"] = arg1 - return args, nil + + var zeroVal model.ActivityInput + return zeroVal, nil } -func (ec *executionContext) field_Mutation_updateComponentVersion_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_updateComponentInstance_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateComponentInstance_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.ComponentVersionInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNComponentVersionInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateComponentInstance_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateComponentInstance_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_updateComponent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNID2string(ctx, tmp) } - args["id"] = arg0 - var arg1 model.ComponentInput + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateComponentInstance_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ComponentInstanceInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ComponentInstanceInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNComponentInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInput(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNComponentInstanceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceInput(ctx, tmp) } - args["input"] = arg1 - return args, nil + + var zeroVal model.ComponentInstanceInput + return zeroVal, nil } -func (ec *executionContext) field_Mutation_updateEvidence_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_updateComponentVersion_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateComponentVersion_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.EvidenceInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNEvidenceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateComponentVersion_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateComponentVersion_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_updateIssueMatchChange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNID2string(ctx, tmp) } - args["id"] = arg0 - var arg1 model.IssueMatchChangeInput + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateComponentVersion_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ComponentVersionInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ComponentVersionInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNIssueMatchChangeInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeInput(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNComponentVersionInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionInput(ctx, tmp) } - args["input"] = arg1 - return args, nil + + var zeroVal model.ComponentVersionInput + return zeroVal, nil } -func (ec *executionContext) field_Mutation_updateIssueMatch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_updateComponent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateComponent_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.IssueMatchInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNIssueMatchInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateComponent_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateComponent_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_updateIssueRepository_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNID2string(ctx, tmp) } - args["id"] = arg0 - var arg1 model.IssueRepositoryInput + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateComponent_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ComponentInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ComponentInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNIssueRepositoryInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryInput(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNComponentInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInput(ctx, tmp) } - args["input"] = arg1 - return args, nil + + var zeroVal model.ComponentInput + return zeroVal, nil } -func (ec *executionContext) field_Mutation_updateIssueVariant_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_updateEvidence_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateEvidence_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.IssueVariantInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNIssueVariantInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateEvidence_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateEvidence_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_updateIssue_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNID2string(ctx, tmp) } - args["id"] = arg0 - var arg1 model.IssueInput + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateEvidence_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.EvidenceInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.EvidenceInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNIssueInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueInput(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalNEvidenceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceInput(ctx, tmp) } - args["input"] = arg1 - return args, nil + + var zeroVal model.EvidenceInput + return zeroVal, nil } -func (ec *executionContext) field_Mutation_updateService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Mutation_updateIssueMatchChange_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateIssueMatchChange_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.ServiceInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNServiceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateIssueMatchChange_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateIssueMatchChange_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_updateSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssueMatchChange_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueMatchChangeInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueMatchChangeInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueMatchChangeInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeInput(ctx, tmp) + } + + var zeroVal model.IssueMatchChangeInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssueMatch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateIssueMatch_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.SupportGroupInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNSupportGroupInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateIssueMatch_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateIssueMatch_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Mutation_updateUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssueMatch_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueMatchInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueMatchInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueMatchInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchInput(ctx, tmp) + } + + var zeroVal model.IssueMatchInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssueRepository_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateIssueRepository_argsID(ctx, rawArgs) + if err != nil { + return nil, err } args["id"] = arg0 - var arg1 model.UserInput - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg1, err = ec.unmarshalNUserInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserInput(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Mutation_updateIssueRepository_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateIssueRepository_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Query_Activities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssueRepository_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueRepositoryInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueRepositoryInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueRepositoryInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryInput(ctx, tmp) + } + + var zeroVal model.IssueRepositoryInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssueVariant_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ActivityFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOActivityFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityFilter(ctx, tmp) - if err != nil { - return nil, err - } - } - args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateIssueVariant_argsID(ctx, rawArgs) + if err != nil { + return nil, err } - args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + args["id"] = arg0 + arg1, err := ec.field_Mutation_updateIssueVariant_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } - args["after"] = arg2 + args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateIssueVariant_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Query_ComponentInstances_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssueVariant_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueVariantInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueVariantInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueVariantInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantInput(ctx, tmp) + } + + var zeroVal model.IssueVariantInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssue_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ComponentInstanceFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOComponentInstanceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceFilter(ctx, tmp) - if err != nil { - return nil, err - } - } - args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateIssue_argsID(ctx, rawArgs) + if err != nil { + return nil, err } - args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + args["id"] = arg0 + arg1, err := ec.field_Mutation_updateIssue_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } - args["after"] = arg2 + args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateIssue_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Query_ComponentVersions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateIssue_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.IssueInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.IssueInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNIssueInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueInput(ctx, tmp) + } + + var zeroVal model.IssueInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateService_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ComponentVersionFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOComponentVersionFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionFilter(ctx, tmp) - if err != nil { - return nil, err - } - } - args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateService_argsID(ctx, rawArgs) + if err != nil { + return nil, err } - args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + args["id"] = arg0 + arg1, err := ec.field_Mutation_updateService_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } - args["after"] = arg2 + args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateService_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Query_Components_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateService_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.ServiceInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.ServiceInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNServiceInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceInput(ctx, tmp) + } + + var zeroVal model.ServiceInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateSupportGroup_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ComponentFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOComponentFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentFilter(ctx, tmp) - if err != nil { - return nil, err - } - } - args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateSupportGroup_argsID(ctx, rawArgs) + if err != nil { + return nil, err } - args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + args["id"] = arg0 + arg1, err := ec.field_Mutation_updateSupportGroup_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } - args["after"] = arg2 + args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateSupportGroup_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Query_Evidences_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateSupportGroup_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.SupportGroupInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.SupportGroupInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNSupportGroupInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupInput(ctx, tmp) + } + + var zeroVal model.SupportGroupInput + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateUser_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.EvidenceFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOEvidenceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceFilter(ctx, tmp) - if err != nil { - return nil, err - } - } - args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Mutation_updateUser_argsID(ctx, rawArgs) + if err != nil { + return nil, err } - args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + args["id"] = arg0 + arg1, err := ec.field_Mutation_updateUser_argsInput(ctx, rawArgs) + if err != nil { + return nil, err } - args["after"] = arg2 + args["input"] = arg1 return args, nil } +func (ec *executionContext) field_Mutation_updateUser_argsID( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["id"] + if !ok { + var zeroVal string + return zeroVal, nil + } -func (ec *executionContext) field_Query_IssueMatchChanges_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + if tmp, ok := rawArgs["id"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} + +func (ec *executionContext) field_Mutation_updateUser_argsInput( + ctx context.Context, + rawArgs map[string]interface{}, +) (model.UserInput, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["input"] + if !ok { + var zeroVal model.UserInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNUserInput2githubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserInput(ctx, tmp) + } + + var zeroVal model.UserInput + return zeroVal, nil +} + +func (ec *executionContext) field_Query_Activities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueMatchChangeFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueMatchChangeFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_Activities_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_Activities_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_Activities_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_Activities_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ActivityFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ActivityFilter + return zeroVal, nil + } -func (ec *executionContext) field_Query_IssueMatches_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.IssueMatchFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOActivityFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.ActivityFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_Activities_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_Activities_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_Query_IssueRepositories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_ComponentInstances_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueRepositoryFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueRepositoryFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_ComponentInstances_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_ComponentInstances_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_ComponentInstances_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_ComponentInstances_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ComponentInstanceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ComponentInstanceFilter + return zeroVal, nil + } -func (ec *executionContext) field_Query_IssueVariants_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.IssueVariantFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOComponentInstanceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.ComponentInstanceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_ComponentInstances_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_ComponentInstances_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_Query_Issues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_ComponentVersions_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_ComponentVersions_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_ComponentVersions_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_ComponentVersions_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_ComponentVersions_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ComponentVersionFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ComponentVersionFilter + return zeroVal, nil + } -func (ec *executionContext) field_Query_Services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.ServiceFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOComponentVersionFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.ComponentVersionFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_ComponentVersions_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_ComponentVersions_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_Query_SupportGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_Components_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.SupportGroupFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_Components_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_Components_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_Components_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_Components_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ComponentFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ComponentFilter + return zeroVal, nil + } -func (ec *executionContext) field_Query_Users_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.UserFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOComponentFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + + var zeroVal *model.ComponentFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_Components_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil } - args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *int + return zeroVal, nil } -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } +func (ec *executionContext) field_Query_Components_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil } - args["name"] = arg0 - return args, nil + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_ServiceFilterValue_serviceName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_Evidences_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ServiceFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_Evidences_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 + arg1, err := ec.field_Query_Evidences_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Query_Evidences_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_Evidences_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.EvidenceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.EvidenceFilter + return zeroVal, nil + } -func (ec *executionContext) field_ServiceFilterValue_supportGroupName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.SupportGroupFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOEvidenceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceFilter(ctx, tmp) } - args["filter"] = arg0 - return args, nil + + var zeroVal *model.EvidenceFilter + return zeroVal, nil } -func (ec *executionContext) field_ServiceFilterValue_uniqueUserId_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.UserFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) - if err != nil { - return nil, err - } +func (ec *executionContext) field_Query_Evidences_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil } - args["filter"] = arg0 - return args, nil + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil } -func (ec *executionContext) field_ServiceFilterValue_userName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.UserFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) - if err != nil { - return nil, err - } +func (ec *executionContext) field_Query_Evidences_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil } - args["filter"] = arg0 - return args, nil + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_Service_activities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_IssueMatchChanges_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.ActivityFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOActivityFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_IssueMatchChanges_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_IssueMatchChanges_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_IssueMatchChanges_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_IssueMatchChanges_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueMatchChangeFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueMatchChangeFilter + return zeroVal, nil + } -func (ec *executionContext) field_Service_componentInstances_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.ComponentInstanceFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOComponentInstanceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOIssueMatchChangeFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.IssueMatchChangeFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueMatchChanges_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueMatchChanges_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_Service_issueRepositories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_IssueMatches_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.IssueRepositoryFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOIssueRepositoryFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_IssueMatches_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_IssueMatches_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_IssueMatches_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_IssueMatches_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueMatchFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueMatchFilter + return zeroVal, nil + } -func (ec *executionContext) field_Service_owners_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.UserFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOIssueMatchFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.IssueMatchFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueMatches_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueMatches_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_Service_supportGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_IssueRepositories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.SupportGroupFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_IssueRepositories_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_IssueRepositories_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_IssueRepositories_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_IssueRepositories_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueRepositoryFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueRepositoryFilter + return zeroVal, nil + } -func (ec *executionContext) field_SupportGroup_services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.ServiceFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOIssueRepositoryFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.IssueRepositoryFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueRepositories_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueRepositories_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_SupportGroup_users_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_IssueVariants_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.UserFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_IssueVariants_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_IssueVariants_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_IssueVariants_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_IssueVariants_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueVariantFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueVariantFilter + return zeroVal, nil + } -func (ec *executionContext) field_User_services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *model.ServiceFilter + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueVariantFilter(ctx, tmp) } - args["filter"] = arg0 - var arg1 *int + + var zeroVal *model.IssueVariantFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueVariants_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - args["first"] = arg1 - var arg2 *string + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_IssueVariants_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - args["after"] = arg2 - return args, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) field_User_supportGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (ec *executionContext) field_Query_Issues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *model.SupportGroupFilter - if tmp, ok := rawArgs["filter"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) - arg0, err = ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_Issues_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err } args["filter"] = arg0 - var arg1 *int - if tmp, ok := rawArgs["first"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) - arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_Issues_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err } args["first"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["after"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } + arg2, err := ec.field_Query_Issues_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } args["after"] = arg2 return args, nil } +func (ec *executionContext) field_Query_Issues_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueFilter + return zeroVal, nil + } -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueFilter(ctx, tmp) } - args["includeDeprecated"] = arg0 - return args, nil + + var zeroVal *model.IssueFilter + return zeroVal, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } +func (ec *executionContext) field_Query_Issues_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil } - args["includeDeprecated"] = arg0 - return args, nil -} -// endregion ***************************** args.gotpl ***************************** + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } -// region ************************** directives.gotpl ************************** + var zeroVal *int + return zeroVal, nil +} -// endregion ************************** directives.gotpl ************************** +func (ec *executionContext) field_Query_Issues_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } -// region **************************** field.gotpl ***************************** + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } -func (ec *executionContext) _Activity_id(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Activity_id(ctx, field) + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Query_Services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Query_Services_argsFilter(ctx, rawArgs) if err != nil { - return graphql.Null + return nil, err } - 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.ID, nil - }) + args["filter"] = arg0 + arg1, err := ec.field_Query_Services_argsFirst(ctx, rawArgs) if err != nil { - ec.Error(ctx, err) - return graphql.Null + return nil, err } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null + args["first"] = arg1 + arg2, err := ec.field_Query_Services_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) + args["after"] = arg2 + return args, nil } +func (ec *executionContext) field_Query_Services_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ServiceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ServiceFilter + return zeroVal, nil + } -func (ec *executionContext) fieldContext_Activity_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Activity", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) } - return fc, nil + + var zeroVal *model.ServiceFilter + return zeroVal, nil } -func (ec *executionContext) _Activity_status(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Activity_status(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_Services_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil } - 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.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - res := resTmp.(*model.ActivityStatusValues) - fc.Result = res - return ec.marshalOActivityStatusValues2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityStatusValues(ctx, field.Selections, res) + + var zeroVal *int + return zeroVal, nil } -func (ec *executionContext) fieldContext_Activity_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Activity", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ActivityStatusValues does not have child fields") - }, +func (ec *executionContext) field_Query_Services_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil } - return fc, nil + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) _Activity_services(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Activity_services(ctx, field) +func (ec *executionContext) field_Query_SupportGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Query_SupportGroups_argsFilter(ctx, rawArgs) if err != nil { - return graphql.Null + return nil, err } - 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.Activity().Services(rctx, obj, fc.Args["filter"].(*model.ServiceFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) - }) + args["filter"] = arg0 + arg1, err := ec.field_Query_SupportGroups_argsFirst(ctx, rawArgs) if err != nil { - ec.Error(ctx, err) - return graphql.Null + return nil, err } - if resTmp == nil { - return graphql.Null + args["first"] = arg1 + arg2, err := ec.field_Query_SupportGroups_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } - res := resTmp.(*model.ServiceConnection) - fc.Result = res - return ec.marshalOServiceConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceConnection(ctx, field.Selections, res) + args["after"] = arg2 + return args, nil } - -func (ec *executionContext) fieldContext_Activity_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Activity", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "totalCount": - return ec.fieldContext_ServiceConnection_totalCount(ctx, field) - case "edges": - return ec.fieldContext_ServiceConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_ServiceConnection_pageInfo(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ServiceConnection", field.Name) - }, +func (ec *executionContext) field_Query_SupportGroups_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.SupportGroupFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.SupportGroupFilter + return zeroVal, nil } - 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_Activity_services_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) } - return fc, nil + + var zeroVal *model.SupportGroupFilter + return zeroVal, nil } -func (ec *executionContext) _Activity_issues(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Activity_issues(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.Activity().Issues(rctx, obj, fc.Args["filter"].(*model.IssueFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null +func (ec *executionContext) field_Query_SupportGroups_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil } - if resTmp == nil { - return graphql.Null + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - res := resTmp.(*model.IssueConnection) - fc.Result = res - return ec.marshalOIssueConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueConnection(ctx, field.Selections, res) + + var zeroVal *int + return zeroVal, nil } -func (ec *executionContext) fieldContext_Activity_issues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Activity", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "totalCount": - return ec.fieldContext_IssueConnection_totalCount(ctx, field) - case "vulnerabilityCount": - return ec.fieldContext_IssueConnection_vulnerabilityCount(ctx, field) - case "policyViolationCount": - return ec.fieldContext_IssueConnection_policyViolationCount(ctx, field) - case "securityEventCount": - return ec.fieldContext_IssueConnection_securityEventCount(ctx, field) - case "edges": - return ec.fieldContext_IssueConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_IssueConnection_pageInfo(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type IssueConnection", field.Name) - }, +func (ec *executionContext) field_Query_SupportGroups_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil } - 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_Activity_issues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) } - return fc, nil + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) _Activity_evidences(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Activity_evidences(ctx, field) +func (ec *executionContext) field_Query_Users_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Query_Users_argsFilter(ctx, rawArgs) if err != nil { - return graphql.Null + return nil, err } - 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.Activity().Evidences(rctx, obj, fc.Args["filter"].(*model.EvidenceFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) - }) + args["filter"] = arg0 + arg1, err := ec.field_Query_Users_argsFirst(ctx, rawArgs) if err != nil { - ec.Error(ctx, err) - return graphql.Null + return nil, err } - if resTmp == nil { - return graphql.Null + args["first"] = arg1 + arg2, err := ec.field_Query_Users_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err } - res := resTmp.(*model.EvidenceConnection) - fc.Result = res - return ec.marshalOEvidenceConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceConnection(ctx, field.Selections, res) + args["after"] = arg2 + return args, nil } - -func (ec *executionContext) fieldContext_Activity_evidences(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Activity", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "totalCount": - return ec.fieldContext_EvidenceConnection_totalCount(ctx, field) - case "edges": - return ec.fieldContext_EvidenceConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_EvidenceConnection_pageInfo(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type EvidenceConnection", field.Name) - }, +func (ec *executionContext) field_Query_Users_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.UserFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.UserFilter + return zeroVal, nil } - 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_Activity_evidences_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) } - return fc, nil + + var zeroVal *model.UserFilter + return zeroVal, nil } -func (ec *executionContext) _Activity_issueMatchChanges(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Activity_issueMatchChanges(ctx, field) - if err != nil { - return graphql.Null +func (ec *executionContext) field_Query_Users_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil } - 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.Activity().IssueMatchChanges(rctx, obj, fc.Args["filter"].(*model.IssueMatchChangeFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) } - if resTmp == nil { - return graphql.Null + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Query_Users_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil } - res := resTmp.(*model.IssueMatchChangeConnection) - fc.Result = res - return ec.marshalOIssueMatchChangeConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeConnection(ctx, field.Selections, res) + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil } -func (ec *executionContext) fieldContext_Activity_issueMatchChanges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Activity", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "totalCount": - return ec.fieldContext_IssueMatchChangeConnection_totalCount(ctx, field) - case "edges": - return ec.fieldContext_IssueMatchChangeConnection_edges(ctx, field) - case "pageInfo": - return ec.fieldContext_IssueMatchChangeConnection_pageInfo(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type IssueMatchChangeConnection", field.Name) - }, +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err } - 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_Activity_issueMatchChanges_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err + args["name"] = arg0 + return args, nil +} +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["name"] + if !ok { + var zeroVal string + return zeroVal, nil } - return fc, nil + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil } -func (ec *executionContext) _ActivityConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ActivityConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ActivityConnection_totalCount(ctx, field) +func (ec *executionContext) field_ServiceFilterValue_serviceName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_ServiceFilterValue_serviceName_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + return args, nil +} +func (ec *executionContext) field_ServiceFilterValue_serviceName_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ServiceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ServiceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) + } + + var zeroVal *model.ServiceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_ServiceFilterValue_supportGroupName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_ServiceFilterValue_supportGroupName_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + return args, nil +} +func (ec *executionContext) field_ServiceFilterValue_supportGroupName_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.SupportGroupFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.SupportGroupFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) + } + + var zeroVal *model.SupportGroupFilter + return zeroVal, nil +} + +func (ec *executionContext) field_ServiceFilterValue_uniqueUserId_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_ServiceFilterValue_uniqueUserId_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + return args, nil +} +func (ec *executionContext) field_ServiceFilterValue_uniqueUserId_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.UserFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.UserFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) + } + + var zeroVal *model.UserFilter + return zeroVal, nil +} + +func (ec *executionContext) field_ServiceFilterValue_userName_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_ServiceFilterValue_userName_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + return args, nil +} +func (ec *executionContext) field_ServiceFilterValue_userName_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.UserFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.UserFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) + } + + var zeroVal *model.UserFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Service_activities_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Service_activities_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_Service_activities_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Service_activities_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_Service_activities_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ActivityFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ActivityFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOActivityFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityFilter(ctx, tmp) + } + + var zeroVal *model.ActivityFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Service_activities_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Service_activities_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Service_componentInstances_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Service_componentInstances_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_Service_componentInstances_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Service_componentInstances_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_Service_componentInstances_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ComponentInstanceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ComponentInstanceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOComponentInstanceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceFilter(ctx, tmp) + } + + var zeroVal *model.ComponentInstanceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Service_componentInstances_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Service_componentInstances_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Service_issueRepositories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Service_issueRepositories_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_Service_issueRepositories_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Service_issueRepositories_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_Service_issueRepositories_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.IssueRepositoryFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.IssueRepositoryFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOIssueRepositoryFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueRepositoryFilter(ctx, tmp) + } + + var zeroVal *model.IssueRepositoryFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Service_issueRepositories_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Service_issueRepositories_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Service_owners_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Service_owners_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_Service_owners_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Service_owners_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_Service_owners_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.UserFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.UserFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) + } + + var zeroVal *model.UserFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Service_owners_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Service_owners_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_Service_supportGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_Service_supportGroups_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_Service_supportGroups_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_Service_supportGroups_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_Service_supportGroups_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.SupportGroupFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.SupportGroupFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) + } + + var zeroVal *model.SupportGroupFilter + return zeroVal, nil +} + +func (ec *executionContext) field_Service_supportGroups_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_Service_supportGroups_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_SupportGroup_services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_SupportGroup_services_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_SupportGroup_services_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_SupportGroup_services_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_SupportGroup_services_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ServiceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ServiceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) + } + + var zeroVal *model.ServiceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_SupportGroup_services_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_SupportGroup_services_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_SupportGroup_users_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_SupportGroup_users_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_SupportGroup_users_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_SupportGroup_users_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_SupportGroup_users_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.UserFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.UserFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOUserFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUserFilter(ctx, tmp) + } + + var zeroVal *model.UserFilter + return zeroVal, nil +} + +func (ec *executionContext) field_SupportGroup_users_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_SupportGroup_users_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_User_services_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_User_services_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_User_services_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_User_services_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_User_services_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.ServiceFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.ServiceFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOServiceFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceFilter(ctx, tmp) + } + + var zeroVal *model.ServiceFilter + return zeroVal, nil +} + +func (ec *executionContext) field_User_services_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_User_services_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field_User_supportGroups_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field_User_supportGroups_argsFilter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["filter"] = arg0 + arg1, err := ec.field_User_supportGroups_argsFirst(ctx, rawArgs) + if err != nil { + return nil, err + } + args["first"] = arg1 + arg2, err := ec.field_User_supportGroups_argsAfter(ctx, rawArgs) + if err != nil { + return nil, err + } + args["after"] = arg2 + return args, nil +} +func (ec *executionContext) field_User_supportGroups_argsFilter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*model.SupportGroupFilter, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["filter"] + if !ok { + var zeroVal *model.SupportGroupFilter + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + if tmp, ok := rawArgs["filter"]; ok { + return ec.unmarshalOSupportGroupFilter2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroupFilter(ctx, tmp) + } + + var zeroVal *model.SupportGroupFilter + return zeroVal, nil +} + +func (ec *executionContext) field_User_supportGroups_argsFirst( + ctx context.Context, + rawArgs map[string]interface{}, +) (*int, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["first"] + if !ok { + var zeroVal *int + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("first")) + if tmp, ok := rawArgs["first"]; ok { + return ec.unmarshalOInt2ᚖint(ctx, tmp) + } + + var zeroVal *int + return zeroVal, nil +} + +func (ec *executionContext) field_User_supportGroups_argsAfter( + ctx context.Context, + rawArgs map[string]interface{}, +) (*string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["after"] + if !ok { + var zeroVal *string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("after")) + if tmp, ok := rawArgs["after"]; ok { + return ec.unmarshalOString2ᚖstring(ctx, tmp) + } + + var zeroVal *string + return zeroVal, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]interface{}, +) (bool, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["includeDeprecated"] + if !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err + } + args["includeDeprecated"] = arg0 + return args, nil +} +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]interface{}, +) (bool, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["includeDeprecated"] + if !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Activity_id(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Activity_id(ctx, field) if err != nil { return graphql.Null } @@ -6479,7 +9944,7 @@ func (ec *executionContext) _ActivityConnection_totalCount(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.TotalCount, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -6491,26 +9956,26 @@ func (ec *executionContext) _ActivityConnection_totalCount(ctx context.Context, } return graphql.Null } - res := resTmp.(int) + res := resTmp.(string) fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) + return ec.marshalNID2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActivityConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Activity_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ActivityConnection", + Object: "Activity", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ActivityConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.ActivityConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ActivityConnection_edges(ctx, field) +func (ec *executionContext) _Activity_status(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Activity_status(ctx, field) if err != nil { return graphql.Null } @@ -6523,7 +9988,7 @@ func (ec *executionContext) _ActivityConnection_edges(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Edges, nil + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) @@ -6532,32 +9997,26 @@ func (ec *executionContext) _ActivityConnection_edges(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.([]*model.ActivityEdge) + res := resTmp.(*model.ActivityStatusValues) fc.Result = res - return ec.marshalOActivityEdge2ᚕᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityEdge(ctx, field.Selections, res) + return ec.marshalOActivityStatusValues2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityStatusValues(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActivityConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Activity_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ActivityConnection", + Object: "Activity", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "node": - return ec.fieldContext_ActivityEdge_node(ctx, field) - case "cursor": - return ec.fieldContext_ActivityEdge_cursor(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ActivityEdge", field.Name) + return nil, errors.New("field of type ActivityStatusValues does not have child fields") }, } return fc, nil } -func (ec *executionContext) _ActivityConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ActivityConnection) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ActivityConnection_pageInfo(ctx, field) +func (ec *executionContext) _Activity_services(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Activity_services(ctx, field) if err != nil { return graphql.Null } @@ -6570,7 +10029,7 @@ func (ec *executionContext) _ActivityConnection_pageInfo(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PageInfo, nil + return ec.resolvers.Activity().Services(rctx, obj, fc.Args["filter"].(*model.ServiceFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) }) if err != nil { ec.Error(ctx, err) @@ -6579,24 +10038,361 @@ func (ec *executionContext) _ActivityConnection_pageInfo(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*model.PageInfo) + res := resTmp.(*model.ServiceConnection) fc.Result = res - return ec.marshalOPageInfo2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) + return ec.marshalOServiceConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐServiceConnection(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ActivityConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Activity_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "ActivityConnection", + Object: "Activity", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "hasNextPage": - return ec.fieldContext_PageInfo_hasNextPage(ctx, field) - case "hasPreviousPage": - return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) - case "isValidPage": + case "totalCount": + return ec.fieldContext_ServiceConnection_totalCount(ctx, field) + case "edges": + return ec.fieldContext_ServiceConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_ServiceConnection_pageInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ServiceConnection", 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_Activity_services_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Activity_issues(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Activity_issues(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.Activity().Issues(rctx, obj, fc.Args["filter"].(*model.IssueFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.IssueConnection) + fc.Result = res + return ec.marshalOIssueConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Activity_issues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Activity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "totalCount": + return ec.fieldContext_IssueConnection_totalCount(ctx, field) + case "vulnerabilityCount": + return ec.fieldContext_IssueConnection_vulnerabilityCount(ctx, field) + case "policyViolationCount": + return ec.fieldContext_IssueConnection_policyViolationCount(ctx, field) + case "securityEventCount": + return ec.fieldContext_IssueConnection_securityEventCount(ctx, field) + case "edges": + return ec.fieldContext_IssueConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_IssueConnection_pageInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IssueConnection", 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_Activity_issues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Activity_evidences(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Activity_evidences(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.Activity().Evidences(rctx, obj, fc.Args["filter"].(*model.EvidenceFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.EvidenceConnection) + fc.Result = res + return ec.marshalOEvidenceConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐEvidenceConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Activity_evidences(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Activity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "totalCount": + return ec.fieldContext_EvidenceConnection_totalCount(ctx, field) + case "edges": + return ec.fieldContext_EvidenceConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_EvidenceConnection_pageInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type EvidenceConnection", 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_Activity_evidences_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Activity_issueMatchChanges(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Activity_issueMatchChanges(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.Activity().IssueMatchChanges(rctx, obj, fc.Args["filter"].(*model.IssueMatchChangeFilter), fc.Args["first"].(*int), fc.Args["after"].(*string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.IssueMatchChangeConnection) + fc.Result = res + return ec.marshalOIssueMatchChangeConnection2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMatchChangeConnection(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Activity_issueMatchChanges(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Activity", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "totalCount": + return ec.fieldContext_IssueMatchChangeConnection_totalCount(ctx, field) + case "edges": + return ec.fieldContext_IssueMatchChangeConnection_edges(ctx, field) + case "pageInfo": + return ec.fieldContext_IssueMatchChangeConnection_pageInfo(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type IssueMatchChangeConnection", 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_Activity_issueMatchChanges_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _ActivityConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ActivityConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ActivityConnection_totalCount(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.TotalCount, 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_ActivityConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ActivityConnection", + 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) _ActivityConnection_edges(ctx context.Context, field graphql.CollectedField, obj *model.ActivityConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ActivityConnection_edges(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.Edges, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*model.ActivityEdge) + fc.Result = res + return ec.marshalOActivityEdge2ᚕᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐActivityEdge(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ActivityConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ActivityConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_ActivityEdge_node(ctx, field) + case "cursor": + return ec.fieldContext_ActivityEdge_cursor(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ActivityEdge", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ActivityConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *model.ActivityConnection) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ActivityConnection_pageInfo(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.PageInfo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.PageInfo) + fc.Result = res + return ec.marshalOPageInfo2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐPageInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ActivityConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ActivityConnection", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "hasNextPage": + return ec.fieldContext_PageInfo_hasNextPage(ctx, field) + case "hasPreviousPage": + return ec.fieldContext_PageInfo_hasPreviousPage(ctx, field) + case "isValidPage": return ec.fieldContext_PageInfo_isValidPage(ctx, field) case "pageNumber": return ec.fieldContext_PageInfo_pageNumber(ctx, field) @@ -10030,6 +13826,8 @@ func (ec *executionContext) fieldContext_Evidence_author(_ context.Context, fiel return ec.fieldContext_User_supportGroups(ctx, field) case "services": return ec.fieldContext_User_services(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, @@ -12035,6 +15833,8 @@ func (ec *executionContext) fieldContext_IssueMatch_user(_ context.Context, fiel return ec.fieldContext_User_supportGroups(ctx, field) case "services": return ec.fieldContext_User_services(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, @@ -15215,8 +19015,8 @@ func (ec *executionContext) fieldContext_IssueVariantEdge_updated_at(_ context.C return fc, nil } -func (ec *executionContext) _Mutation_createUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createUser(ctx, field) +func (ec *executionContext) _Metadata_created_at(ctx context.Context, field graphql.CollectedField, obj *model.Metadata) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_created_at(ctx, field) if err != nil { return graphql.Null } @@ -15229,63 +19029,35 @@ func (ec *executionContext) _Mutation_createUser(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateUser(rctx, fc.Args["input"].(model.UserInput)) + return obj.CreatedAt, 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.(*model.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_created_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Metadata", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "uniqueUserId": - return ec.fieldContext_User_uniqueUserId(ctx, field) - case "type": - return ec.fieldContext_User_type(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "supportGroups": - return ec.fieldContext_User_supportGroups(ctx, field) - case "services": - return ec.fieldContext_User_services(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type DateTime does not have child fields") }, } - 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_Mutation_createUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_updateUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateUser(ctx, field) +func (ec *executionContext) _Metadata_created_by(ctx context.Context, field graphql.CollectedField, obj *model.Metadata) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_created_by(ctx, field) if err != nil { return graphql.Null } @@ -15298,63 +19070,35 @@ func (ec *executionContext) _Mutation_updateUser(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateUser(rctx, fc.Args["id"].(string), fc.Args["input"].(model.UserInput)) + return obj.CreatedBy, 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.(*model.User) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUser2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_created_by(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Metadata", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_User_id(ctx, field) - case "uniqueUserId": - return ec.fieldContext_User_uniqueUserId(ctx, field) - case "type": - return ec.fieldContext_User_type(ctx, field) - case "name": - return ec.fieldContext_User_name(ctx, field) - case "supportGroups": - return ec.fieldContext_User_supportGroups(ctx, field) - case "services": - return ec.fieldContext_User_services(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } - 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_Mutation_updateUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_deleteUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_deleteUser(ctx, field) +func (ec *executionContext) _Metadata_deleted_at(ctx context.Context, field graphql.CollectedField, obj *model.Metadata) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_deleted_at(ctx, field) if err != nil { return graphql.Null } @@ -15367,49 +19111,35 @@ func (ec *executionContext) _Mutation_deleteUser(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteUser(rctx, fc.Args["id"].(string)) + return obj.DeletedAt, 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.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_deleteUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_deleted_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Metadata", Field: field, - IsMethod: true, - IsResolver: true, + 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 nil, errors.New("field of type DateTime does not have child fields") }, } - 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_Mutation_deleteUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Mutation_createSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createSupportGroup(ctx, field) +func (ec *executionContext) _Metadata_updated_at(ctx context.Context, field graphql.CollectedField, obj *model.Metadata) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_updated_at(ctx, field) if err != nil { return graphql.Null } @@ -15422,59 +19152,76 @@ func (ec *executionContext) _Mutation_createSupportGroup(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateSupportGroup(rctx, fc.Args["input"].(model.SupportGroupInput)) + return obj.UpdatedAt, 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.(*model.SupportGroup) + res := resTmp.(*string) fc.Result = res - return ec.marshalNSupportGroup2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroup(ctx, field.Selections, res) + return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_createSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Metadata_updated_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Mutation", + Object: "Metadata", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_SupportGroup_id(ctx, field) - case "name": - return ec.fieldContext_SupportGroup_name(ctx, field) - case "users": - return ec.fieldContext_SupportGroup_users(ctx, field) - case "services": - return ec.fieldContext_SupportGroup_services(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) + return nil, errors.New("field of type DateTime does not have child fields") }, } + return fc, nil +} + +func (ec *executionContext) _Metadata_updated_by(ctx context.Context, field graphql.CollectedField, obj *model.Metadata) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Metadata_updated_by(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UpdatedBy, nil + }) + if err != nil { ec.Error(ctx, err) - return fc, 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_Metadata_updated_by(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Metadata", + 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) _Mutation_updateSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_updateSupportGroup(ctx, field) +func (ec *executionContext) _Mutation_createUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createUser(ctx, field) if err != nil { return graphql.Null } @@ -15487,7 +19234,7 @@ func (ec *executionContext) _Mutation_updateSupportGroup(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateSupportGroup(rctx, fc.Args["id"].(string), fc.Args["input"].(model.SupportGroupInput)) + return ec.resolvers.Mutation().CreateUser(rctx, fc.Args["input"].(model.UserInput)) }) if err != nil { ec.Error(ctx, err) @@ -15499,12 +19246,12 @@ func (ec *executionContext) _Mutation_updateSupportGroup(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*model.SupportGroup) + res := resTmp.(*model.User) fc.Result = res - return ec.marshalNSupportGroup2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroup(ctx, field.Selections, res) + return ec.marshalNUser2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_updateSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -15513,15 +19260,21 @@ func (ec *executionContext) fieldContext_Mutation_updateSupportGroup(ctx context Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_SupportGroup_id(ctx, field) + return ec.fieldContext_User_id(ctx, field) + case "uniqueUserId": + return ec.fieldContext_User_uniqueUserId(ctx, field) + case "type": + return ec.fieldContext_User_type(ctx, field) case "name": - return ec.fieldContext_SupportGroup_name(ctx, field) - case "users": - return ec.fieldContext_SupportGroup_users(ctx, field) + return ec.fieldContext_User_name(ctx, field) + case "supportGroups": + return ec.fieldContext_User_supportGroups(ctx, field) case "services": - return ec.fieldContext_SupportGroup_services(ctx, field) + return ec.fieldContext_User_services(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } defer func() { @@ -15531,15 +19284,15 @@ func (ec *executionContext) fieldContext_Mutation_updateSupportGroup(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_createUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_deleteSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_deleteSupportGroup(ctx, field) +func (ec *executionContext) _Mutation_updateUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateUser(ctx, field) if err != nil { return graphql.Null } @@ -15552,7 +19305,7 @@ func (ec *executionContext) _Mutation_deleteSupportGroup(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteSupportGroup(rctx, fc.Args["id"].(string)) + return ec.resolvers.Mutation().UpdateUser(rctx, fc.Args["id"].(string), fc.Args["input"].(model.UserInput)) }) if err != nil { ec.Error(ctx, err) @@ -15564,19 +19317,35 @@ func (ec *executionContext) _Mutation_deleteSupportGroup(ctx context.Context, fi } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*model.User) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNUser2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_deleteSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", 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") + switch field.Name { + case "id": + return ec.fieldContext_User_id(ctx, field) + case "uniqueUserId": + return ec.fieldContext_User_uniqueUserId(ctx, field) + case "type": + return ec.fieldContext_User_type(ctx, field) + case "name": + return ec.fieldContext_User_name(ctx, field) + case "supportGroups": + return ec.fieldContext_User_supportGroups(ctx, field) + case "services": + return ec.fieldContext_User_services(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, } defer func() { @@ -15586,15 +19355,15 @@ func (ec *executionContext) fieldContext_Mutation_deleteSupportGroup(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_deleteSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_updateUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_addServiceToSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_addServiceToSupportGroup(ctx, field) +func (ec *executionContext) _Mutation_deleteUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteUser(ctx, field) if err != nil { return graphql.Null } @@ -15607,7 +19376,7 @@ func (ec *executionContext) _Mutation_addServiceToSupportGroup(ctx context.Conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().AddServiceToSupportGroup(rctx, fc.Args["supportGroupId"].(string), fc.Args["serviceId"].(string)) + return ec.resolvers.Mutation().DeleteUser(rctx, fc.Args["id"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -15619,29 +19388,19 @@ func (ec *executionContext) _Mutation_addServiceToSupportGroup(ctx context.Conte } return graphql.Null } - res := resTmp.(*model.SupportGroup) + res := resTmp.(string) fc.Result = res - return ec.marshalNSupportGroup2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroup(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_addServiceToSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_deleteUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_SupportGroup_id(ctx, field) - case "name": - return ec.fieldContext_SupportGroup_name(ctx, field) - case "users": - return ec.fieldContext_SupportGroup_users(ctx, field) - case "services": - return ec.fieldContext_SupportGroup_services(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } defer func() { @@ -15651,15 +19410,15 @@ func (ec *executionContext) fieldContext_Mutation_addServiceToSupportGroup(ctx c } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_addServiceToSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_deleteUser_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_removeServiceFromSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_removeServiceFromSupportGroup(ctx, field) +func (ec *executionContext) _Mutation_createSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createSupportGroup(ctx, field) if err != nil { return graphql.Null } @@ -15672,7 +19431,7 @@ func (ec *executionContext) _Mutation_removeServiceFromSupportGroup(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().RemoveServiceFromSupportGroup(rctx, fc.Args["supportGroupId"].(string), fc.Args["serviceId"].(string)) + return ec.resolvers.Mutation().CreateSupportGroup(rctx, fc.Args["input"].(model.SupportGroupInput)) }) if err != nil { ec.Error(ctx, err) @@ -15689,7 +19448,257 @@ func (ec *executionContext) _Mutation_removeServiceFromSupportGroup(ctx context. return ec.marshalNSupportGroup2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroup(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Mutation_removeServiceFromSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_SupportGroup_id(ctx, field) + case "name": + return ec.fieldContext_SupportGroup_name(ctx, field) + case "users": + return ec.fieldContext_SupportGroup_users(ctx, field) + case "services": + return ec.fieldContext_SupportGroup_services(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SupportGroup", 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_Mutation_createSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateSupportGroup(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.Mutation().UpdateSupportGroup(rctx, fc.Args["id"].(string), fc.Args["input"].(model.SupportGroupInput)) + }) + 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.(*model.SupportGroup) + fc.Result = res + return ec.marshalNSupportGroup2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_SupportGroup_id(ctx, field) + case "name": + return ec.fieldContext_SupportGroup_name(ctx, field) + case "users": + return ec.fieldContext_SupportGroup_users(ctx, field) + case "services": + return ec.fieldContext_SupportGroup_services(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SupportGroup", 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_Mutation_updateSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_deleteSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteSupportGroup(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.Mutation().DeleteSupportGroup(rctx, fc.Args["id"].(string)) + }) + 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.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_deleteSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + 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") + }, + } + 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_Mutation_deleteSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_addServiceToSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_addServiceToSupportGroup(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.Mutation().AddServiceToSupportGroup(rctx, fc.Args["supportGroupId"].(string), fc.Args["serviceId"].(string)) + }) + 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.(*model.SupportGroup) + fc.Result = res + return ec.marshalNSupportGroup2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_addServiceToSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_SupportGroup_id(ctx, field) + case "name": + return ec.fieldContext_SupportGroup_name(ctx, field) + case "users": + return ec.fieldContext_SupportGroup_users(ctx, field) + case "services": + return ec.fieldContext_SupportGroup_services(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SupportGroup", 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_Mutation_addServiceToSupportGroup_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Mutation_removeServiceFromSupportGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_removeServiceFromSupportGroup(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.Mutation().RemoveServiceFromSupportGroup(rctx, fc.Args["supportGroupId"].(string), fc.Args["serviceId"].(string)) + }) + 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.(*model.SupportGroup) + fc.Result = res + return ec.marshalNSupportGroup2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐSupportGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_removeServiceFromSupportGroup(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -22191,6 +26200,59 @@ func (ec *executionContext) fieldContext_User_services(ctx context.Context, fiel return fc, nil } +func (ec *executionContext) _User_metadata(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _UserConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.UserConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_UserConnection_totalCount(ctx, field) if err != nil { @@ -22388,6 +26450,8 @@ func (ec *executionContext) fieldContext_UserEdge_node(_ context.Context, field return ec.fieldContext_User_supportGroups(ctx, field) case "services": return ec.fieldContext_User_services(ctx, field) + case "metadata": + return ec.fieldContext_User_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type User", field.Name) }, @@ -25345,92 +29409,170 @@ func (ec *executionContext) _Connection(ctx context.Context, sel ast.SelectionSe case nil: return graphql.Null case model.ActivityConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ActivityConnection"})) == 0 { + return graphql.Empty{} + } return ec._ActivityConnection(ctx, sel, &obj) case *model.ActivityConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ActivityConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ActivityConnection(ctx, sel, obj) case model.ComponentConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ComponentConnection"})) == 0 { + return graphql.Empty{} + } return ec._ComponentConnection(ctx, sel, &obj) case *model.ComponentConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ComponentConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentConnection(ctx, sel, obj) case model.ComponentInstanceConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ComponentInstanceConnection"})) == 0 { + return graphql.Empty{} + } return ec._ComponentInstanceConnection(ctx, sel, &obj) case *model.ComponentInstanceConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ComponentInstanceConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentInstanceConnection(ctx, sel, obj) case model.ComponentVersionConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ComponentVersionConnection"})) == 0 { + return graphql.Empty{} + } return ec._ComponentVersionConnection(ctx, sel, &obj) case *model.ComponentVersionConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ComponentVersionConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentVersionConnection(ctx, sel, obj) case model.EvidenceConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "EvidenceConnection"})) == 0 { + return graphql.Empty{} + } return ec._EvidenceConnection(ctx, sel, &obj) case *model.EvidenceConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "EvidenceConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._EvidenceConnection(ctx, sel, obj) case model.IssueConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueConnection"})) == 0 { + return graphql.Empty{} + } return ec._IssueConnection(ctx, sel, &obj) case *model.IssueConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueConnection(ctx, sel, obj) case model.IssueMatchConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueMatchConnection"})) == 0 { + return graphql.Empty{} + } return ec._IssueMatchConnection(ctx, sel, &obj) case *model.IssueMatchConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueMatchConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueMatchConnection(ctx, sel, obj) case model.IssueMatchChangeConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueMatchChangeConnection"})) == 0 { + return graphql.Empty{} + } return ec._IssueMatchChangeConnection(ctx, sel, &obj) case *model.IssueMatchChangeConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueMatchChangeConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueMatchChangeConnection(ctx, sel, obj) case model.IssueRepositoryConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueRepositoryConnection"})) == 0 { + return graphql.Empty{} + } return ec._IssueRepositoryConnection(ctx, sel, &obj) case *model.IssueRepositoryConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueRepositoryConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueRepositoryConnection(ctx, sel, obj) case model.IssueVariantConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueVariantConnection"})) == 0 { + return graphql.Empty{} + } return ec._IssueVariantConnection(ctx, sel, &obj) case *model.IssueVariantConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "IssueVariantConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueVariantConnection(ctx, sel, obj) case model.ServiceConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ServiceConnection"})) == 0 { + return graphql.Empty{} + } return ec._ServiceConnection(ctx, sel, &obj) case *model.ServiceConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "ServiceConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ServiceConnection(ctx, sel, obj) case model.SupportGroupConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "SupportGroupConnection"})) == 0 { + return graphql.Empty{} + } return ec._SupportGroupConnection(ctx, sel, &obj) case *model.SupportGroupConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "SupportGroupConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._SupportGroupConnection(ctx, sel, obj) case model.UserConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "UserConnection"})) == 0 { + return graphql.Empty{} + } return ec._UserConnection(ctx, sel, &obj) case *model.UserConnection: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Connection", "UserConnection"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } @@ -25445,92 +29587,170 @@ func (ec *executionContext) _Edge(ctx context.Context, sel ast.SelectionSet, obj case nil: return graphql.Null case model.ActivityEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ActivityEdge"})) == 0 { + return graphql.Empty{} + } return ec._ActivityEdge(ctx, sel, &obj) case *model.ActivityEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ActivityEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ActivityEdge(ctx, sel, obj) case model.ComponentEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ComponentEdge"})) == 0 { + return graphql.Empty{} + } return ec._ComponentEdge(ctx, sel, &obj) case *model.ComponentEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ComponentEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentEdge(ctx, sel, obj) case model.ComponentInstanceEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ComponentInstanceEdge"})) == 0 { + return graphql.Empty{} + } return ec._ComponentInstanceEdge(ctx, sel, &obj) case *model.ComponentInstanceEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ComponentInstanceEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentInstanceEdge(ctx, sel, obj) case model.ComponentVersionEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ComponentVersionEdge"})) == 0 { + return graphql.Empty{} + } return ec._ComponentVersionEdge(ctx, sel, &obj) case *model.ComponentVersionEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ComponentVersionEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentVersionEdge(ctx, sel, obj) case model.EvidenceEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "EvidenceEdge"})) == 0 { + return graphql.Empty{} + } return ec._EvidenceEdge(ctx, sel, &obj) case *model.EvidenceEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "EvidenceEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._EvidenceEdge(ctx, sel, obj) case model.IssueEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueEdge"})) == 0 { + return graphql.Empty{} + } return ec._IssueEdge(ctx, sel, &obj) case *model.IssueEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueEdge(ctx, sel, obj) case model.IssueMatchEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueMatchEdge"})) == 0 { + return graphql.Empty{} + } return ec._IssueMatchEdge(ctx, sel, &obj) case *model.IssueMatchEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueMatchEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueMatchEdge(ctx, sel, obj) case model.IssueMatchChangeEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueMatchChangeEdge"})) == 0 { + return graphql.Empty{} + } return ec._IssueMatchChangeEdge(ctx, sel, &obj) case *model.IssueMatchChangeEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueMatchChangeEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueMatchChangeEdge(ctx, sel, obj) case model.IssueRepositoryEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueRepositoryEdge"})) == 0 { + return graphql.Empty{} + } return ec._IssueRepositoryEdge(ctx, sel, &obj) case *model.IssueRepositoryEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueRepositoryEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueRepositoryEdge(ctx, sel, obj) case model.IssueVariantEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueVariantEdge"})) == 0 { + return graphql.Empty{} + } return ec._IssueVariantEdge(ctx, sel, &obj) case *model.IssueVariantEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "IssueVariantEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueVariantEdge(ctx, sel, obj) case model.ServiceEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ServiceEdge"})) == 0 { + return graphql.Empty{} + } return ec._ServiceEdge(ctx, sel, &obj) case *model.ServiceEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "ServiceEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ServiceEdge(ctx, sel, obj) case model.SupportGroupEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "SupportGroupEdge"})) == 0 { + return graphql.Empty{} + } return ec._SupportGroupEdge(ctx, sel, &obj) case *model.SupportGroupEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "SupportGroupEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._SupportGroupEdge(ctx, sel, obj) case model.UserEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "UserEdge"})) == 0 { + return graphql.Empty{} + } return ec._UserEdge(ctx, sel, &obj) case *model.UserEdge: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Edge", "UserEdge"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } @@ -25545,92 +29765,170 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj case nil: return graphql.Null case model.Activity: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Activity"})) == 0 { + return graphql.Empty{} + } return ec._Activity(ctx, sel, &obj) case *model.Activity: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Activity"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._Activity(ctx, sel, obj) case model.Component: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Component"})) == 0 { + return graphql.Empty{} + } return ec._Component(ctx, sel, &obj) case *model.Component: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Component"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._Component(ctx, sel, obj) case model.ComponentInstance: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "ComponentInstance"})) == 0 { + return graphql.Empty{} + } return ec._ComponentInstance(ctx, sel, &obj) case *model.ComponentInstance: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "ComponentInstance"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentInstance(ctx, sel, obj) case model.ComponentVersion: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "ComponentVersion"})) == 0 { + return graphql.Empty{} + } return ec._ComponentVersion(ctx, sel, &obj) case *model.ComponentVersion: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "ComponentVersion"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._ComponentVersion(ctx, sel, obj) case model.Evidence: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Evidence"})) == 0 { + return graphql.Empty{} + } return ec._Evidence(ctx, sel, &obj) case *model.Evidence: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Evidence"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._Evidence(ctx, sel, obj) case model.Issue: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Issue"})) == 0 { + return graphql.Empty{} + } return ec._Issue(ctx, sel, &obj) case *model.Issue: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Issue"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._Issue(ctx, sel, obj) case model.IssueMatch: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueMatch"})) == 0 { + return graphql.Empty{} + } return ec._IssueMatch(ctx, sel, &obj) case *model.IssueMatch: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueMatch"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueMatch(ctx, sel, obj) case model.IssueMatchChange: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueMatchChange"})) == 0 { + return graphql.Empty{} + } return ec._IssueMatchChange(ctx, sel, &obj) case *model.IssueMatchChange: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueMatchChange"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueMatchChange(ctx, sel, obj) case model.IssueRepository: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueRepository"})) == 0 { + return graphql.Empty{} + } return ec._IssueRepository(ctx, sel, &obj) case *model.IssueRepository: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueRepository"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueRepository(ctx, sel, obj) case model.IssueVariant: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueVariant"})) == 0 { + return graphql.Empty{} + } return ec._IssueVariant(ctx, sel, &obj) case *model.IssueVariant: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "IssueVariant"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._IssueVariant(ctx, sel, obj) case model.Service: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Service"})) == 0 { + return graphql.Empty{} + } return ec._Service(ctx, sel, &obj) case *model.Service: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "Service"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._Service(ctx, sel, obj) case model.SupportGroup: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "SupportGroup"})) == 0 { + return graphql.Empty{} + } return ec._SupportGroup(ctx, sel, &obj) case *model.SupportGroup: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "SupportGroup"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } return ec._SupportGroup(ctx, sel, obj) case model.User: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "User"})) == 0 { + return graphql.Empty{} + } return ec._User(ctx, sel, &obj) case *model.User: + if len(graphql.CollectFields(ec.OperationContext, sel, []string{"Node", "User"})) == 0 { + return graphql.Empty{} + } if obj == nil { return graphql.Null } @@ -25656,24 +29954,2434 @@ func (ec *executionContext) _Activity(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Activity") case "id": + field := field + + 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 ec._Activity_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Activity_id(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "status": + field := field + + 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 ec._Activity_status(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Activity_status(ctx, field, obj) case "services": 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._Activity_services(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 ec._Activity_services(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Activity_services(ctx, field, obj) + case "issues": + field := field + + 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 ec._Activity_issues(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Activity_issues(ctx, field, obj) + case "evidences": + field := field + + 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 ec._Activity_evidences(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Activity_evidences(ctx, field, obj) + case "issueMatchChanges": + field := field + + 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 ec._Activity_issueMatchChanges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Activity_issueMatchChanges(ctx, field, obj) + 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 activityConnectionImplementors = []string{"ActivityConnection", "Connection"} + +func (ec *executionContext) _ActivityConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ActivityConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, activityConnectionImplementors) + + 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("ActivityConnection") + case "totalCount": + field := field + + 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 ec._ActivityConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ActivityConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "edges": + field := field + + 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 ec._ActivityConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ActivityConnection_edges(ctx, field, obj) + case "pageInfo": + field := field + + 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 ec._ActivityConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ActivityConnection_pageInfo(ctx, field, obj) + 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 activityEdgeImplementors = []string{"ActivityEdge", "Edge"} + +func (ec *executionContext) _ActivityEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ActivityEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, activityEdgeImplementors) + + 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("ActivityEdge") + case "node": + field := field + + 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 ec._ActivityEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ActivityEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "cursor": + field := field + + 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 ec._ActivityEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ActivityEdge_cursor(ctx, field, obj) + 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 cVSSImplementors = []string{"CVSS"} + +func (ec *executionContext) _CVSS(ctx context.Context, sel ast.SelectionSet, obj *model.Cvss) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cVSSImplementors) + + 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("CVSS") + case "vector": + field := field + + 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 ec._CVSS_vector(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSS_vector(ctx, field, obj) + case "base": + field := field + + 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 ec._CVSS_base(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSS_base(ctx, field, obj) + case "temporal": + field := field + + 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 ec._CVSS_temporal(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSS_temporal(ctx, field, obj) + case "environmental": + field := field + + 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 ec._CVSS_environmental(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSS_environmental(ctx, field, obj) + 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 cVSSBaseImplementors = []string{"CVSSBase"} + +func (ec *executionContext) _CVSSBase(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSBase) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cVSSBaseImplementors) + + 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("CVSSBase") + case "score": + field := field + + 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 ec._CVSSBase_score(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_score(ctx, field, obj) + case "attackVector": + field := field + + 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 ec._CVSSBase_attackVector(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_attackVector(ctx, field, obj) + case "attackComplexity": + field := field + + 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 ec._CVSSBase_attackComplexity(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_attackComplexity(ctx, field, obj) + case "privilegesRequired": + field := field + + 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 ec._CVSSBase_privilegesRequired(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_privilegesRequired(ctx, field, obj) + case "userInteraction": + field := field + + 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 ec._CVSSBase_userInteraction(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_userInteraction(ctx, field, obj) + case "scope": + field := field + + 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 ec._CVSSBase_scope(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_scope(ctx, field, obj) + case "confidentialityImpact": + field := field + + 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 ec._CVSSBase_confidentialityImpact(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_confidentialityImpact(ctx, field, obj) + case "integrityImpact": + field := field + + 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 ec._CVSSBase_integrityImpact(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_integrityImpact(ctx, field, obj) + case "availabilityImpact": + field := field + + 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 ec._CVSSBase_availabilityImpact(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSBase_availabilityImpact(ctx, field, obj) + 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 cVSSEnvironmentalImplementors = []string{"CVSSEnvironmental"} + +func (ec *executionContext) _CVSSEnvironmental(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSEnvironmental) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cVSSEnvironmentalImplementors) + + 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("CVSSEnvironmental") + case "score": + field := field + + 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 ec._CVSSEnvironmental_score(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_score(ctx, field, obj) + case "modifiedAttackVector": + field := field + + 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 ec._CVSSEnvironmental_modifiedAttackVector(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedAttackVector(ctx, field, obj) + case "modifiedAttackComplexity": + field := field + + 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 ec._CVSSEnvironmental_modifiedAttackComplexity(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedAttackComplexity(ctx, field, obj) + case "modifiedPrivilegesRequired": + field := field + + 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 ec._CVSSEnvironmental_modifiedPrivilegesRequired(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedPrivilegesRequired(ctx, field, obj) + case "modifiedUserInteraction": + field := field + + 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 ec._CVSSEnvironmental_modifiedUserInteraction(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedUserInteraction(ctx, field, obj) + case "modifiedScope": + field := field + + 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 ec._CVSSEnvironmental_modifiedScope(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedScope(ctx, field, obj) + case "modifiedConfidentialityImpact": + field := field + + 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 ec._CVSSEnvironmental_modifiedConfidentialityImpact(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedConfidentialityImpact(ctx, field, obj) + case "modifiedIntegrityImpact": + field := field + + 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 ec._CVSSEnvironmental_modifiedIntegrityImpact(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedIntegrityImpact(ctx, field, obj) + case "modifiedAvailabilityImpact": + field := field + + 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 ec._CVSSEnvironmental_modifiedAvailabilityImpact(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_modifiedAvailabilityImpact(ctx, field, obj) + case "confidentialityRequirement": + field := field + + 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 ec._CVSSEnvironmental_confidentialityRequirement(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_confidentialityRequirement(ctx, field, obj) + case "availabilityRequirement": + field := field + + 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 ec._CVSSEnvironmental_availabilityRequirement(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_availabilityRequirement(ctx, field, obj) + case "integrityRequirement": + field := field + + 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 ec._CVSSEnvironmental_integrityRequirement(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSEnvironmental_integrityRequirement(ctx, field, obj) + 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 cVSSParameterImplementors = []string{"CVSSParameter"} + +func (ec *executionContext) _CVSSParameter(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSParameter) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cVSSParameterImplementors) + + 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("CVSSParameter") + case "name": + field := field + + 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 ec._CVSSParameter_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSParameter_name(ctx, field, obj) + case "value": + field := field + + 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 ec._CVSSParameter_value(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSParameter_value(ctx, field, obj) + 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 cVSSTemporalImplementors = []string{"CVSSTemporal"} + +func (ec *executionContext) _CVSSTemporal(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSTemporal) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, cVSSTemporalImplementors) + + 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("CVSSTemporal") + case "score": + field := field + + 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 ec._CVSSTemporal_score(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSTemporal_score(ctx, field, obj) + case "exploitCodeMaturity": + field := field + + 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 ec._CVSSTemporal_exploitCodeMaturity(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSTemporal_exploitCodeMaturity(ctx, field, obj) + case "remediationLevel": + field := field + + 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 ec._CVSSTemporal_remediationLevel(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSTemporal_remediationLevel(ctx, field, obj) + case "reportConfidence": + field := field + + 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 ec._CVSSTemporal_reportConfidence(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._CVSSTemporal_reportConfidence(ctx, field, obj) + 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 componentImplementors = []string{"Component", "Node"} + +func (ec *executionContext) _Component(ctx context.Context, sel ast.SelectionSet, obj *model.Component) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentImplementors) + + 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("Component") + case "id": + field := field + + 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 ec._Component_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Component_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + field := field + + 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 ec._Component_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Component_name(ctx, field, obj) + case "type": + field := field + + 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 ec._Component_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Component_type(ctx, field, obj) + case "componentVersions": + field := field + + 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 ec._Component_componentVersions(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Component_componentVersions(ctx, field, obj) + 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 componentConnectionImplementors = []string{"ComponentConnection", "Connection"} + +func (ec *executionContext) _ComponentConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentConnectionImplementors) + + 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("ComponentConnection") + case "totalCount": + field := field + + 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 ec._ComponentConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "edges": + field := field + + 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 ec._ComponentConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentConnection_edges(ctx, field, obj) + case "pageInfo": + field := field + + 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 ec._ComponentConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentConnection_pageInfo(ctx, field, obj) + 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 componentEdgeImplementors = []string{"ComponentEdge", "Edge"} + +func (ec *executionContext) _ComponentEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentEdgeImplementors) + + 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("ComponentEdge") + case "node": + field := field + + 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 ec._ComponentEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "cursor": + field := field + + 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 ec._ComponentEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentEdge_cursor(ctx, field, obj) + 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 componentInstanceImplementors = []string{"ComponentInstance", "Node"} + +func (ec *executionContext) _ComponentInstance(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentInstance) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentInstanceImplementors) + + 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("ComponentInstance") + case "id": + field := field + + 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 ec._ComponentInstance_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "ccrn": + field := field + + 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 ec._ComponentInstance_ccrn(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_ccrn(ctx, field, obj) + case "count": + field := field + + 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 ec._ComponentInstance_count(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_count(ctx, field, obj) + case "componentVersionId": + field := field + + 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 ec._ComponentInstance_componentVersionId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_componentVersionId(ctx, field, obj) + case "componentVersion": + field := field + + 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 ec._ComponentInstance_componentVersion(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_componentVersion(ctx, field, obj) + case "issueMatches": + field := field + + 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 ec._ComponentInstance_issueMatches(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_issueMatches(ctx, field, obj) + case "serviceId": + field := field + + 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 ec._ComponentInstance_serviceId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_serviceId(ctx, field, obj) + case "service": + field := field + + 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 ec._ComponentInstance_service(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_service(ctx, field, obj) + case "createdAt": + field := field + + 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 ec._ComponentInstance_createdAt(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_createdAt(ctx, field, obj) + case "updatedAt": + field := field + + 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 ec._ComponentInstance_updatedAt(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstance_updatedAt(ctx, field, obj) + 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 componentInstanceConnectionImplementors = []string{"ComponentInstanceConnection", "Connection"} + +func (ec *executionContext) _ComponentInstanceConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentInstanceConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentInstanceConnectionImplementors) + + 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("ComponentInstanceConnection") + case "totalCount": + field := field + + 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 ec._ComponentInstanceConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstanceConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "edges": + field := field + + 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 ec._ComponentInstanceConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstanceConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pageInfo": + field := field + + 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 ec._ComponentInstanceConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstanceConnection_pageInfo(ctx, field, obj) + 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 componentInstanceEdgeImplementors = []string{"ComponentInstanceEdge", "Edge"} + +func (ec *executionContext) _ComponentInstanceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentInstanceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentInstanceEdgeImplementors) + + 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("ComponentInstanceEdge") + case "node": + field := field + + 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 ec._ComponentInstanceEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstanceEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "cursor": + field := field + + 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 ec._ComponentInstanceEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentInstanceEdge_cursor(ctx, field, obj) + 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 componentVersionImplementors = []string{"ComponentVersion", "Node"} + +func (ec *executionContext) _ComponentVersion(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentVersion) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentVersionImplementors) + + 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("ComponentVersion") + case "id": + field := field + + 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 ec._ComponentVersion_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersion_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "version": + field := field + + 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 ec._ComponentVersion_version(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersion_version(ctx, field, obj) + case "componentId": + field := field + + 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 ec._ComponentVersion_componentId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersion_componentId(ctx, field, obj) + case "component": + field := field + + 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 ec._ComponentVersion_component(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersion_component(ctx, field, obj) + case "issues": + field := field + + 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 ec._ComponentVersion_issues(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersion_issues(ctx, field, obj) + case "componentInstances": + field := field + + 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 ec._ComponentVersion_componentInstances(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersion_componentInstances(ctx, field, obj) + 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 componentVersionConnectionImplementors = []string{"ComponentVersionConnection", "Connection"} + +func (ec *executionContext) _ComponentVersionConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentVersionConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentVersionConnectionImplementors) + + 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("ComponentVersionConnection") + case "totalCount": + field := field + + 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 ec._ComponentVersionConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersionConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "edges": + field := field + + 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 ec._ComponentVersionConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersionConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pageInfo": + field := field + + 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 ec._ComponentVersionConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersionConnection_pageInfo(ctx, field, obj) + 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 componentVersionEdgeImplementors = []string{"ComponentVersionEdge", "Edge"} + +func (ec *executionContext) _ComponentVersionEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentVersionEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, componentVersionEdgeImplementors) + + 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("ComponentVersionEdge") + case "node": + field := field + + 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 ec._ComponentVersionEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersionEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "cursor": + field := field + + 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 ec._ComponentVersionEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersionEdge_cursor(ctx, field, obj) + 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 evidenceImplementors = []string{"Evidence", "Node"} + +func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, obj *model.Evidence) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, evidenceImplementors) + + 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("Evidence") + case "id": + field := field + + 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 ec._Evidence_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Evidence_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + field := field + + 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 ec._Evidence_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Evidence_description(ctx, field, obj) + case "type": + field := field + + 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 ec._Evidence_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Evidence_type(ctx, field, obj) + case "vector": + field := field + + 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 ec._Evidence_vector(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Evidence_vector(ctx, field, obj) + case "raaEnd": + field := field + + 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 ec._Evidence_raaEnd(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._Evidence_raaEnd(ctx, field, obj) + case "authorId": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -25686,28 +32394,17 @@ func (ec *executionContext) _Activity(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Evidence_authorId(ctx, field, obj) }) // 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": + out.Values[i] = ec._Evidence_authorId(ctx, field, obj) + case "author": 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._Activity_issues(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -25719,28 +32416,17 @@ func (ec *executionContext) _Activity(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Evidence_author(ctx, field, obj) }) // 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 "evidences": + out.Values[i] = ec._Evidence_author(ctx, field, obj) + case "activityId": 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._Activity_evidences(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -25752,27 +32438,38 @@ func (ec *executionContext) _Activity(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Evidence_activityId(ctx, field, obj) }) // 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 "issueMatchChanges": + out.Values[i] = ec._Evidence_activityId(ctx, field, obj) + case "activity": 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._Activity_issueMatchChanges(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 ec._Evidence_activity(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._Evidence_activity(ctx, field, obj) + case "issueMatches": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -25785,15 +32482,14 @@ func (ec *executionContext) _Activity(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Evidence_issueMatches(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._Evidence_issueMatches(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25817,26 +32513,86 @@ func (ec *executionContext) _Activity(ctx context.Context, sel ast.SelectionSet, return out } -var activityConnectionImplementors = []string{"ActivityConnection", "Connection"} +var evidenceConnectionImplementors = []string{"EvidenceConnection", "Connection"} -func (ec *executionContext) _ActivityConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ActivityConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, activityConnectionImplementors) +func (ec *executionContext) _EvidenceConnection(ctx context.Context, sel ast.SelectionSet, obj *model.EvidenceConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, evidenceConnectionImplementors) 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("ActivityConnection") + out.Values[i] = graphql.MarshalString("EvidenceConnection") case "totalCount": - out.Values[i] = ec._ActivityConnection_totalCount(ctx, field, obj) + field := field + + 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 ec._EvidenceConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._EvidenceConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "edges": - out.Values[i] = ec._ActivityConnection_edges(ctx, field, obj) + field := field + + 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 ec._EvidenceConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._EvidenceConnection_edges(ctx, field, obj) case "pageInfo": - out.Values[i] = ec._ActivityConnection_pageInfo(ctx, field, obj) + field := field + + 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 ec._EvidenceConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._EvidenceConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25860,24 +32616,64 @@ func (ec *executionContext) _ActivityConnection(ctx context.Context, sel ast.Sel return out } -var activityEdgeImplementors = []string{"ActivityEdge", "Edge"} +var evidenceEdgeImplementors = []string{"EvidenceEdge", "Edge"} -func (ec *executionContext) _ActivityEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ActivityEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, activityEdgeImplementors) +func (ec *executionContext) _EvidenceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.EvidenceEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, evidenceEdgeImplementors) 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("ActivityEdge") + out.Values[i] = graphql.MarshalString("EvidenceEdge") case "node": - out.Values[i] = ec._ActivityEdge_node(ctx, field, obj) + field := field + + 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 ec._EvidenceEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._EvidenceEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "cursor": - out.Values[i] = ec._ActivityEdge_cursor(ctx, field, obj) + field := field + + 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 ec._EvidenceEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._EvidenceEdge_cursor(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25901,77 +32697,83 @@ func (ec *executionContext) _ActivityEdge(ctx context.Context, sel ast.Selection return out } -var cVSSImplementors = []string{"CVSS"} +var filterItemImplementors = []string{"FilterItem"} -func (ec *executionContext) _CVSS(ctx context.Context, sel ast.SelectionSet, obj *model.Cvss) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cVSSImplementors) +func (ec *executionContext) _FilterItem(ctx context.Context, sel ast.SelectionSet, obj *model.FilterItem) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, filterItemImplementors) 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("CVSS") - case "vector": - out.Values[i] = ec._CVSS_vector(ctx, field, obj) - case "base": - out.Values[i] = ec._CVSS_base(ctx, field, obj) - case "temporal": - out.Values[i] = ec._CVSS_temporal(ctx, field, obj) - case "environmental": - out.Values[i] = ec._CVSS_environmental(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } + out.Values[i] = graphql.MarshalString("FilterItem") + case "displayName": + field := field - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + 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 ec._FilterItem_displayName(ctx, field, obj) + }) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._FilterItem_displayName(ctx, field, obj) + case "filterName": + field := field - return out -} + 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 ec._FilterItem_filterName(ctx, field, obj) + }) -var cVSSBaseImplementors = []string{"CVSSBase"} + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._FilterItem_filterName(ctx, field, obj) + case "values": + field := field -func (ec *executionContext) _CVSSBase(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSBase) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cVSSBaseImplementors) + 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 ec._FilterItem_values(ctx, field, obj) + }) - 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("CVSSBase") - case "score": - out.Values[i] = ec._CVSSBase_score(ctx, field, obj) - case "attackVector": - out.Values[i] = ec._CVSSBase_attackVector(ctx, field, obj) - case "attackComplexity": - out.Values[i] = ec._CVSSBase_attackComplexity(ctx, field, obj) - case "privilegesRequired": - out.Values[i] = ec._CVSSBase_privilegesRequired(ctx, field, obj) - case "userInteraction": - out.Values[i] = ec._CVSSBase_userInteraction(ctx, field, obj) - case "scope": - out.Values[i] = ec._CVSSBase_scope(ctx, field, obj) - case "confidentialityImpact": - out.Values[i] = ec._CVSSBase_confidentialityImpact(ctx, field, obj) - case "integrityImpact": - out.Values[i] = ec._CVSSBase_integrityImpact(ctx, field, obj) - case "availabilityImpact": - out.Values[i] = ec._CVSSBase_availabilityImpact(ctx, field, obj) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._FilterItem_values(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -25995,79 +32797,240 @@ func (ec *executionContext) _CVSSBase(ctx context.Context, sel ast.SelectionSet, return out } -var cVSSEnvironmentalImplementors = []string{"CVSSEnvironmental"} +var issueImplementors = []string{"Issue", "Node"} -func (ec *executionContext) _CVSSEnvironmental(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSEnvironmental) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cVSSEnvironmentalImplementors) +func (ec *executionContext) _Issue(ctx context.Context, sel ast.SelectionSet, obj *model.Issue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueImplementors) 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("CVSSEnvironmental") - case "score": - out.Values[i] = ec._CVSSEnvironmental_score(ctx, field, obj) - case "modifiedAttackVector": - out.Values[i] = ec._CVSSEnvironmental_modifiedAttackVector(ctx, field, obj) - case "modifiedAttackComplexity": - out.Values[i] = ec._CVSSEnvironmental_modifiedAttackComplexity(ctx, field, obj) - case "modifiedPrivilegesRequired": - out.Values[i] = ec._CVSSEnvironmental_modifiedPrivilegesRequired(ctx, field, obj) - case "modifiedUserInteraction": - out.Values[i] = ec._CVSSEnvironmental_modifiedUserInteraction(ctx, field, obj) - case "modifiedScope": - out.Values[i] = ec._CVSSEnvironmental_modifiedScope(ctx, field, obj) - case "modifiedConfidentialityImpact": - out.Values[i] = ec._CVSSEnvironmental_modifiedConfidentialityImpact(ctx, field, obj) - case "modifiedIntegrityImpact": - out.Values[i] = ec._CVSSEnvironmental_modifiedIntegrityImpact(ctx, field, obj) - case "modifiedAvailabilityImpact": - out.Values[i] = ec._CVSSEnvironmental_modifiedAvailabilityImpact(ctx, field, obj) - case "confidentialityRequirement": - out.Values[i] = ec._CVSSEnvironmental_confidentialityRequirement(ctx, field, obj) - case "availabilityRequirement": - out.Values[i] = ec._CVSSEnvironmental_availabilityRequirement(ctx, field, obj) - case "integrityRequirement": - out.Values[i] = ec._CVSSEnvironmental_integrityRequirement(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } + out.Values[i] = graphql.MarshalString("Issue") + case "id": + field := field - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + 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 ec._Issue_id(ctx, field, obj) + }) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "type": + field := field - return out -} + 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 ec._Issue_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_type(ctx, field, obj) + case "primaryName": + field := field + + 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 ec._Issue_primaryName(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_primaryName(ctx, field, obj) + case "description": + field := field + + 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 ec._Issue_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_description(ctx, field, obj) + case "lastModified": + field := field + + 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 ec._Issue_lastModified(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_lastModified(ctx, field, obj) + case "issueVariants": + field := field + + 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 ec._Issue_issueVariants(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_issueVariants(ctx, field, obj) + case "activities": + field := field + + 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 ec._Issue_activities(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_activities(ctx, field, obj) + case "issueMatches": + field := field + + 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 ec._Issue_issueMatches(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_issueMatches(ctx, field, obj) + case "componentVersions": + field := field + + 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 ec._Issue_componentVersions(ctx, field, obj) + }) -var cVSSParameterImplementors = []string{"CVSSParameter"} + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_componentVersions(ctx, field, obj) + case "metadata": + field := field -func (ec *executionContext) _CVSSParameter(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSParameter) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cVSSParameterImplementors) + 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 ec._Issue_metadata(ctx, field, obj) + }) - 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("CVSSParameter") - case "name": - out.Values[i] = ec._CVSSParameter_name(ctx, field, obj) - case "value": - out.Values[i] = ec._CVSSParameter_value(ctx, field, obj) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26091,80 +33054,119 @@ func (ec *executionContext) _CVSSParameter(ctx context.Context, sel ast.Selectio return out } -var cVSSTemporalImplementors = []string{"CVSSTemporal"} +var issueConnectionImplementors = []string{"IssueConnection", "Connection"} -func (ec *executionContext) _CVSSTemporal(ctx context.Context, sel ast.SelectionSet, obj *model.CVSSTemporal) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cVSSTemporalImplementors) +func (ec *executionContext) _IssueConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueConnectionImplementors) 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("CVSSTemporal") - case "score": - out.Values[i] = ec._CVSSTemporal_score(ctx, field, obj) - case "exploitCodeMaturity": - out.Values[i] = ec._CVSSTemporal_exploitCodeMaturity(ctx, field, obj) - case "remediationLevel": - out.Values[i] = ec._CVSSTemporal_remediationLevel(ctx, field, obj) - case "reportConfidence": - out.Values[i] = ec._CVSSTemporal_reportConfidence(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } + out.Values[i] = graphql.MarshalString("IssueConnection") + case "totalCount": + field := field - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + 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 ec._IssueConnection_totalCount(ctx, field, obj) + }) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "vulnerabilityCount": + field := field - return out -} + 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 ec._IssueConnection_vulnerabilityCount(ctx, field, obj) + }) -var componentImplementors = []string{"Component", "Node"} + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueConnection_vulnerabilityCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "policyViolationCount": + field := field -func (ec *executionContext) _Component(ctx context.Context, sel ast.SelectionSet, obj *model.Component) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentImplementors) + 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 ec._IssueConnection_policyViolationCount(ctx, field, obj) + }) - 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("Component") - case "id": - out.Values[i] = ec._Component_id(ctx, field, obj) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueConnection_policyViolationCount(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } - case "name": - out.Values[i] = ec._Component_name(ctx, field, obj) - case "type": - out.Values[i] = ec._Component_type(ctx, field, obj) - case "componentVersions": + case "securityEventCount": 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._Component_componentVersions(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 ec._IssueConnection_securityEventCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueConnection_securityEventCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "edges": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -26177,15 +33179,39 @@ func (ec *executionContext) _Component(ctx context.Context, sel ast.SelectionSet deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueConnection_edges(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } + out.Values[i] = ec._IssueConnection_edges(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pageInfo": + field := field + + 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 ec._IssueConnection_pageInfo(ctx, field, obj) + }) - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26209,26 +33235,64 @@ func (ec *executionContext) _Component(ctx context.Context, sel ast.SelectionSet return out } -var componentConnectionImplementors = []string{"ComponentConnection", "Connection"} +var issueEdgeImplementors = []string{"IssueEdge", "Edge"} -func (ec *executionContext) _ComponentConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentConnectionImplementors) +func (ec *executionContext) _IssueEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueEdgeImplementors) 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("ComponentConnection") - case "totalCount": - out.Values[i] = ec._ComponentConnection_totalCount(ctx, field, obj) + out.Values[i] = graphql.MarshalString("IssueEdge") + case "node": + field := field + + 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 ec._IssueEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "edges": - out.Values[i] = ec._ComponentConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._ComponentConnection_pageInfo(ctx, field, obj) + case "cursor": + field := field + + 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 ec._IssueEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueEdge_cursor(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26252,81 +33316,245 @@ func (ec *executionContext) _ComponentConnection(ctx context.Context, sel ast.Se return out } -var componentEdgeImplementors = []string{"ComponentEdge", "Edge"} +var issueMatchImplementors = []string{"IssueMatch", "Node"} -func (ec *executionContext) _ComponentEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentEdgeImplementors) +func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatch) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchImplementors) 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("ComponentEdge") - case "node": - out.Values[i] = ec._ComponentEdge_node(ctx, field, obj) + out.Values[i] = graphql.MarshalString("IssueMatch") + case "id": + field := field + + 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 ec._IssueMatch_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_id(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "cursor": - out.Values[i] = ec._ComponentEdge_cursor(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } + case "status": + field := field - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + 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 ec._IssueMatch_status(ctx, field, obj) + }) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_status(ctx, field, obj) + case "remediationDate": + field := field - return out -} + 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 ec._IssueMatch_remediationDate(ctx, field, obj) + }) -var componentInstanceImplementors = []string{"ComponentInstance", "Node"} + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_remediationDate(ctx, field, obj) + case "discoveryDate": + field := field -func (ec *executionContext) _ComponentInstance(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentInstance) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentInstanceImplementors) + 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 ec._IssueMatch_discoveryDate(ctx, field, obj) + }) - 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("ComponentInstance") - case "id": - out.Values[i] = ec._ComponentInstance_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "ccrn": - out.Values[i] = ec._ComponentInstance_ccrn(ctx, field, obj) - case "count": - out.Values[i] = ec._ComponentInstance_count(ctx, field, obj) - case "componentVersionId": - out.Values[i] = ec._ComponentInstance_componentVersionId(ctx, field, obj) - case "componentVersion": + out.Values[i] = ec._IssueMatch_discoveryDate(ctx, field, obj) + case "targetRemediationDate": + field := field + + 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 ec._IssueMatch_targetRemediationDate(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_targetRemediationDate(ctx, field, obj) + case "severity": + field := field + + 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 ec._IssueMatch_severity(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_severity(ctx, field, obj) + case "effectiveIssueVariants": + field := field + + 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 ec._IssueMatch_effectiveIssueVariants(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_effectiveIssueVariants(ctx, field, obj) + case "evidences": + field := field + + 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 ec._IssueMatch_evidences(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_evidences(ctx, field, obj) + case "issueId": + field := field + + 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 ec._IssueMatch_issueId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_issueId(ctx, field, obj) + case "issue": 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._ComponentInstance_componentVersion(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 ec._IssueMatch_issue(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_issue(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "userId": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -26339,28 +33567,17 @@ func (ec *executionContext) _ComponentInstance(ctx context.Context, sel ast.Sele deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatch_userId(ctx, field, obj) }) // 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 "issueMatches": + out.Values[i] = ec._IssueMatch_userId(ctx, field, obj) + case "user": 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._ComponentInstance_issueMatches(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -26372,30 +33589,17 @@ func (ec *executionContext) _ComponentInstance(ctx context.Context, sel ast.Sele deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatch_user(ctx, field, obj) }) // 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 "serviceId": - out.Values[i] = ec._ComponentInstance_serviceId(ctx, field, obj) - case "service": + out.Values[i] = ec._IssueMatch_user(ctx, field, obj) + case "componentInstanceId": 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._ComponentInstance_service(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -26407,106 +33611,61 @@ func (ec *executionContext) _ComponentInstance(ctx context.Context, sel ast.Sele deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatch_componentInstanceId(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } + out.Values[i] = ec._IssueMatch_componentInstanceId(ctx, field, obj) + case "componentInstance": + field := field - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "createdAt": - out.Values[i] = ec._ComponentInstance_createdAt(ctx, field, obj) - case "updatedAt": - out.Values[i] = ec._ComponentInstance_updatedAt(ctx, field, obj) - 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 componentInstanceConnectionImplementors = []string{"ComponentInstanceConnection", "Connection"} - -func (ec *executionContext) _ComponentInstanceConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentInstanceConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentInstanceConnectionImplementors) + 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 ec._IssueMatch_componentInstance(ctx, field, obj) + }) - 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("ComponentInstanceConnection") - case "totalCount": - out.Values[i] = ec._ComponentInstanceConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "edges": - out.Values[i] = ec._ComponentInstanceConnection_edges(ctx, field, obj) + out.Values[i] = ec._IssueMatch_componentInstance(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "pageInfo": - out.Values[i] = ec._ComponentInstanceConnection_pageInfo(ctx, field, obj) - 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 componentInstanceEdgeImplementors = []string{"ComponentInstanceEdge", "Edge"} + case "issueMatchChanges": + field := field -func (ec *executionContext) _ComponentInstanceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentInstanceEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentInstanceEdgeImplementors) + 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 ec._IssueMatch_issueMatchChanges(ctx, field, obj) + }) - 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("ComponentInstanceEdge") - case "node": - out.Values[i] = ec._ComponentInstanceEdge_node(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "cursor": - out.Values[i] = ec._ComponentInstanceEdge_cursor(ctx, field, obj) + out.Values[i] = ec._IssueMatch_issueMatchChanges(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26530,38 +33689,44 @@ func (ec *executionContext) _ComponentInstanceEdge(ctx context.Context, sel ast. return out } -var componentVersionImplementors = []string{"ComponentVersion", "Node"} +var issueMatchChangeImplementors = []string{"IssueMatchChange", "Node"} -func (ec *executionContext) _ComponentVersion(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentVersion) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentVersionImplementors) +func (ec *executionContext) _IssueMatchChange(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchChange) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchChangeImplementors) 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("ComponentVersion") + out.Values[i] = graphql.MarshalString("IssueMatchChange") case "id": - out.Values[i] = ec._ComponentVersion_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "version": - out.Values[i] = ec._ComponentVersion_version(ctx, field, obj) - case "componentId": - out.Values[i] = ec._ComponentVersion_componentId(ctx, field, obj) - case "component": 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._ComponentVersion_component(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 ec._IssueMatchChange_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchChange_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "action": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -26574,27 +33739,38 @@ func (ec *executionContext) _ComponentVersion(ctx context.Context, sel ast.Selec deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchChange_action(ctx, field, obj) }) // 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": + out.Values[i] = ec._IssueMatchChange_action(ctx, field, obj) + case "issueMatchId": 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._ComponentVersion_issues(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 ec._IssueMatchChange_issueMatchId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueMatchChange_issueMatchId(ctx, field, obj) + case "issueMatch": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -26607,27 +33783,41 @@ func (ec *executionContext) _ComponentVersion(ctx context.Context, sel ast.Selec deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchChange_issueMatch(ctx, field, obj) }) // 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 "componentInstances": + out.Values[i] = ec._IssueMatchChange_issueMatch(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "activityId": 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._ComponentVersion_componentInstances(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 ec._IssueMatchChange_activityId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueMatchChange_activityId(ctx, field, obj) + case "activity": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -26640,15 +33830,17 @@ func (ec *executionContext) _ComponentVersion(ctx context.Context, sel ast.Selec deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchChange_activity(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._IssueMatchChange_activity(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26672,29 +33864,86 @@ func (ec *executionContext) _ComponentVersion(ctx context.Context, sel ast.Selec return out } -var componentVersionConnectionImplementors = []string{"ComponentVersionConnection", "Connection"} +var issueMatchChangeConnectionImplementors = []string{"IssueMatchChangeConnection", "Connection"} -func (ec *executionContext) _ComponentVersionConnection(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentVersionConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentVersionConnectionImplementors) +func (ec *executionContext) _IssueMatchChangeConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchChangeConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchChangeConnectionImplementors) 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("ComponentVersionConnection") + out.Values[i] = graphql.MarshalString("IssueMatchChangeConnection") case "totalCount": - out.Values[i] = ec._ComponentVersionConnection_totalCount(ctx, field, obj) + field := field + + 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 ec._IssueMatchChangeConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchChangeConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "edges": - out.Values[i] = ec._ComponentVersionConnection_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + field := field + + 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 ec._IssueMatchChangeConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueMatchChangeConnection_edges(ctx, field, obj) case "pageInfo": - out.Values[i] = ec._ComponentVersionConnection_pageInfo(ctx, field, obj) + field := field + + 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 ec._IssueMatchChangeConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchChangeConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26718,24 +33967,64 @@ func (ec *executionContext) _ComponentVersionConnection(ctx context.Context, sel return out } -var componentVersionEdgeImplementors = []string{"ComponentVersionEdge", "Edge"} +var issueMatchChangeEdgeImplementors = []string{"IssueMatchChangeEdge", "Edge"} -func (ec *executionContext) _ComponentVersionEdge(ctx context.Context, sel ast.SelectionSet, obj *model.ComponentVersionEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, componentVersionEdgeImplementors) +func (ec *executionContext) _IssueMatchChangeEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchChangeEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchChangeEdgeImplementors) 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("ComponentVersionEdge") + out.Values[i] = graphql.MarshalString("IssueMatchChangeEdge") case "node": - out.Values[i] = ec._ComponentVersionEdge_node(ctx, field, obj) + field := field + + 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 ec._IssueMatchChangeEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchChangeEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "cursor": - out.Values[i] = ec._ComponentVersionEdge_cursor(ctx, field, obj) + field := field + + 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 ec._IssueMatchChangeEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchChangeEdge_cursor(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26759,45 +34048,20 @@ func (ec *executionContext) _ComponentVersionEdge(ctx context.Context, sel ast.S return out } -var evidenceImplementors = []string{"Evidence", "Node"} +var issueMatchConnectionImplementors = []string{"IssueMatchConnection", "Connection"} -func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, obj *model.Evidence) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, evidenceImplementors) +func (ec *executionContext) _IssueMatchConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchConnectionImplementors) 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("Evidence") - case "id": - out.Values[i] = ec._Evidence_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "description": - out.Values[i] = ec._Evidence_description(ctx, field, obj) - case "type": - out.Values[i] = ec._Evidence_type(ctx, field, obj) - case "vector": - out.Values[i] = ec._Evidence_vector(ctx, field, obj) - case "raaEnd": - out.Values[i] = ec._Evidence_raaEnd(ctx, field, obj) - case "authorId": - out.Values[i] = ec._Evidence_authorId(ctx, field, obj) - case "author": + out.Values[i] = graphql.MarshalString("IssueMatchConnection") + case "totalCount": 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._Evidence_author(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -26809,29 +34073,19 @@ func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchConnection_totalCount(ctx, field, obj) }) // 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 "activityId": - out.Values[i] = ec._Evidence_activityId(ctx, field, obj) - case "activity": - 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._Evidence_activity(ctx, field, obj) - return res + out.Values[i] = ec._IssueMatchConnection_totalCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "edges": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -26844,28 +34098,17 @@ func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchConnection_edges(ctx, field, obj) }) // 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 "issueMatches": + out.Values[i] = ec._IssueMatchConnection_edges(ctx, field, obj) + case "pageInfo": 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._Evidence_issueMatches(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -26877,15 +34120,14 @@ func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchConnection_pageInfo(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._IssueMatchConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -26909,107 +34151,64 @@ func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, return out } -var evidenceConnectionImplementors = []string{"EvidenceConnection", "Connection"} +var issueMatchEdgeImplementors = []string{"IssueMatchEdge", "Edge"} -func (ec *executionContext) _EvidenceConnection(ctx context.Context, sel ast.SelectionSet, obj *model.EvidenceConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, evidenceConnectionImplementors) +func (ec *executionContext) _IssueMatchEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchEdgeImplementors) 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("EvidenceConnection") - case "totalCount": - out.Values[i] = ec._EvidenceConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "edges": - out.Values[i] = ec._EvidenceConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._EvidenceConnection_pageInfo(ctx, field, obj) - 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 evidenceEdgeImplementors = []string{"EvidenceEdge", "Edge"} + out.Values[i] = graphql.MarshalString("IssueMatchEdge") + case "node": + field := field -func (ec *executionContext) _EvidenceEdge(ctx context.Context, sel ast.SelectionSet, obj *model.EvidenceEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, evidenceEdgeImplementors) + 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 ec._IssueMatchEdge_node(ctx, field, obj) + }) - 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("EvidenceEdge") - case "node": - out.Values[i] = ec._EvidenceEdge_node(ctx, field, obj) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "cursor": - out.Values[i] = ec._EvidenceEdge_cursor(ctx, field, obj) - 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 filterItemImplementors = []string{"FilterItem"} + field := field -func (ec *executionContext) _FilterItem(ctx context.Context, sel ast.SelectionSet, obj *model.FilterItem) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, filterItemImplementors) + 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 ec._IssueMatchEdge_cursor(ctx, field, obj) + }) - 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("FilterItem") - case "displayName": - out.Values[i] = ec._FilterItem_displayName(ctx, field, obj) - case "filterName": - out.Values[i] = ec._FilterItem_filterName(ctx, field, obj) - case "values": - out.Values[i] = ec._FilterItem_values(ctx, field, obj) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchEdge_cursor(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27033,43 +34232,20 @@ func (ec *executionContext) _FilterItem(ctx context.Context, sel ast.SelectionSe return out } -var issueImplementors = []string{"Issue", "Node"} +var issueMatchFilterValueImplementors = []string{"IssueMatchFilterValue"} -func (ec *executionContext) _Issue(ctx context.Context, sel ast.SelectionSet, obj *model.Issue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueImplementors) +func (ec *executionContext) _IssueMatchFilterValue(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchFilterValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchFilterValueImplementors) 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("Issue") - case "id": - out.Values[i] = ec._Issue_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "type": - out.Values[i] = ec._Issue_type(ctx, field, obj) - case "primaryName": - out.Values[i] = ec._Issue_primaryName(ctx, field, obj) - case "description": - out.Values[i] = ec._Issue_description(ctx, field, obj) - case "lastModified": - out.Values[i] = ec._Issue_lastModified(ctx, field, obj) - case "issueVariants": + out.Values[i] = graphql.MarshalString("IssueMatchFilterValue") + case "status": 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._Issue_issueVariants(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -27081,28 +34257,17 @@ func (ec *executionContext) _Issue(ctx context.Context, sel ast.SelectionSet, ob deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchFilterValue_status(ctx, field, obj) }) // 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 "activities": + out.Values[i] = ec._IssueMatchFilterValue_status(ctx, field, obj) + case "severity": 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._Issue_activities(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -27114,28 +34279,17 @@ func (ec *executionContext) _Issue(ctx context.Context, sel ast.SelectionSet, ob deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchFilterValue_severity(ctx, field, obj) }) // 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 "issueMatches": + out.Values[i] = ec._IssueMatchFilterValue_severity(ctx, field, obj) + case "issueType": 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._Issue_issueMatches(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -27147,28 +34301,17 @@ func (ec *executionContext) _Issue(ctx context.Context, sel ast.SelectionSet, ob deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchFilterValue_issueType(ctx, field, obj) }) // 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 "componentVersions": + out.Values[i] = ec._IssueMatchFilterValue_issueType(ctx, field, obj) + case "primaryName": 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._Issue_componentVersions(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -27180,119 +34323,80 @@ func (ec *executionContext) _Issue(ctx context.Context, sel ast.SelectionSet, ob deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMatchFilterValue_primaryName(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } + out.Values[i] = ec._IssueMatchFilterValue_primaryName(ctx, field, obj) + case "affectedService": + field := field - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "metadata": - out.Values[i] = ec._Issue_metadata(ctx, field, obj) - 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 issueConnectionImplementors = []string{"IssueConnection", "Connection"} - -func (ec *executionContext) _IssueConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueConnectionImplementors) + 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 ec._IssueMatchFilterValue_affectedService(ctx, field, obj) + }) - 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("IssueConnection") - case "totalCount": - out.Values[i] = ec._IssueConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "vulnerabilityCount": - out.Values[i] = ec._IssueConnection_vulnerabilityCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "policyViolationCount": - out.Values[i] = ec._IssueConnection_policyViolationCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "securityEventCount": - out.Values[i] = ec._IssueConnection_securityEventCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "edges": - out.Values[i] = ec._IssueConnection_edges(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "pageInfo": - out.Values[i] = ec._IssueConnection_pageInfo(ctx, field, obj) - 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, - }) - } + out.Values[i] = ec._IssueMatchFilterValue_affectedService(ctx, field, obj) + case "componentName": + field := field - return out -} + 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 ec._IssueMatchFilterValue_componentName(ctx, field, obj) + }) -var issueEdgeImplementors = []string{"IssueEdge", "Edge"} + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchFilterValue_componentName(ctx, field, obj) + case "supportGroupName": + field := field -func (ec *executionContext) _IssueEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueEdgeImplementors) + 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 ec._IssueMatchFilterValue_supportGroupName(ctx, field, obj) + }) - 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("IssueEdge") - case "node": - out.Values[i] = ec._IssueEdge_node(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "cursor": - out.Values[i] = ec._IssueEdge_cursor(ctx, field, obj) + out.Values[i] = ec._IssueMatchFilterValue_supportGroupName(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27316,43 +34420,20 @@ func (ec *executionContext) _IssueEdge(ctx context.Context, sel ast.SelectionSet return out } -var issueMatchImplementors = []string{"IssueMatch", "Node"} +var issueMetadataImplementors = []string{"IssueMetadata"} -func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatch) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchImplementors) +func (ec *executionContext) _IssueMetadata(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMetadata) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueMetadataImplementors) 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("IssueMatch") - case "id": - out.Values[i] = ec._IssueMatch_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "status": - out.Values[i] = ec._IssueMatch_status(ctx, field, obj) - case "remediationDate": - out.Values[i] = ec._IssueMatch_remediationDate(ctx, field, obj) - case "discoveryDate": - out.Values[i] = ec._IssueMatch_discoveryDate(ctx, field, obj) - case "targetRemediationDate": - out.Values[i] = ec._IssueMatch_targetRemediationDate(ctx, field, obj) - case "severity": + out.Values[i] = graphql.MarshalString("IssueMetadata") + case "serviceCount": 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._IssueMatch_severity(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -27364,27 +34445,19 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMetadata_serviceCount(ctx, field, obj) }) // 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 "effectiveIssueVariants": - 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._IssueMatch_effectiveIssueVariants(ctx, field, obj) - return res + out.Values[i] = ec._IssueMetadata_serviceCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "activityCount": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27397,27 +34470,19 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMetadata_activityCount(ctx, field, obj) }) // 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 "evidences": - 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._IssueMatch_evidences(ctx, field, obj) - return res + out.Values[i] = ec._IssueMetadata_activityCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "issueMatchCount": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27430,32 +34495,19 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMetadata_issueMatchCount(ctx, field, obj) }) // 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 "issueId": - out.Values[i] = ec._IssueMatch_issueId(ctx, field, obj) - case "issue": - 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._IssueMatch_issue(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res + out.Values[i] = ec._IssueMetadata_issueMatchCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "componentInstanceCount": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27468,36 +34520,44 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMetadata_componentInstanceCount(ctx, field, obj) }) // 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 "userId": - out.Values[i] = ec._IssueMatch_userId(ctx, field, obj) - case "user": - out.Values[i] = ec._IssueMatch_user(ctx, field, obj) - case "componentInstanceId": - out.Values[i] = ec._IssueMatch_componentInstanceId(ctx, field, obj) - case "componentInstance": + out.Values[i] = ec._IssueMetadata_componentInstanceCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "componentVersionCount": 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._IssueMatch_componentInstance(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) + 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 } - return res + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._IssueMetadata_componentVersionCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMetadata_componentVersionCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "earliestDiscoveryDate": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27510,27 +34570,19 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMetadata_earliestDiscoveryDate(ctx, field, obj) }) // 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 "issueMatchChanges": - 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._IssueMatch_issueMatchChanges(ctx, field, obj) - return res + out.Values[i] = ec._IssueMetadata_earliestDiscoveryDate(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "earliestTargetRemediationDate": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27543,15 +34595,17 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueMetadata_earliestTargetRemediationDate(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._IssueMetadata_earliestTargetRemediationDate(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27575,41 +34629,44 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe return out } -var issueMatchChangeImplementors = []string{"IssueMatchChange", "Node"} +var issueRepositoryImplementors = []string{"IssueRepository", "Node"} -func (ec *executionContext) _IssueMatchChange(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchChange) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchChangeImplementors) +func (ec *executionContext) _IssueRepository(ctx context.Context, sel ast.SelectionSet, obj *model.IssueRepository) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueRepositoryImplementors) 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("IssueMatchChange") + out.Values[i] = graphql.MarshalString("IssueRepository") case "id": - out.Values[i] = ec._IssueMatchChange_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "action": - out.Values[i] = ec._IssueMatchChange_action(ctx, field, obj) - case "issueMatchId": - out.Values[i] = ec._IssueMatchChange_issueMatchId(ctx, field, obj) - case "issueMatch": 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._IssueMatchChange_issueMatch(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) + 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 } - return res + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._IssueRepository_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueRepository_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27622,32 +34679,38 @@ func (ec *executionContext) _IssueMatchChange(ctx context.Context, sel ast.Selec deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueRepository_name(ctx, field, obj) }) // 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 "activityId": - out.Values[i] = ec._IssueMatchChange_activityId(ctx, field, obj) - case "activity": + out.Values[i] = ec._IssueRepository_name(ctx, field, obj) + case "url": 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._IssueMatchChange_activity(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) + 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 } - return res + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._IssueRepository_url(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueRepository_url(ctx, field, obj) + case "issueVariants": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27660,142 +34723,80 @@ func (ec *executionContext) _IssueMatchChange(ctx context.Context, sel ast.Selec deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueRepository_issueVariants(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } + out.Values[i] = ec._IssueRepository_issueVariants(ctx, field, obj) + case "services": + field := field - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - 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 issueMatchChangeConnectionImplementors = []string{"IssueMatchChangeConnection", "Connection"} - -func (ec *executionContext) _IssueMatchChangeConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchChangeConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchChangeConnectionImplementors) + 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 ec._IssueRepository_services(ctx, field, obj) + }) - 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("IssueMatchChangeConnection") - case "totalCount": - out.Values[i] = ec._IssueMatchChangeConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "edges": - out.Values[i] = ec._IssueMatchChangeConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._IssueMatchChangeConnection_pageInfo(ctx, field, obj) - 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 issueMatchChangeEdgeImplementors = []string{"IssueMatchChangeEdge", "Edge"} + out.Values[i] = ec._IssueRepository_services(ctx, field, obj) + case "created_at": + field := field -func (ec *executionContext) _IssueMatchChangeEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchChangeEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchChangeEdgeImplementors) + 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 ec._IssueRepository_created_at(ctx, field, obj) + }) - 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("IssueMatchChangeEdge") - case "node": - out.Values[i] = ec._IssueMatchChangeEdge_node(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "cursor": - out.Values[i] = ec._IssueMatchChangeEdge_cursor(ctx, field, obj) - 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 issueMatchConnectionImplementors = []string{"IssueMatchConnection", "Connection"} + out.Values[i] = ec._IssueRepository_created_at(ctx, field, obj) + case "updated_at": + field := field -func (ec *executionContext) _IssueMatchConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchConnectionImplementors) + 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 ec._IssueRepository_updated_at(ctx, field, obj) + }) - 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("IssueMatchConnection") - case "totalCount": - out.Values[i] = ec._IssueMatchConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "edges": - out.Values[i] = ec._IssueMatchConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._IssueMatchConnection_pageInfo(ctx, field, obj) + out.Values[i] = ec._IssueRepository_updated_at(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27819,24 +34820,86 @@ func (ec *executionContext) _IssueMatchConnection(ctx context.Context, sel ast.S return out } -var issueMatchEdgeImplementors = []string{"IssueMatchEdge", "Edge"} +var issueRepositoryConnectionImplementors = []string{"IssueRepositoryConnection", "Connection"} -func (ec *executionContext) _IssueMatchEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchEdgeImplementors) +func (ec *executionContext) _IssueRepositoryConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueRepositoryConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueRepositoryConnectionImplementors) 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("IssueMatchEdge") - case "node": - out.Values[i] = ec._IssueMatchEdge_node(ctx, field, obj) + out.Values[i] = graphql.MarshalString("IssueRepositoryConnection") + case "totalCount": + field := field + + 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 ec._IssueRepositoryConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueRepositoryConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "cursor": - out.Values[i] = ec._IssueMatchEdge_cursor(ctx, field, obj) + case "edges": + field := field + + 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 ec._IssueRepositoryConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueRepositoryConnection_edges(ctx, field, obj) + case "pageInfo": + field := field + + 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 ec._IssueRepositoryConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueRepositoryConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -27860,36 +34923,20 @@ func (ec *executionContext) _IssueMatchEdge(ctx context.Context, sel ast.Selecti return out } -var issueMatchFilterValueImplementors = []string{"IssueMatchFilterValue"} +var issueRepositoryEdgeImplementors = []string{"IssueRepositoryEdge", "Edge"} -func (ec *executionContext) _IssueMatchFilterValue(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMatchFilterValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMatchFilterValueImplementors) +func (ec *executionContext) _IssueRepositoryEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueRepositoryEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueRepositoryEdgeImplementors) 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("IssueMatchFilterValue") - case "status": - out.Values[i] = ec._IssueMatchFilterValue_status(ctx, field, obj) - case "severity": - out.Values[i] = ec._IssueMatchFilterValue_severity(ctx, field, obj) - case "issueType": - out.Values[i] = ec._IssueMatchFilterValue_issueType(ctx, field, obj) - case "primaryName": + out.Values[i] = graphql.MarshalString("IssueRepositoryEdge") + case "node": 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._IssueMatchFilterValue_primaryName(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -27901,27 +34948,19 @@ func (ec *executionContext) _IssueMatchFilterValue(ctx context.Context, sel ast. deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueRepositoryEdge_node(ctx, field, obj) }) // 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 "affectedService": - 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._IssueMatchFilterValue_affectedService(ctx, field, obj) - return res + out.Values[i] = ec._IssueRepositoryEdge_node(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ } + case "cursor": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -27934,28 +34973,17 @@ func (ec *executionContext) _IssueMatchFilterValue(ctx context.Context, sel ast. deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueRepositoryEdge_cursor(ctx, field, obj) }) // 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 "componentName": + out.Values[i] = ec._IssueRepositoryEdge_cursor(ctx, field, obj) + case "priority": 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._IssueMatchFilterValue_componentName(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -27967,27 +34995,38 @@ func (ec *executionContext) _IssueMatchFilterValue(ctx context.Context, sel ast. deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueRepositoryEdge_priority(ctx, field, obj) }) // 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 "supportGroupName": + out.Values[i] = ec._IssueRepositoryEdge_priority(ctx, field, obj) + case "created_at": 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._IssueMatchFilterValue_supportGroupName(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 ec._IssueRepositoryEdge_created_at(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueRepositoryEdge_created_at(ctx, field, obj) + case "updated_at": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -28000,15 +35039,14 @@ func (ec *executionContext) _IssueMatchFilterValue(ctx context.Context, sel ast. deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueRepositoryEdge_updated_at(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._IssueRepositoryEdge_updated_at(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -28032,107 +35070,132 @@ func (ec *executionContext) _IssueMatchFilterValue(ctx context.Context, sel ast. return out } -var issueMetadataImplementors = []string{"IssueMetadata"} +var issueVariantImplementors = []string{"IssueVariant", "Node"} -func (ec *executionContext) _IssueMetadata(ctx context.Context, sel ast.SelectionSet, obj *model.IssueMetadata) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueMetadataImplementors) +func (ec *executionContext) _IssueVariant(ctx context.Context, sel ast.SelectionSet, obj *model.IssueVariant) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueVariantImplementors) 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("IssueMetadata") - case "serviceCount": - out.Values[i] = ec._IssueMetadata_serviceCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "activityCount": - out.Values[i] = ec._IssueMetadata_activityCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "issueMatchCount": - out.Values[i] = ec._IssueMetadata_issueMatchCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "componentInstanceCount": - out.Values[i] = ec._IssueMetadata_componentInstanceCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "componentVersionCount": - out.Values[i] = ec._IssueMetadata_componentVersionCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "earliestDiscoveryDate": - out.Values[i] = ec._IssueMetadata_earliestDiscoveryDate(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + out.Values[i] = graphql.MarshalString("IssueVariant") + case "id": + field := field + + 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 ec._IssueVariant_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "earliestTargetRemediationDate": - out.Values[i] = ec._IssueMetadata_earliestTargetRemediationDate(ctx, field, obj) + out.Values[i] = ec._IssueVariant_id(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 - } + case "secondaryName": + field := field - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + 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 ec._IssueVariant_secondaryName(ctx, field, obj) + }) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariant_secondaryName(ctx, field, obj) + case "description": + field := field - return out -} + 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 ec._IssueVariant_description(ctx, field, obj) + }) -var issueRepositoryImplementors = []string{"IssueRepository", "Node"} + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariant_description(ctx, field, obj) + case "severity": + field := field -func (ec *executionContext) _IssueRepository(ctx context.Context, sel ast.SelectionSet, obj *model.IssueRepository) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueRepositoryImplementors) + 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 ec._IssueVariant_severity(ctx, field, obj) + }) - 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("IssueRepository") - case "id": - out.Values[i] = ec._IssueRepository_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "name": - out.Values[i] = ec._IssueRepository_name(ctx, field, obj) - case "url": - out.Values[i] = ec._IssueRepository_url(ctx, field, obj) - case "issueVariants": + out.Values[i] = ec._IssueVariant_severity(ctx, field, obj) + case "issueRepositoryId": 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._IssueRepository_issueVariants(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 ec._IssueVariant_issueRepositoryId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueVariant_issueRepositoryId(ctx, field, obj) + case "issueRepository": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -28145,27 +35208,38 @@ func (ec *executionContext) _IssueRepository(ctx context.Context, sel ast.Select deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueVariant_issueRepository(ctx, field, obj) }) // 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 "services": + out.Values[i] = ec._IssueVariant_issueRepository(ctx, field, obj) + case "issueId": 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._IssueRepository_services(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 ec._IssueVariant_issueId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueVariant_issueId(ctx, field, obj) + case "issue": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -28178,19 +35252,58 @@ func (ec *executionContext) _IssueRepository(ctx context.Context, sel ast.Select deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueVariant_issue(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._IssueVariant_issue(ctx, field, obj) case "created_at": - out.Values[i] = ec._IssueRepository_created_at(ctx, field, obj) + field := field + + 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 ec._IssueVariant_created_at(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariant_created_at(ctx, field, obj) case "updated_at": - out.Values[i] = ec._IssueRepository_updated_at(ctx, field, obj) + field := field + + 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 ec._IssueVariant_updated_at(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariant_updated_at(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -28214,26 +35327,86 @@ func (ec *executionContext) _IssueRepository(ctx context.Context, sel ast.Select return out } -var issueRepositoryConnectionImplementors = []string{"IssueRepositoryConnection", "Connection"} +var issueVariantConnectionImplementors = []string{"IssueVariantConnection", "Connection"} -func (ec *executionContext) _IssueRepositoryConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueRepositoryConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueRepositoryConnectionImplementors) +func (ec *executionContext) _IssueVariantConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueVariantConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueVariantConnectionImplementors) 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("IssueRepositoryConnection") + out.Values[i] = graphql.MarshalString("IssueVariantConnection") case "totalCount": - out.Values[i] = ec._IssueRepositoryConnection_totalCount(ctx, field, obj) + field := field + + 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 ec._IssueVariantConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariantConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "edges": - out.Values[i] = ec._IssueRepositoryConnection_edges(ctx, field, obj) + field := field + + 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 ec._IssueVariantConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariantConnection_edges(ctx, field, obj) case "pageInfo": - out.Values[i] = ec._IssueRepositoryConnection_pageInfo(ctx, field, obj) + field := field + + 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 ec._IssueVariantConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariantConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -28257,90 +35430,45 @@ func (ec *executionContext) _IssueRepositoryConnection(ctx context.Context, sel return out } -var issueRepositoryEdgeImplementors = []string{"IssueRepositoryEdge", "Edge"} +var issueVariantEdgeImplementors = []string{"IssueVariantEdge", "Edge"} -func (ec *executionContext) _IssueRepositoryEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueRepositoryEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueRepositoryEdgeImplementors) +func (ec *executionContext) _IssueVariantEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueVariantEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, issueVariantEdgeImplementors) 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("IssueRepositoryEdge") + out.Values[i] = graphql.MarshalString("IssueVariantEdge") case "node": - out.Values[i] = ec._IssueRepositoryEdge_node(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "cursor": - out.Values[i] = ec._IssueRepositoryEdge_cursor(ctx, field, obj) - case "priority": - out.Values[i] = ec._IssueRepositoryEdge_priority(ctx, field, obj) - case "created_at": - out.Values[i] = ec._IssueRepositoryEdge_created_at(ctx, field, obj) - case "updated_at": - out.Values[i] = ec._IssueRepositoryEdge_updated_at(ctx, field, obj) - 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 issueVariantImplementors = []string{"IssueVariant", "Node"} + field := field -func (ec *executionContext) _IssueVariant(ctx context.Context, sel ast.SelectionSet, obj *model.IssueVariant) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueVariantImplementors) + 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 ec._IssueVariantEdge_node(ctx, field, obj) + }) - 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("IssueVariant") - case "id": - out.Values[i] = ec._IssueVariant_id(ctx, field, obj) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueVariantEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } - case "secondaryName": - out.Values[i] = ec._IssueVariant_secondaryName(ctx, field, obj) - case "description": - out.Values[i] = ec._IssueVariant_description(ctx, field, obj) - case "severity": - out.Values[i] = ec._IssueVariant_severity(ctx, field, obj) - case "issueRepositoryId": - out.Values[i] = ec._IssueVariant_issueRepositoryId(ctx, field, obj) - case "issueRepository": + case "cursor": 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._IssueVariant_issueRepository(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -28352,29 +35480,38 @@ func (ec *executionContext) _IssueVariant(ctx context.Context, sel ast.Selection deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueVariantEdge_cursor(ctx, field, obj) }) // 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 "issueId": - out.Values[i] = ec._IssueVariant_issueId(ctx, field, obj) - case "issue": + out.Values[i] = ec._IssueVariantEdge_cursor(ctx, field, obj) + case "created_at": 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._IssueVariant_issue(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 ec._IssueVariantEdge_created_at(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._IssueVariantEdge_created_at(ctx, field, obj) + case "updated_at": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -28387,19 +35524,14 @@ func (ec *executionContext) _IssueVariant(ctx context.Context, sel ast.Selection deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._IssueVariantEdge_updated_at(ctx, field, obj) }) // 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 "created_at": - out.Values[i] = ec._IssueVariant_created_at(ctx, field, obj) - case "updated_at": - out.Values[i] = ec._IssueVariant_updated_at(ctx, field, obj) + out.Values[i] = ec._IssueVariantEdge_updated_at(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -28423,71 +35555,127 @@ func (ec *executionContext) _IssueVariant(ctx context.Context, sel ast.Selection return out } -var issueVariantConnectionImplementors = []string{"IssueVariantConnection", "Connection"} +var metadataImplementors = []string{"Metadata"} -func (ec *executionContext) _IssueVariantConnection(ctx context.Context, sel ast.SelectionSet, obj *model.IssueVariantConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueVariantConnectionImplementors) +func (ec *executionContext) _Metadata(ctx context.Context, sel ast.SelectionSet, obj *model.Metadata) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, metadataImplementors) 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("IssueVariantConnection") - case "totalCount": - out.Values[i] = ec._IssueVariantConnection_totalCount(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "edges": - out.Values[i] = ec._IssueVariantConnection_edges(ctx, field, obj) - case "pageInfo": - out.Values[i] = ec._IssueVariantConnection_pageInfo(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } + out.Values[i] = graphql.MarshalString("Metadata") + case "created_at": + field := field - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + 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 ec._Metadata_created_at(ctx, field, obj) + }) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Metadata_created_at(ctx, field, obj) + case "created_by": + field := field - return out -} + 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 ec._Metadata_created_by(ctx, field, obj) + }) -var issueVariantEdgeImplementors = []string{"IssueVariantEdge", "Edge"} + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Metadata_created_by(ctx, field, obj) + case "deleted_at": + field := field -func (ec *executionContext) _IssueVariantEdge(ctx context.Context, sel ast.SelectionSet, obj *model.IssueVariantEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, issueVariantEdgeImplementors) + 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 ec._Metadata_deleted_at(ctx, field, obj) + }) - 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("IssueVariantEdge") - case "node": - out.Values[i] = ec._IssueVariantEdge_node(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "cursor": - out.Values[i] = ec._IssueVariantEdge_cursor(ctx, field, obj) - case "created_at": - out.Values[i] = ec._IssueVariantEdge_created_at(ctx, field, obj) + out.Values[i] = ec._Metadata_deleted_at(ctx, field, obj) case "updated_at": - out.Values[i] = ec._IssueVariantEdge_updated_at(ctx, field, obj) + field := field + + 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 ec._Metadata_updated_at(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Metadata_updated_at(ctx, field, obj) + case "updated_by": + field := field + + 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 ec._Metadata_updated_by(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Metadata_updated_by(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -28531,6 +35719,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) case "__typename": out.Values[i] = graphql.MarshalString("Mutation") case "createUser": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createUser(ctx, field) }) @@ -28538,6 +35728,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateUser": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateUser(ctx, field) }) @@ -28545,6 +35737,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteUser": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteUser(ctx, field) }) @@ -28552,6 +35746,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createSupportGroup": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createSupportGroup(ctx, field) }) @@ -28559,6 +35755,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateSupportGroup": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateSupportGroup(ctx, field) }) @@ -28566,6 +35764,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteSupportGroup": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteSupportGroup(ctx, field) }) @@ -28573,6 +35773,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addServiceToSupportGroup": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addServiceToSupportGroup(ctx, field) }) @@ -28580,6 +35782,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeServiceFromSupportGroup": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeServiceFromSupportGroup(ctx, field) }) @@ -28587,6 +35791,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addUserToSupportGroup": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addUserToSupportGroup(ctx, field) }) @@ -28594,6 +35800,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeUserFromSupportGroup": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeUserFromSupportGroup(ctx, field) }) @@ -28601,6 +35809,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createComponent": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createComponent(ctx, field) }) @@ -28608,6 +35818,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateComponent": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateComponent(ctx, field) }) @@ -28615,6 +35827,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteComponent": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteComponent(ctx, field) }) @@ -28622,6 +35836,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createComponentInstance": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createComponentInstance(ctx, field) }) @@ -28629,6 +35845,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateComponentInstance": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateComponentInstance(ctx, field) }) @@ -28636,6 +35854,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteComponentInstance": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteComponentInstance(ctx, field) }) @@ -28643,6 +35863,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createComponentVersion": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createComponentVersion(ctx, field) }) @@ -28650,6 +35872,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateComponentVersion": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateComponentVersion(ctx, field) }) @@ -28657,6 +35881,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteComponentVersion": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteComponentVersion(ctx, field) }) @@ -28664,6 +35890,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createService": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createService(ctx, field) }) @@ -28671,6 +35899,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateService": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateService(ctx, field) }) @@ -28678,6 +35908,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteService": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteService(ctx, field) }) @@ -28685,6 +35917,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addOwnerToService": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addOwnerToService(ctx, field) }) @@ -28692,6 +35926,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeOwnerFromService": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeOwnerFromService(ctx, field) }) @@ -28699,6 +35935,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addIssueRepositoryToService": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addIssueRepositoryToService(ctx, field) }) @@ -28706,6 +35944,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeIssueRepositoryFromService": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeIssueRepositoryFromService(ctx, field) }) @@ -28713,6 +35953,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createIssueRepository": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createIssueRepository(ctx, field) }) @@ -28720,6 +35962,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateIssueRepository": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateIssueRepository(ctx, field) }) @@ -28727,6 +35971,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteIssueRepository": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteIssueRepository(ctx, field) }) @@ -28734,6 +35980,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createIssue": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createIssue(ctx, field) }) @@ -28741,6 +35989,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateIssue": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateIssue(ctx, field) }) @@ -28748,6 +35998,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteIssue": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteIssue(ctx, field) }) @@ -28755,6 +36007,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addComponentVersionToIssue": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addComponentVersionToIssue(ctx, field) }) @@ -28762,6 +36016,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeComponentVersionFromIssue": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeComponentVersionFromIssue(ctx, field) }) @@ -28769,6 +36025,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createIssueVariant": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createIssueVariant(ctx, field) }) @@ -28776,6 +36034,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateIssueVariant": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateIssueVariant(ctx, field) }) @@ -28783,6 +36043,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteIssueVariant": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteIssueVariant(ctx, field) }) @@ -28790,6 +36052,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createEvidence": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createEvidence(ctx, field) }) @@ -28797,6 +36061,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateEvidence": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateEvidence(ctx, field) }) @@ -28804,6 +36070,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteEvidence": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteEvidence(ctx, field) }) @@ -28811,6 +36079,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createIssueMatch": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createIssueMatch(ctx, field) }) @@ -28818,6 +36088,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateIssueMatch": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateIssueMatch(ctx, field) }) @@ -28825,6 +36097,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteIssueMatch": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteIssueMatch(ctx, field) }) @@ -28832,6 +36106,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addEvidenceToIssueMatch": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addEvidenceToIssueMatch(ctx, field) }) @@ -28839,6 +36115,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeEvidenceFromIssueMatch": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeEvidenceFromIssueMatch(ctx, field) }) @@ -28846,6 +36124,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createIssueMatchChange": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createIssueMatchChange(ctx, field) }) @@ -28853,6 +36133,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateIssueMatchChange": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateIssueMatchChange(ctx, field) }) @@ -28860,6 +36142,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteIssueMatchChange": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteIssueMatchChange(ctx, field) }) @@ -28867,6 +36151,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "createActivity": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_createActivity(ctx, field) }) @@ -28874,6 +36160,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "updateActivity": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateActivity(ctx, field) }) @@ -28881,6 +36169,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "deleteActivity": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_deleteActivity(ctx, field) }) @@ -28888,6 +36178,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addServiceToActivity": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addServiceToActivity(ctx, field) }) @@ -28895,6 +36187,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeServiceFromActivity": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeServiceFromActivity(ctx, field) }) @@ -28902,6 +36196,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "addIssueToActivity": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_addIssueToActivity(ctx, field) }) @@ -28909,6 +36205,8 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Invalids++ } case "removeIssueFromActivity": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_removeIssueFromActivity(ctx, field) }) @@ -28950,12 +36248,92 @@ func (ec *executionContext) _Page(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Page") case "after": + field := field + + 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 ec._Page_after(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Page_after(ctx, field, obj) case "isCurrent": + field := field + + 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 ec._Page_isCurrent(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Page_isCurrent(ctx, field, obj) case "pageNumber": + field := field + + 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 ec._Page_pageNumber(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Page_pageNumber(ctx, field, obj) case "pageCount": + field := field + + 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 ec._Page_pageCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Page_pageCount(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -28992,16 +36370,136 @@ func (ec *executionContext) _PageInfo(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("PageInfo") case "hasNextPage": + field := field + + 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 ec._PageInfo_hasNextPage(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._PageInfo_hasNextPage(ctx, field, obj) case "hasPreviousPage": + field := field + + 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 ec._PageInfo_hasPreviousPage(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._PageInfo_hasPreviousPage(ctx, field, obj) case "isValidPage": + field := field + + 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 ec._PageInfo_isValidPage(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._PageInfo_isValidPage(ctx, field, obj) case "pageNumber": + field := field + + 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 ec._PageInfo_pageNumber(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._PageInfo_pageNumber(ctx, field, obj) case "nextPageAfter": + field := field + + 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 ec._PageInfo_nextPageAfter(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._PageInfo_nextPageAfter(ctx, field, obj) case "pages": + field := field + + 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 ec._PageInfo_pages(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._PageInfo_pages(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -29048,293 +36546,102 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "Issues": 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._Query_Issues(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_Issues(ctx, field) + }) case "IssueMatches": - 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._Query_IssueMatches(ctx, field) - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - } + field := field - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_IssueMatches(ctx, field) + }) case "IssueMatchChanges": 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._Query_IssueMatchChanges(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_IssueMatchChanges(ctx, field) + }) case "Services": 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._Query_Services(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_Services(ctx, field) + }) case "Components": 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._Query_Components(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_Components(ctx, field) + }) case "ComponentVersions": 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._Query_ComponentVersions(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_ComponentVersions(ctx, field) + }) case "ComponentInstances": 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._Query_ComponentInstances(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_ComponentInstances(ctx, field) + }) case "Activities": 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._Query_Activities(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_Activities(ctx, field) + }) case "IssueVariants": 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._Query_IssueVariants(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_IssueVariants(ctx, field) + }) case "IssueRepositories": 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._Query_IssueRepositories(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_IssueRepositories(ctx, field) + }) case "Evidences": 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._Query_Evidences(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_Evidences(ctx, field) + }) case "SupportGroups": 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._Query_SupportGroups(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_SupportGroups(ctx, field) + }) case "Users": 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._Query_Users(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_Users(ctx, field) + }) case "ServiceFilterValues": 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._Query_ServiceFilterValues(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_ServiceFilterValues(ctx, field) + }) case "IssueMatchFilterValues": 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._Query_IssueMatchFilterValues(ctx, field) - 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) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_IssueMatchFilterValues(ctx, field) + }) case "__type": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___type(ctx, field) }) case "__schema": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___schema(ctx, field) }) @@ -29373,24 +36680,54 @@ func (ec *executionContext) _Service(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Service") case "id": + field := field + + 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 ec._Service_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Service_id(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "name": - out.Values[i] = ec._Service_name(ctx, field, obj) - case "owners": 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._Service_owners(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 ec._Service_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._Service_name(ctx, field, obj) + case "owners": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -29403,28 +36740,17 @@ func (ec *executionContext) _Service(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Service_owners(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._Service_owners(ctx, field, obj) case "supportGroups": 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._Service_supportGroups(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29436,28 +36762,17 @@ func (ec *executionContext) _Service(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Service_supportGroups(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._Service_supportGroups(ctx, field, obj) case "activities": 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._Service_activities(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29469,28 +36784,17 @@ func (ec *executionContext) _Service(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Service_activities(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._Service_activities(ctx, field, obj) case "issueRepositories": 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._Service_issueRepositories(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29502,28 +36806,17 @@ func (ec *executionContext) _Service(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Service_issueRepositories(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._Service_issueRepositories(ctx, field, obj) case "componentInstances": 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._Service_componentInstances(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29535,15 +36828,14 @@ func (ec *executionContext) _Service(ctx context.Context, sel ast.SelectionSet, deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._Service_componentInstances(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._Service_componentInstances(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -29579,13 +36871,73 @@ func (ec *executionContext) _ServiceConnection(ctx context.Context, sel ast.Sele case "__typename": out.Values[i] = graphql.MarshalString("ServiceConnection") case "totalCount": + field := field + + 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 ec._ServiceConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._ServiceConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "edges": + field := field + + 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 ec._ServiceConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._ServiceConnection_edges(ctx, field, obj) case "pageInfo": + field := field + + 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 ec._ServiceConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._ServiceConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -29622,13 +36974,73 @@ func (ec *executionContext) _ServiceEdge(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("ServiceEdge") case "node": + field := field + + 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 ec._ServiceEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._ServiceEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "cursor": + field := field + + 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 ec._ServiceEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._ServiceEdge_cursor(ctx, field, obj) case "priority": + field := field + + 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 ec._ServiceEdge_priority(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._ServiceEdge_priority(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -29667,16 +37079,6 @@ func (ec *executionContext) _ServiceFilterValue(ctx context.Context, sel ast.Sel case "serviceName": 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._ServiceFilterValue_serviceName(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29688,28 +37090,17 @@ func (ec *executionContext) _ServiceFilterValue(ctx context.Context, sel ast.Sel deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._ServiceFilterValue_serviceName(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._ServiceFilterValue_serviceName(ctx, field, obj) case "uniqueUserId": 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._ServiceFilterValue_uniqueUserId(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29721,28 +37112,17 @@ func (ec *executionContext) _ServiceFilterValue(ctx context.Context, sel ast.Sel deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._ServiceFilterValue_uniqueUserId(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._ServiceFilterValue_uniqueUserId(ctx, field, obj) case "userName": 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._ServiceFilterValue_userName(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29754,28 +37134,17 @@ func (ec *executionContext) _ServiceFilterValue(ctx context.Context, sel ast.Sel deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._ServiceFilterValue_userName(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._ServiceFilterValue_userName(ctx, field, obj) case "supportGroupName": 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._ServiceFilterValue_supportGroupName(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29787,15 +37156,14 @@ func (ec *executionContext) _ServiceFilterValue(ctx context.Context, sel ast.Sel deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._ServiceFilterValue_supportGroupName(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._ServiceFilterValue_supportGroupName(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -29831,10 +37199,70 @@ func (ec *executionContext) _Severity(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Severity") case "value": + field := field + + 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 ec._Severity_value(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Severity_value(ctx, field, obj) case "score": + field := field + + 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 ec._Severity_score(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Severity_score(ctx, field, obj) case "cvss": + field := field + + 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 ec._Severity_cvss(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Severity_cvss(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -29871,24 +37299,54 @@ func (ec *executionContext) _SupportGroup(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("SupportGroup") case "id": + field := field + + 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 ec._SupportGroup_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._SupportGroup_id(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "name": - out.Values[i] = ec._SupportGroup_name(ctx, field, obj) - case "users": 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._SupportGroup_users(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 ec._SupportGroup_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._SupportGroup_name(ctx, field, obj) + case "users": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -29901,28 +37359,17 @@ func (ec *executionContext) _SupportGroup(ctx context.Context, sel ast.Selection deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._SupportGroup_users(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._SupportGroup_users(ctx, field, obj) case "services": 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._SupportGroup_services(ctx, field, obj) - return res - } - if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] di := 0 @@ -29934,15 +37381,14 @@ func (ec *executionContext) _SupportGroup(ctx context.Context, sel ast.Selection deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._SupportGroup_services(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._SupportGroup_services(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -29978,13 +37424,73 @@ func (ec *executionContext) _SupportGroupConnection(ctx context.Context, sel ast case "__typename": out.Values[i] = graphql.MarshalString("SupportGroupConnection") case "totalCount": + field := field + + 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 ec._SupportGroupConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._SupportGroupConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "edges": + field := field + + 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 ec._SupportGroupConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._SupportGroupConnection_edges(ctx, field, obj) case "pageInfo": + field := field + + 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 ec._SupportGroupConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._SupportGroupConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30021,11 +37527,51 @@ func (ec *executionContext) _SupportGroupEdge(ctx context.Context, sel ast.Selec case "__typename": out.Values[i] = graphql.MarshalString("SupportGroupEdge") case "node": + field := field + + 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 ec._SupportGroupEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._SupportGroupEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "cursor": + field := field + + 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 ec._SupportGroupEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._SupportGroupEdge_cursor(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30062,31 +37608,101 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("User") case "id": + field := field + + 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 ec._User_id(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._User_id(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ + } + case "uniqueUserId": + field := field + + 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 ec._User_uniqueUserId(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._User_uniqueUserId(ctx, field, obj) + case "type": + field := field + + 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 ec._User_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "uniqueUserId": - out.Values[i] = ec._User_uniqueUserId(ctx, field, obj) - case "type": out.Values[i] = ec._User_type(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + out.Invalids++ } case "name": - out.Values[i] = ec._User_name(ctx, field, obj) - case "supportGroups": 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._User_supportGroups(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 ec._User_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._User_name(ctx, field, obj) + case "supportGroups": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -30099,27 +37715,38 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._User_supportGroups(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._User_supportGroups(ctx, field, obj) case "services": 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._User_services(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 ec._User_services(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } + out.Values[i] = ec._User_services(ctx, field, obj) + case "metadata": + field := field if field.Deferrable != nil { dfs, ok := deferred[field.Deferrable.Label] @@ -30132,15 +37759,14 @@ func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) + return ec._User_metadata(ctx, field, obj) }) // 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) }) + out.Values[i] = ec._User_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -30176,13 +37802,73 @@ func (ec *executionContext) _UserConnection(ctx context.Context, sel ast.Selecti case "__typename": out.Values[i] = graphql.MarshalString("UserConnection") case "totalCount": + field := field + + 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 ec._UserConnection_totalCount(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._UserConnection_totalCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "edges": + field := field + + 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 ec._UserConnection_edges(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._UserConnection_edges(ctx, field, obj) case "pageInfo": + field := field + + 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 ec._UserConnection_pageInfo(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._UserConnection_pageInfo(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30219,11 +37905,51 @@ func (ec *executionContext) _UserEdge(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("UserEdge") case "node": + field := field + + 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 ec._UserEdge_node(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._UserEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "cursor": + field := field + + 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 ec._UserEdge_cursor(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._UserEdge_cursor(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30260,23 +37986,123 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": + field := field + + 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 ec.___Directive_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + 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 ec.___Directive_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": + field := field + + 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 ec.___Directive_locations(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "args": + field := field + + 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 ec.___Directive_args(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isRepeatable": + field := field + + 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 ec.___Directive_isRepeatable(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -30316,18 +38142,98 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": + field := field + + 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 ec.___EnumValue_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + 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 ec.___EnumValue_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": + field := field + + 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 ec.___EnumValue_isDeprecated(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": + field := field + + 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 ec.___EnumValue_deprecationReason(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30364,28 +38270,148 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": + field := field + + 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 ec.___Field_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + 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 ec.___Field_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": + field := field + + 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 ec.___Field_args(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "type": + field := field + + 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 ec.___Field_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isDeprecated": + field := field + + 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 ec.___Field_isDeprecated(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": + field := field + + 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 ec.___Field_deprecationReason(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30422,18 +38448,98 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": + field := field + + 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 ec.___InputValue_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + 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 ec.___InputValue_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": + field := field + + 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 ec.___InputValue_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "defaultValue": + field := field + + 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 ec.___InputValue_defaultValue(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30470,22 +38576,142 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": + field := field + + 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 ec.___Schema_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": + field := field + + 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 ec.___Schema_types(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "queryType": + field := field + + 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 ec.___Schema_queryType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "mutationType": + field := field + + 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 ec.___Schema_mutationType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": + field := field + + 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 ec.___Schema_subscriptionType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": + field := field + + 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 ec.___Schema_directives(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -30525,27 +38751,227 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": + field := field + + 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 ec.___Type_kind(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "name": + field := field + + 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 ec.___Type_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": + field := field + + 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 ec.___Type_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": + field := field + + 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 ec.___Type_fields(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": + field := field + + 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 ec.___Type_interfaces(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": + field := field + + 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 ec.___Type_possibleTypes(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": + field := field + + 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 ec.___Type_enumValues(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": + field := field + + 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 ec.___Type_inputFields(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": + field := field + + 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 ec.___Type_ofType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": + field := field + + 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 ec.___Type_specifiedByURL(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -30644,7 +39070,7 @@ func (ec *executionContext) marshalNComponentInstance2ᚖgithubᚗcomᚋcloudope func (ec *executionContext) marshalNComponentInstanceEdge2ᚕᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentInstanceEdge(ctx context.Context, sel ast.SelectionSet, v []*model.ComponentInstanceEdge) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -30701,7 +39127,7 @@ func (ec *executionContext) marshalNComponentVersion2ᚖgithubᚗcomᚋcloudoper func (ec *executionContext) marshalNComponentVersionEdge2ᚕᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐComponentVersionEdge(ctx context.Context, sel ast.SelectionSet, v []*model.ComponentVersionEdge) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -30822,7 +39248,7 @@ func (ec *executionContext) marshalNIssue2ᚖgithubᚗcomᚋcloudoperatorsᚋheu func (ec *executionContext) marshalNIssueEdge2ᚕᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueEdge(ctx context.Context, sel ast.SelectionSet, v []*model.IssueEdge) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31017,7 +39443,7 @@ func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31093,7 +39519,7 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31149,7 +39575,7 @@ func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlg func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31197,7 +39623,7 @@ func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋg func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31283,7 +39709,7 @@ func (ec *executionContext) marshalOActivityEdge2ᚕᚖgithubᚗcomᚋcloudopera } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31359,7 +39785,7 @@ func (ec *executionContext) marshalOActivityStatusValues2ᚕᚖgithubᚗcomᚋcl } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31516,7 +39942,7 @@ func (ec *executionContext) marshalOComponentEdge2ᚕᚖgithubᚗcomᚋcloudoper } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31662,7 +40088,7 @@ func (ec *executionContext) marshalOEvidenceEdge2ᚕᚖgithubᚗcomᚋcloudopera } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31838,7 +40264,7 @@ func (ec *executionContext) marshalOIssueMatchChangeActions2ᚕᚖgithubᚗcom } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31902,7 +40328,7 @@ func (ec *executionContext) marshalOIssueMatchChangeEdge2ᚕᚖgithubᚗcomᚋcl } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -31965,7 +40391,7 @@ func (ec *executionContext) marshalOIssueMatchEdge2ᚕᚖgithubᚗcomᚋcloudope } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32048,7 +40474,7 @@ func (ec *executionContext) marshalOIssueMatchStatusValues2ᚕᚖgithubᚗcomᚋ } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32126,7 +40552,7 @@ func (ec *executionContext) marshalOIssueRepositoryEdge2ᚕᚖgithubᚗcomᚋclo } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32202,7 +40628,7 @@ func (ec *executionContext) marshalOIssueTypes2ᚕᚖgithubᚗcomᚋcloudoperato } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32266,7 +40692,7 @@ func (ec *executionContext) marshalOIssueVariantEdge2ᚕᚖgithubᚗcomᚋcloudo } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32316,13 +40742,20 @@ func (ec *executionContext) unmarshalOIssueVariantFilter2ᚖgithubᚗcomᚋcloud return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx context.Context, sel ast.SelectionSet, v *model.Metadata) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Metadata(ctx, sel, v) +} + func (ec *executionContext) marshalOPage2ᚕᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐPage(ctx context.Context, sel ast.SelectionSet, v []*model.Page) graphql.Marshaler { if v == nil { return graphql.Null } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32391,7 +40824,7 @@ func (ec *executionContext) marshalOServiceEdge2ᚕᚖgithubᚗcomᚋcloudoperat } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32489,7 +40922,7 @@ func (ec *executionContext) marshalOSeverityValues2ᚕᚖgithubᚗcomᚋcloudope } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32601,7 +41034,7 @@ func (ec *executionContext) marshalOSupportGroupEdge2ᚕᚖgithubᚗcomᚋcloudo } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32671,7 +41104,7 @@ func (ec *executionContext) marshalOUserEdge2ᚕᚖgithubᚗcomᚋcloudoperators } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32727,7 +41160,7 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgq } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32774,7 +41207,7 @@ func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32821,7 +41254,7 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋg } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -32875,7 +41308,7 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index b3cba03d..e66b693c 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -15,6 +15,18 @@ import ( ) // add custom models here +func getModelMetadata(em entity.Metadata) *Metadata { + createdAt := em.CreatedAt.String() + deletedAt := em.DeletedAt.String() + updatedAt := em.UpdatedAt.String() + return &Metadata{ + CreatedAt: &createdAt, + CreatedBy: &em.CreatedBy, + DeletedAt: &deletedAt, + UpdatedAt: &updatedAt, + UpdatedBy: &em.UpdatedBy, + } +} func NewPageInfo(p *entity.PageInfo) *PageInfo { if p == nil { @@ -219,7 +231,7 @@ func NewIssueMatchEntity(im *IssueMatchInput) entity.IssueMatch { IssueId: issueId, ComponentInstanceId: ciId, UserId: userId, - Info: entity.Info{CreatedAt: createdAt}, + Metadata: entity.Metadata{CreatedAt: createdAt}, } } @@ -320,6 +332,7 @@ func NewUser(user *entity.User) User { UniqueUserID: &user.UniqueUserID, Name: &user.Name, Type: int(user.Type), + Metadata: getModelMetadata(user.Metadata), } } @@ -364,6 +377,7 @@ func NewActivity(activity *entity.Activity) Activity { return Activity{ ID: fmt.Sprintf("%d", activity.Id), Status: &status, + //Metadata: activity.getModelMetadata(activitiy), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index 5610184e..2557d136 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -1,6 +1,3 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - // Code generated by github.com/99designs/gqlgen, DO NOT EDIT. package model @@ -569,6 +566,14 @@ type IssueVariantInput struct { Severity *SeverityInput `json:"severity,omitempty"` } +type Metadata struct { + CreatedAt *string `json:"created_at,omitempty"` + CreatedBy *string `json:"created_by,omitempty"` + DeletedAt *string `json:"deleted_at,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + UpdatedBy *string `json:"updated_by,omitempty"` +} + type Mutation struct { } @@ -699,6 +704,7 @@ type User struct { Name *string `json:"name,omitempty"` SupportGroups *SupportGroupConnection `json:"supportGroups,omitempty"` Services *ServiceConnection `json:"services,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (User) IsNode() {} diff --git a/internal/api/graphql/graph/queryCollection/user/listUsers.graphql b/internal/api/graphql/graph/queryCollection/user/listUsers.graphql new file mode 100644 index 00000000..9fd813a3 --- /dev/null +++ b/internal/api/graphql/graph/queryCollection/user/listUsers.graphql @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +# SPDX-License-Identifier: Apache-2.0 + +query ($filter: UserFilter, $first: Int, $after: String) { + Users ( + filter: $filter, + first: $first, + after: $after + ) { + totalCount + edges { + node { + id + name + type + metadata { + created_at + created_by + deleted_at + updated_at + updated_by + } + } + cursor + } + } +} diff --git a/internal/api/graphql/graph/resolver/activity.go b/internal/api/graphql/graph/resolver/activity.go index e7884d88..70ad9901 100644 --- a/internal/api/graphql/graph/resolver/activity.go +++ b/internal/api/graphql/graph/resolver/activity.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/component.go b/internal/api/graphql/graph/resolver/component.go index 905815d8..58bb0621 100644 --- a/internal/api/graphql/graph/resolver/component.go +++ b/internal/api/graphql/graph/resolver/component.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/component_instance.go b/internal/api/graphql/graph/resolver/component_instance.go index 5975d19b..f75f932b 100644 --- a/internal/api/graphql/graph/resolver/component_instance.go +++ b/internal/api/graphql/graph/resolver/component_instance.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/component_version.go b/internal/api/graphql/graph/resolver/component_version.go index 3227f492..6a1f209e 100644 --- a/internal/api/graphql/graph/resolver/component_version.go +++ b/internal/api/graphql/graph/resolver/component_version.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/evidence.go b/internal/api/graphql/graph/resolver/evidence.go index 4ffa908c..f5a20b1e 100644 --- a/internal/api/graphql/graph/resolver/evidence.go +++ b/internal/api/graphql/graph/resolver/evidence.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/issue.go b/internal/api/graphql/graph/resolver/issue.go index 65f264d8..21e99e67 100644 --- a/internal/api/graphql/graph/resolver/issue.go +++ b/internal/api/graphql/graph/resolver/issue.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/issue_match.go b/internal/api/graphql/graph/resolver/issue_match.go index 4c60bf9b..ac12edb3 100644 --- a/internal/api/graphql/graph/resolver/issue_match.go +++ b/internal/api/graphql/graph/resolver/issue_match.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/issue_match_change.go b/internal/api/graphql/graph/resolver/issue_match_change.go index 14afca9d..ad6bef2d 100644 --- a/internal/api/graphql/graph/resolver/issue_match_change.go +++ b/internal/api/graphql/graph/resolver/issue_match_change.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/issue_match_filter_value.go b/internal/api/graphql/graph/resolver/issue_match_filter_value.go index e7e732e1..8e37ad4e 100644 --- a/internal/api/graphql/graph/resolver/issue_match_filter_value.go +++ b/internal/api/graphql/graph/resolver/issue_match_filter_value.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/issue_repository.go b/internal/api/graphql/graph/resolver/issue_repository.go index f05e2966..0c32d094 100644 --- a/internal/api/graphql/graph/resolver/issue_repository.go +++ b/internal/api/graphql/graph/resolver/issue_repository.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/issue_variant.go b/internal/api/graphql/graph/resolver/issue_variant.go index 1f8b10f9..58cc96dc 100644 --- a/internal/api/graphql/graph/resolver/issue_variant.go +++ b/internal/api/graphql/graph/resolver/issue_variant.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/mutation.go b/internal/api/graphql/graph/resolver/mutation.go index 867a3332..724d9d7f 100644 --- a/internal/api/graphql/graph/resolver/mutation.go +++ b/internal/api/graphql/graph/resolver/mutation.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/query.go b/internal/api/graphql/graph/resolver/query.go index 36f6beba..f790e413 100644 --- a/internal/api/graphql/graph/resolver/query.go +++ b/internal/api/graphql/graph/resolver/query.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/service.go b/internal/api/graphql/graph/resolver/service.go index 70cbfd6e..d830ce30 100644 --- a/internal/api/graphql/graph/resolver/service.go +++ b/internal/api/graphql/graph/resolver/service.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/service_filter.go b/internal/api/graphql/graph/resolver/service_filter.go index 873071fd..7231b7e2 100644 --- a/internal/api/graphql/graph/resolver/service_filter.go +++ b/internal/api/graphql/graph/resolver/service_filter.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/support_group.go b/internal/api/graphql/graph/resolver/support_group.go index 47860779..3de7ea89 100644 --- a/internal/api/graphql/graph/resolver/support_group.go +++ b/internal/api/graphql/graph/resolver/support_group.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/resolver/user.go b/internal/api/graphql/graph/resolver/user.go index 6ab76f7a..f2047f52 100644 --- a/internal/api/graphql/graph/resolver/user.go +++ b/internal/api/graphql/graph/resolver/user.go @@ -1,11 +1,8 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - package resolver // This file will be automatically regenerated based on the schema, any resolver implementations // will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.49 +// Code generated by github.com/99designs/gqlgen version v0.17.51 import ( "context" diff --git a/internal/api/graphql/graph/schema/common.graphqls b/internal/api/graphql/graph/schema/common.graphqls index 9a97275c..ee15d2b7 100644 --- a/internal/api/graphql/graph/schema/common.graphqls +++ b/internal/api/graphql/graph/schema/common.graphqls @@ -104,4 +104,12 @@ type FilterItem { displayName: String filterName: String values: [String] -} \ No newline at end of file +} + +type Metadata { + created_at: DateTime + created_by: String + deleted_at: DateTime + updated_at: DateTime + updated_by: String +} diff --git a/internal/api/graphql/graph/schema/user.graphqls b/internal/api/graphql/graph/schema/user.graphqls index 91b7d12a..2cd19c19 100644 --- a/internal/api/graphql/graph/schema/user.graphqls +++ b/internal/api/graphql/graph/schema/user.graphqls @@ -8,6 +8,7 @@ type User implements Node { name: String supportGroups(filter: SupportGroupFilter, first: Int, after: String): SupportGroupConnection services(filter: ServiceFilter, first: Int, after: String): ServiceConnection + metadata: Metadata } input UserInput { diff --git a/internal/app/user/user_handler.go b/internal/app/user/user_handler.go index 19abd432..71e474f4 100644 --- a/internal/app/user/user_handler.go +++ b/internal/app/user/user_handler.go @@ -103,6 +103,7 @@ func (u *userHandler) ListUsers(filter *entity.UserFilter, options *entity.ListO } func (u *userHandler) CreateUser(user *entity.User) (*entity.User, error) { + user.CreatedBy = "Creator" f := &entity.UserFilter{ UniqueUserID: []*string{&user.UniqueUserID}, } @@ -136,6 +137,7 @@ func (u *userHandler) CreateUser(user *entity.User) (*entity.User, error) { } func (u *userHandler) UpdateUser(user *entity.User) (*entity.User, error) { + user.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateUserEventName, "object": user, diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index c1f135f4..2e802693 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -96,7 +96,7 @@ func (ir *IssueRow) AsIssue() entity.Issue { IssueVariants: []entity.IssueVariant{}, IssueMatches: []entity.IssueMatch{}, Activity: []entity.Activity{}, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ir.CreatedAt), DeletedAt: GetTimeValue(ir.DeletedAt), UpdatedAt: GetTimeValue(ir.UpdatedAt), @@ -138,7 +138,7 @@ func (ibr *GetIssuesByRow) AsIssueWithAggregations() entity.IssueWithAggregation IssueVariants: []entity.IssueVariant{}, IssueMatches: []entity.IssueMatch{}, Activity: []entity.Activity{}, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), @@ -156,7 +156,7 @@ func (ibr *GetIssuesByRow) AsIssue() entity.Issue { IssueVariants: []entity.IssueVariant{}, IssueMatches: []entity.IssueMatch{}, Activity: []entity.Activity{}, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), @@ -214,7 +214,7 @@ func (imr IssueMatchRow) AsIssueMatch() entity.IssueMatch { RemediationDate: GetTimeValue(imr.RemediationDate), TargetRemediationDate: GetTimeValue(imr.TargetRemediationDate), Severity: entity.NewSeverity(GetStringValue(imr.Vector)), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(imr.CreatedAt), DeletedAt: GetTimeValue(imr.DeletedAt), UpdatedAt: GetTimeValue(imr.UpdatedAt), @@ -267,7 +267,7 @@ func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepo Url: GetStringValue(birr.Url), IssueVariants: nil, Services: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(birr.CreatedAt), DeletedAt: GetTimeValue(birr.DeletedAt), UpdatedAt: GetTimeValue(birr.UpdatedAt), @@ -283,7 +283,7 @@ func (barr *BaseIssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Url: GetStringValue(barr.Url), IssueVariants: nil, Services: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(barr.CreatedAt), DeletedAt: GetTimeValue(barr.DeletedAt), UpdatedAt: GetTimeValue(barr.UpdatedAt), @@ -300,7 +300,7 @@ func (irr *IssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Url: GetStringValue(irr.Url), IssueVariants: nil, Services: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.CreatedAt), DeletedAt: GetTimeValue(irr.BaseIssueRepositoryRow.DeletedAt), UpdatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.UpdatedAt), @@ -336,7 +336,7 @@ func (ivr *IssueVariantRow) AsIssueVariant(repository *entity.IssueRepository) e Issue: nil, Severity: entity.NewSeverity(GetStringValue(ivr.Vector)), Description: GetStringValue(ivr.Description), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ivr.CreatedAt), DeletedAt: GetTimeValue(ivr.DeletedAt), UpdatedAt: GetTimeValue(ivr.UpdatedAt), @@ -373,7 +373,7 @@ func (ivwr *IssueVariantWithRepository) AsIssueVariantEntry() entity.IssueVarian Issue: nil, Severity: entity.NewSeverity(GetStringValue(ivwr.Vector)), Description: GetStringValue(ivwr.Description), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ivwr.IssueVariantRow.CreatedAt), DeletedAt: GetTimeValue(ivwr.IssueVariantRow.DeletedAt), UpdatedAt: GetTimeValue(ivwr.IssueVariantRow.UpdatedAt), @@ -395,7 +395,7 @@ func (cr *ComponentRow) AsComponent() entity.Component { Id: GetInt64Value(cr.Id), Name: GetStringValue(cr.Name), Type: GetStringValue(cr.Type), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cr.CreatedAt), DeletedAt: GetTimeValue(cr.DeletedAt), UpdatedAt: GetTimeValue(cr.UpdatedAt), @@ -426,7 +426,7 @@ func (cvr *ComponentVersionRow) AsComponentVersion() entity.ComponentVersion { Id: GetInt64Value(cvr.Id), Version: GetStringValue(cvr.Version), ComponentId: GetInt64Value(cvr.ComponentId), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cvr.CreatedAt), DeletedAt: GetTimeValue(cvr.DeletedAt), UpdatedAt: GetTimeValue(cvr.UpdatedAt), @@ -455,7 +455,7 @@ func (sgr *SupportGroupRow) AsSupportGroup() entity.SupportGroup { return entity.SupportGroup{ Id: GetInt64Value(sgr.Id), Name: GetStringValue(sgr.Name), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(sgr.CreatedAt), DeletedAt: GetTimeValue(sgr.DeletedAt), UpdatedAt: GetTimeValue(sgr.UpdatedAt), @@ -490,7 +490,7 @@ func (bsr *BaseServiceRow) AsBaseService() entity.BaseService { Name: GetStringValue(bsr.Name), Owners: []entity.User{}, Activities: []entity.Activity{}, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(bsr.CreatedAt), DeletedAt: GetTimeValue(bsr.DeletedAt), UpdatedAt: GetTimeValue(bsr.UpdatedAt), @@ -512,7 +512,7 @@ func (sr *ServiceRow) AsService() entity.Service { Name: GetStringValue(sr.Name), Owners: []entity.User{}, Activities: []entity.Activity{}, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(sr.BaseServiceRow.CreatedAt), DeletedAt: GetTimeValue(sr.BaseServiceRow.DeletedAt), UpdatedAt: GetTimeValue(sr.BaseServiceRow.UpdatedAt), @@ -547,7 +547,7 @@ func (ar *ActivityRow) AsActivity() entity.Activity { Status: entity.ActivityStatusValue(GetStringValue(ar.Status)), Issues: []entity.Issue{}, Evidences: []entity.Evidence{}, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ar.CreatedAt), DeletedAt: GetTimeValue(ar.DeletedAt), UpdatedAt: GetTimeValue(ar.UpdatedAt), @@ -583,7 +583,7 @@ func (cir *ComponentInstanceRow) AsComponentInstance() entity.ComponentInstance ComponentVersionId: GetInt64Value(cir.ComponentVersionId), Service: nil, ServiceId: GetInt64Value(cir.ServiceId), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cir.CreatedAt), DeletedAt: GetTimeValue(cir.DeletedAt), UpdatedAt: GetTimeValue(cir.UpdatedAt), @@ -608,8 +608,10 @@ type UserRow struct { UniqueUserID sql.NullString `db:"user_unique_user_id" json:"unique_user_id"` Type sql.NullInt64 `db:"user_type" json:"type"` CreatedAt sql.NullTime `db:"user_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"user_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"user_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"user_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"user_updated_by" json:"Updated_by"` } func (ur *UserRow) AsUser() entity.User { @@ -618,10 +620,12 @@ func (ur *UserRow) AsUser() entity.User { Name: GetStringValue(ur.Name), UniqueUserID: GetStringValue(ur.UniqueUserID), Type: GetUserTypeValue(ur.Type), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ur.CreatedAt), + CreatedBy: GetStringValue(ur.CreatedBy), DeletedAt: GetTimeValue(ur.DeletedAt), UpdatedAt: GetTimeValue(ur.UpdatedAt), + UpdatedBy: GetStringValue(ur.UpdatedBy), }, } } @@ -632,8 +636,10 @@ func (ur *UserRow) FromUser(u *entity.User) { ur.UniqueUserID = sql.NullString{String: u.UniqueUserID, Valid: true} ur.Type = sql.NullInt64{Int64: int64(u.Type), Valid: true} ur.CreatedAt = sql.NullTime{Time: u.CreatedAt, Valid: true} + ur.CreatedBy = sql.NullString{String: u.CreatedBy, Valid: true} ur.DeletedAt = sql.NullTime{Time: u.DeletedAt, Valid: true} ur.UpdatedAt = sql.NullTime{Time: u.UpdatedAt, Valid: true} + ur.UpdatedBy = sql.NullString{String: u.UpdatedBy, Valid: true} } type EvidenceRow struct { @@ -663,7 +669,7 @@ func (er *EvidenceRow) AsEvidence() entity.Evidence { UserId: GetInt64Value(er.UserId), Activity: nil, ActivityId: GetInt64Value(er.ActivityId), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(er.CreatedAt), DeletedAt: GetTimeValue(er.DeletedAt), UpdatedAt: GetTimeValue(er.UpdatedAt), @@ -701,7 +707,7 @@ func (imcr *IssueMatchChangeRow) AsIssueMatchChange() entity.IssueMatchChange { IssueMatchId: GetInt64Value(imcr.IssueMatchId), ActivityId: GetInt64Value(imcr.ActivityId), Action: GetStringValue(imcr.Action), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: GetTimeValue(imcr.CreatedAt), DeletedAt: GetTimeValue(imcr.DeletedAt), UpdatedAt: GetTimeValue(imcr.UpdatedAt), diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index 1ee75400..c8a82d9d 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -126,8 +126,10 @@ create table if not exists User user_unique_user_id varchar(64) not null, user_type int unsigned, user_created_at timestamp default current_timestamp() not null, + user_created_by varchar(256) null, user_deleted_at timestamp null, user_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + user_updated_by varchar(256) null, constraint id_UNIQUE unique (user_id), constraint unique_user_id_UNIQUE diff --git a/internal/database/mariadb/user.go b/internal/database/mariadb/user.go index b9b95f89..86fd3127 100644 --- a/internal/database/mariadb/user.go +++ b/internal/database/mariadb/user.go @@ -62,6 +62,9 @@ func (s *SqlDatabase) getUserUpdateFields(user *entity.User) string { if user.Type != entity.InvalidUserType { fl = append(fl, "user_type = :user_type") } + if user.Metadata.UpdatedBy != "" { + fl = append(fl, "user_updated_by = :user_updated_by") + } return strings.Join(fl, ", ") } @@ -178,7 +181,6 @@ func (s *SqlDatabase) GetUsers(filter *entity.UserFilter) ([]entity.User, error) } defer stmt.Close() - return performListScan( stmt, filterParameters, @@ -220,11 +222,13 @@ func (s *SqlDatabase) CreateUser(user *entity.User) (*entity.User, error) { INSERT INTO User ( user_name, user_unique_user_id, - user_type + user_type, + user_created_by ) VALUES ( :user_name, :user_unique_user_id, - :user_type + :user_type, + :user_created_by ) ` diff --git a/internal/e2e/metadata_test.go b/internal/e2e/metadata_test.go new file mode 100644 index 00000000..262fb648 --- /dev/null +++ b/internal/e2e/metadata_test.go @@ -0,0 +1,189 @@ +// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +// SPDX-License-Identifier: Apache-2.0 + +package e2e_test + +import ( + "context" + "fmt" + "os" + "time" + + "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" + "github.com/cloudoperators/heureka/internal/entity" + "github.com/cloudoperators/heureka/internal/server" + "github.com/cloudoperators/heureka/internal/util" + util2 "github.com/cloudoperators/heureka/pkg/util" + + "github.com/machinebox/graphql" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/sirupsen/logrus" +) + +const ( + testUniqueUserId = "1" + testUserType = entity.HumanUserType + testUserName = "Joe" + testUpdatedUserName = "Donald" + testCreatedBy = "Creator" + testUpdatedBy = "Updater" + dbDateLayout = "2006-01-02 15:04:05 -0700 MST" +) + +var () + +func createUser(port string) { + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/create.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("input", map[string]string{ + "uniqueUserId": testUniqueUserId, + "type": entity.GetUserTypeString(testUserType), + "name": testUserName, + }) + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + User model.User `json:"createUser"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + + Expect(*respData.User.Name).To(Equal(testUserName)) + Expect(*respData.User.UniqueUserID).To(Equal(testUniqueUserId)) + Expect(entity.UserType(respData.User.Type)).To(Equal(testUserType)) +} + +func updateUser(port string) { + // create a queryCollection (safe to share across requests) + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/update.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("id", testUniqueUserId) + req.Var("input", map[string]string{ + "name": testUpdatedUserName, + }) + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + User model.User `json:"updateUser"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + + Expect(*respData.User.Name).To(Equal(testUpdatedUserName)) + Expect(*respData.User.UniqueUserID).To(Equal(testUniqueUserId)) + Expect(entity.UserType(respData.User.Type)).To(Equal(testUserType)) +} + +func getUser(port string) model.User { + // create a queryCollection (safe to share across requests) + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/listUsers.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("filter", map[string]string{"uniqueUserId": testUniqueUserId}) + req.Var("first", 1) + req.Var("after", "0") + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + Users model.UserConnection `json:"Users"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + Expect(respData.Users.TotalCount).To(Equal(1)) + return *respData.Users.Edges[0].Node +} + +var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities"), func() { + var s *server.Server + var cfg util.Config + + BeforeEach(func() { + _ = dbm.NewTestSchema() + + cfg = dbm.DbConfig() + cfg.Port = util2.GetRandomFreePort() + s = server.NewServer(cfg) + + s.NonBlockingStart() + }) + + AfterEach(func() { + s.BlockingStop() + }) + + When("New user is created via API", func() { + var user model.User + BeforeEach(func() { + createUser(cfg.Port) + user = getUser(cfg.Port) + }) + It("shall assign CreatedBy and CreatedAt metadata fields and shall keep nil in UpdatedBy, UpdatedAt and DeltedAt metadata fields", func() { + Expect(entity.UserType(user.Type)).To(Equal(testUserType)) + Expect(user.Metadata).To(Not(BeNil())) + Expect(*user.Metadata.CreatedBy).To(Equal(testCreatedBy)) + + createdAt, err := time.Parse(dbDateLayout, *user.Metadata.CreatedAt) + Expect(err).Should(BeNil()) + Expect(createdAt).Should(BeTemporally("~", time.Now().UTC(), 3*time.Second)) + + Expect(*user.Metadata.UpdatedBy).To(BeEmpty()) + + updatedAt, err := time.Parse(dbDateLayout, *user.Metadata.UpdatedAt) + Expect(err).Should(BeNil()) + Expect(updatedAt).To(Equal(createdAt)) + }) + }) + When("User is updated via API", func() { + var user model.User + BeforeEach(func() { + createUser(cfg.Port) + time.Sleep(1100 * time.Millisecond) + updateUser(cfg.Port) + user = getUser(cfg.Port) + }) + It("shall assign UpdatedBy and UpdatedAt metadata fields and shall keep nil in DeletedAt metadata field", func() { + Expect(entity.UserType(user.Type)).To(Equal(testUserType)) + Expect(user.Metadata).To(Not(BeNil())) + Expect(*user.Metadata.CreatedBy).To(Equal(testCreatedBy)) + + createdAt, err := time.Parse(dbDateLayout, *user.Metadata.CreatedAt) + Expect(err).Should(BeNil()) + Expect(createdAt).Should(BeTemporally("~", time.Now().UTC(), 3*time.Second)) + + Expect(*user.Metadata.UpdatedBy).To(Equal(testUpdatedBy)) + + updatedAt, err := time.Parse(dbDateLayout, *user.Metadata.UpdatedAt) + Expect(err).Should(BeNil()) + Expect(updatedAt).Should(BeTemporally("~", time.Now().UTC(), 2*time.Second)) + Expect(updatedAt).Should(BeTemporally(">", createdAt)) + }) + }) + +}) diff --git a/internal/entity/activity.go b/internal/entity/activity.go index d637ec6c..356dffbb 100644 --- a/internal/entity/activity.go +++ b/internal/entity/activity.go @@ -34,7 +34,7 @@ var AllActivityStatusValues = []string{ } type Activity struct { - Info + Metadata Id int64 `json:"id"` Status ActivityStatusValue `json:"status"` Service *Service `json:"service,omitempty"` @@ -47,17 +47,17 @@ func (a *Activity) GetId() int64 { } type ActivityHasIssue struct { - Info + Metadata ActivityId int64 `json:"activity_id"` IssueId int64 `json:"issue_id"` } type ActivityAggregations struct { - Info + Metadata } type ActivityFilter struct { - Info + Metadata Paginated Status []*string `json:"status"` ServiceName []*string `json:"service_name"` diff --git a/internal/entity/common.go b/internal/entity/common.go index be47aa81..547d9185 100644 --- a/internal/entity/common.go +++ b/internal/entity/common.go @@ -93,7 +93,7 @@ type ResultList struct { } type ListOptions struct { - Info + Metadata ShowTotalCount bool `json:"show_total_count"` ShowPageInfo bool `json:"show_page_info"` IncludeAggregations bool `json:"include_aggregations"` @@ -108,7 +108,7 @@ func NewListOptions() *ListOptions { } type PageInfo struct { - Info + Metadata HasNextPage *bool `json:"has_next_page,omitempty"` HasPreviousPage *bool `json:"has_previous_page,omitempty"` IsValidPage *bool `json:"is_valid_page,omitempty"` @@ -120,7 +120,7 @@ type PageInfo struct { } type Page struct { - Info + Metadata After *string `json:"after,omitempty"` PageNumber *int `json:"page_number,omitempty"` IsCurrent bool `json:"is_current,omitempty"` @@ -134,13 +134,13 @@ type List[T interface{}] struct { } type TimeFilter struct { - Info + Metadata After time.Time `json:"after"` Before time.Time `json:"before"` } type Paginated struct { - Info + Metadata First *int `json:"first"` After *int64 `json:"from"` } @@ -152,7 +152,7 @@ func MaxPaginated() Paginated { } type Severity struct { - Info + Metadata Value string Score float64 Cvss Cvss @@ -194,14 +194,14 @@ func NewSeverity(url string) Severity { } type Cvss struct { - Info + Metadata Vector string Base *metric.Base Temporal *metric.Temporal Environmental *metric.Environmental } -type Info struct { +type Metadata struct { CreatedAt time.Time `json:"created_at"` CreatedBy string `json:"created_by"` UpdatedAt time.Time `json:"updated_at"` diff --git a/internal/entity/component.go b/internal/entity/component.go index 17efa12a..b10dbe09 100644 --- a/internal/entity/component.go +++ b/internal/entity/component.go @@ -4,7 +4,7 @@ package entity type Component struct { - Info + Metadata Id int64 `json:"id"` Name string `json:"name"` Type string `json:"type"` @@ -17,7 +17,7 @@ type ComponentResult struct { } type ComponentFilter struct { - Info + Metadata Paginated Name []*string `json:"name"` Id []*int64 `json:"id"` @@ -25,4 +25,5 @@ type ComponentFilter struct { } type ComponentAggregations struct { + Metadata } diff --git a/internal/entity/component_instance.go b/internal/entity/component_instance.go index 36fd81f4..5340766e 100644 --- a/internal/entity/component_instance.go +++ b/internal/entity/component_instance.go @@ -4,7 +4,7 @@ package entity type ComponentInstanceFilter struct { - Info + Metadata Paginated IssueMatchId []*int64 `json:"issue_match_id"` ServiceId []*int64 `json:"service_id"` @@ -13,7 +13,7 @@ type ComponentInstanceFilter struct { } type ComponentInstanceAggregations struct { - Info + Metadata } type ComponentInstanceResult struct { @@ -23,7 +23,7 @@ type ComponentInstanceResult struct { } type ComponentInstance struct { - Info + Metadata Id int64 `json:"id"` CCRN string `json:"ccrn"` Count int16 `json:"count"` diff --git a/internal/entity/component_version.go b/internal/entity/component_version.go index 768fcb1d..06cb7fd7 100644 --- a/internal/entity/component_version.go +++ b/internal/entity/component_version.go @@ -4,7 +4,7 @@ package entity type ComponentVersionFilter struct { - Info + Metadata Paginated Id []*int64 `json:"id"` IssueId []*int64 `json:"issue_id"` @@ -13,7 +13,7 @@ type ComponentVersionFilter struct { } type ComponentVersionAggregations struct { - Info + Metadata } type ComponentVersionResult struct { @@ -23,7 +23,7 @@ type ComponentVersionResult struct { } type ComponentVersion struct { - Info + Metadata Id int64 `json:"id"` Version string `json:"version"` Component *Component `json:"component,omitempty"` diff --git a/internal/entity/evidence.go b/internal/entity/evidence.go index a708ef6b..e68f93fb 100644 --- a/internal/entity/evidence.go +++ b/internal/entity/evidence.go @@ -42,7 +42,7 @@ var AllEvidenceTypeValues = []string{ } type Evidence struct { - Info + Metadata Id int64 `json:"id"` Description string `json:"description"` Type EvidenceType `json:"type"` @@ -55,7 +55,7 @@ type Evidence struct { } type EvidenceFilter struct { - Info + Metadata Paginated Id []*int64 `json:"id"` ActivityId []*int64 `json:"activity_id"` @@ -63,7 +63,7 @@ type EvidenceFilter struct { UserId []*int64 `json:"user_id"` } type EvidenceAggregations struct { - Info + Metadata } type EvidenceResult struct { diff --git a/internal/entity/issue.go b/internal/entity/issue.go index 7eb80503..abf3b66e 100644 --- a/internal/entity/issue.go +++ b/internal/entity/issue.go @@ -8,7 +8,7 @@ import ( ) type IssueWithAggregations struct { - Info + Metadata IssueAggregations Issue } @@ -51,7 +51,7 @@ type IssueResult struct { } type IssueFilter struct { - Info + Metadata Paginated PrimaryName []*string `json:"primary_name"` ServiceName []*string `json:"service_name"` @@ -68,7 +68,7 @@ type IssueFilter struct { } type IssueAggregations struct { - Info + Metadata Activites int64 IssueMatches int64 AffectedServices int64 @@ -79,7 +79,7 @@ type IssueAggregations struct { } type Issue struct { - Info + Metadata Id int64 `json:"id"` Type IssueType `json:"type"` PrimaryName string `json:"primary_name"` @@ -91,13 +91,13 @@ type Issue struct { } type IssueCount struct { - Info + Metadata Count int64 `json:"count"` Type IssueType `json:"type"` } type IssueTypeCounts struct { - Info + Metadata VulnerabilityCount int64 `json:"vulnerability_count"` PolicyViolationCount int64 `json:"policy_violation_count"` SecurityEventCount int64 `json:"security_event_count"` diff --git a/internal/entity/issue_match.go b/internal/entity/issue_match.go index e5d95609..8206ad49 100644 --- a/internal/entity/issue_match.go +++ b/internal/entity/issue_match.go @@ -39,7 +39,7 @@ var AllIssueMatchStatusValues = []string{ } type IssueMatch struct { - Info + Metadata Id int64 `json:"id"` Status IssueMatchStatusValue `json:"status"` User *User `json:"user,omitempty"` @@ -55,7 +55,7 @@ type IssueMatch struct { } type IssueMatchFilter struct { - Info + Metadata Paginated Id []*int64 `json:"id"` AffectedServiceName []*string `json:"affected_service_name"` diff --git a/internal/entity/issue_match_change.go b/internal/entity/issue_match_change.go index ea66f9db..69122b36 100644 --- a/internal/entity/issue_match_change.go +++ b/internal/entity/issue_match_change.go @@ -30,7 +30,7 @@ var AllIssueMatchChangeActions = []string{ } type IssueMatchChange struct { - Info + Metadata Id int64 `json:"id"` ActivityId int64 `json:"activity_id"` Activity *Activity @@ -40,7 +40,7 @@ type IssueMatchChange struct { } type IssueMatchChangeFilter struct { - Info + Metadata Paginated Id []*int64 `json:"id"` ActivityId []*int64 `json:"activity_id"` diff --git a/internal/entity/issue_repository.go b/internal/entity/issue_repository.go index 2577d96f..3d259e3e 100644 --- a/internal/entity/issue_repository.go +++ b/internal/entity/issue_repository.go @@ -4,7 +4,7 @@ package entity type BaseIssueRepository struct { - Info + Metadata Id int64 `json:"id"` Name string `json:"name"` Url string `json:"url"` @@ -13,7 +13,7 @@ type BaseIssueRepository struct { } type IssueRepositoryFilter struct { - Info + Metadata Paginated Id []*int64 `json:"id"` ServiceId []*int64 `json:"service_id"` @@ -35,11 +35,11 @@ func NewIssueRepositoryFilter() *IssueRepositoryFilter { } type IssueRepositoryAggregations struct { - Info + Metadata } type IssueRepository struct { - Info + Metadata BaseIssueRepository IssueRepositoryService } diff --git a/internal/entity/issue_repository_service.go b/internal/entity/issue_repository_service.go index 83b40703..5005b841 100644 --- a/internal/entity/issue_repository_service.go +++ b/internal/entity/issue_repository_service.go @@ -4,7 +4,7 @@ package entity type IssueRepositoryService struct { - Info + Metadata ServiceId int64 `json:"service_id"` IssueRepositoryId int64 `json:"issue_repository_id"` Priority int64 `json:"priority"` diff --git a/internal/entity/issue_variant.go b/internal/entity/issue_variant.go index 745ab991..8408894e 100644 --- a/internal/entity/issue_variant.go +++ b/internal/entity/issue_variant.go @@ -4,7 +4,7 @@ package entity type IssueVariant struct { - Info + Metadata Id int64 `json:"id"` IssueRepositoryId int64 `json:"issue_repository_id"` IssueRepository *IssueRepository `json:"issue_repository"` @@ -16,7 +16,7 @@ type IssueVariant struct { } type IssueVariantFilter struct { - Info + Metadata Paginated Id []*int64 `json:"id"` SecondaryName []*string `json:"secondary_name"` @@ -42,7 +42,7 @@ func NewIssueVariantFilter() *IssueVariantFilter { } type IssueVariantAggregations struct { - Info + Metadata } type IssueVariantResult struct { diff --git a/internal/entity/service.go b/internal/entity/service.go index ee62309a..5735bfa3 100644 --- a/internal/entity/service.go +++ b/internal/entity/service.go @@ -4,7 +4,7 @@ package entity type BaseService struct { - Info + Metadata Id int64 `json:"id"` Name string `json:"name"` SupportGroup *SupportGroup `json:"support_group,omitempty"` @@ -15,11 +15,11 @@ type BaseService struct { } type ServiceAggregations struct { - Info + Metadata } type ServiceFilter struct { - Info + Metadata Paginated SupportGroupName []*string `json:"support_group_name"` Id []*int64 `json:"id"` @@ -34,7 +34,7 @@ type ServiceFilter struct { } type Service struct { - Info + Metadata BaseService IssueRepositoryService } diff --git a/internal/entity/severity.go b/internal/entity/severity.go index bc9a7b26..83e88b96 100644 --- a/internal/entity/severity.go +++ b/internal/entity/severity.go @@ -4,7 +4,7 @@ package entity type SeverityFilter struct { - Info + Metadata IssueMatchId []*int64 `json:"issue_match_id"` IssueId []*int64 `json:"issue_id"` } diff --git a/internal/entity/support_group.go b/internal/entity/support_group.go index 7a94d65e..eb307517 100644 --- a/internal/entity/support_group.go +++ b/internal/entity/support_group.go @@ -4,13 +4,13 @@ package entity type SupportGroup struct { - Info + Metadata Id int64 `json:"id"` Name string `json:"name"` } type SupportGroupFilter struct { - Info + Metadata Paginated Id []*int64 `json:"id"` ServiceId []*int64 `json:"service_id"` @@ -19,7 +19,7 @@ type SupportGroupFilter struct { } type SupportGroupAggregations struct { - Info + Metadata } type SupportGroupResult struct { diff --git a/internal/entity/support_group_service.go b/internal/entity/support_group_service.go index af070b4f..b098a564 100644 --- a/internal/entity/support_group_service.go +++ b/internal/entity/support_group_service.go @@ -4,7 +4,7 @@ package entity type SupportGroupService struct { - Info + Metadata SupportGroupId int64 `json:"support_group_id"` ServiceId int64 `json:"service_id"` } diff --git a/internal/entity/support_group_user.go b/internal/entity/support_group_user.go index 2c781add..d811acff 100644 --- a/internal/entity/support_group_user.go +++ b/internal/entity/support_group_user.go @@ -4,7 +4,7 @@ package entity type SupportGroupUser struct { - Info + Metadata SupportGroupId int64 `json:"support_group_id"` UserId int64 `json:"user_id"` } diff --git a/internal/entity/test/activity.go b/internal/entity/test/activity.go index 4df12e1e..da70be19 100644 --- a/internal/entity/test/activity.go +++ b/internal/entity/test/activity.go @@ -15,7 +15,7 @@ func NewFakeActivityEntity() entity.Activity { Issues: nil, Evidences: nil, Service: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/component.go b/internal/entity/test/component.go index fcac3f6b..c11b3f95 100644 --- a/internal/entity/test/component.go +++ b/internal/entity/test/component.go @@ -13,7 +13,7 @@ func NewFakeComponentEntity() entity.Component { Id: int64(gofakeit.Number(1, 10000000)), Name: gofakeit.Name(), Type: gofakeit.Word(), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/component_instance.go b/internal/entity/test/component_instance.go index 12052b5f..d34fc3c4 100644 --- a/internal/entity/test/component_instance.go +++ b/internal/entity/test/component_instance.go @@ -17,7 +17,7 @@ func NewFakeComponentInstanceEntity() entity.ComponentInstance { ComponentVersionId: int64(gofakeit.Number(1, 10000000)), Service: nil, ServiceId: int64(gofakeit.Number(1, 10000000)), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/component_version.go b/internal/entity/test/component_version.go index 97848fdf..07fff6d2 100644 --- a/internal/entity/test/component_version.go +++ b/internal/entity/test/component_version.go @@ -15,7 +15,7 @@ func NewFakeComponentVersionEntity() entity.ComponentVersion { ComponentId: 0, ComponentInstances: nil, Issues: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/evidence.go b/internal/entity/test/evidence.go index 4a1380a8..ea837675 100644 --- a/internal/entity/test/evidence.go +++ b/internal/entity/test/evidence.go @@ -19,7 +19,7 @@ func NewFakeEvidenceEntity() entity.Evidence { RaaEnd: gofakeit.Date(), Type: entity.NewEvidenceTypeValue(t), Severity: severity, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/issue.go b/internal/entity/test/issue.go index a6053737..a2f65147 100644 --- a/internal/entity/test/issue.go +++ b/internal/entity/test/issue.go @@ -22,7 +22,7 @@ func NewFakeIssueEntity() entity.Issue { IssueMatches: nil, ComponentVersions: nil, Activity: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/issue_match.go b/internal/entity/test/issue_match.go index a62ec3a8..45ecfc62 100644 --- a/internal/entity/test/issue_match.go +++ b/internal/entity/test/issue_match.go @@ -25,7 +25,7 @@ func NewFakeIssueMatch() entity.IssueMatch { Issue: nil, RemediationDate: gofakeit.Date(), TargetRemediationDate: gofakeit.Date(), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/issue_match_change.go b/internal/entity/test/issue_match_change.go index 83236092..b706a086 100644 --- a/internal/entity/test/issue_match_change.go +++ b/internal/entity/test/issue_match_change.go @@ -15,7 +15,7 @@ func NewFakeIssueMatchChange() entity.IssueMatchChange { Action: gofakeit.RandomString(actions), IssueMatch: nil, Activity: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/issue_repository.go b/internal/entity/test/issue_repository.go index a3511a01..f0c6ecf4 100644 --- a/internal/entity/test/issue_repository.go +++ b/internal/entity/test/issue_repository.go @@ -14,7 +14,7 @@ func NewFakeIssueRepositoryEntity() entity.IssueRepository { Id: int64(gofakeit.Number(1, 10000000)), Name: gofakeit.Noun(), Url: gofakeit.URL(), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/issue_variant.go b/internal/entity/test/issue_variant.go index 22df8d29..a3c4790e 100644 --- a/internal/entity/test/issue_variant.go +++ b/internal/entity/test/issue_variant.go @@ -21,7 +21,7 @@ func NewFakeIssueVariantEntity() entity.IssueVariant { Issue: nil, IssueRepositoryId: 0, IssueRepository: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/service.go b/internal/entity/test/service.go index 6a6aabb3..1e7cf98c 100644 --- a/internal/entity/test/service.go +++ b/internal/entity/test/service.go @@ -16,7 +16,7 @@ func NewFakeServiceEntity() entity.Service { SupportGroup: nil, Activities: nil, Owners: nil, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/support_group.go b/internal/entity/test/support_group.go index 9a6d6b02..508ff31a 100644 --- a/internal/entity/test/support_group.go +++ b/internal/entity/test/support_group.go @@ -12,7 +12,7 @@ func NewFakeSupportGroupEntity() entity.SupportGroup { return entity.SupportGroup{ Id: int64(gofakeit.Number(1, 10000000)), Name: gofakeit.AppName(), - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/test/user.go b/internal/entity/test/user.go index eb25ce79..0cf39c0e 100644 --- a/internal/entity/test/user.go +++ b/internal/entity/test/user.go @@ -17,7 +17,7 @@ func NewFakeUserEntity() entity.User { Name: gofakeit.Name(), UniqueUserID: uniqueUserId, Type: entity.HumanUserType, - Info: entity.Info{ + Metadata: entity.Metadata{ CreatedAt: gofakeit.Date(), DeletedAt: gofakeit.Date(), UpdatedAt: gofakeit.Date(), diff --git a/internal/entity/user.go b/internal/entity/user.go index 77c7a34f..da53a7ac 100644 --- a/internal/entity/user.go +++ b/internal/entity/user.go @@ -12,7 +12,7 @@ const ( ) type User struct { - Info + Metadata Id int64 `json:"id"` Name string `json:"name"` UniqueUserID string `json:"uniqueUserId"` @@ -20,7 +20,7 @@ type User struct { } type UserFilter struct { - Info + Metadata Paginated Name []*string `json:"name"` UniqueUserID []*string `json:"uniqueUserId"` @@ -31,7 +31,7 @@ type UserFilter struct { } type UserAggregations struct { - Info + Metadata } type UserResult struct { From abcd977fd450d4e6705d19ba30728a4a940be5d6 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Thu, 26 Sep 2024 13:52:47 +0200 Subject: [PATCH 03/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Add metadata for activity, IssueVariant and IssueRepository --- internal/api/graphql/graph/generated.go | 726 ++++++++---------- internal/api/graphql/graph/model/models.go | 21 +- .../api/graphql/graph/model/models_gen.go | 28 +- .../issue/directRelations.graphql | 16 +- .../issueRepository/directRelations.graphql | 22 +- .../issueVariant/directRelations.graphql | 18 +- .../service/directRelations.graphql | 12 +- .../graphql/graph/schema/activity.graphqls | 4 +- .../graph/schema/issue_repository.graphqls | 8 +- .../graph/schema/issue_variant.graphqls | 8 +- internal/app/activity/activity_handler.go | 2 + .../issue_repository_handler.go | 2 + .../issue_variant/issue_variant_handler.go | 2 + internal/database/mariadb/activity.go | 9 +- internal/database/mariadb/entity.go | 29 + internal/database/mariadb/init/schema.sql | 6 + internal/database/mariadb/issue_repository.go | 9 +- internal/database/mariadb/issue_variant.go | 9 +- internal/database/mariadb/user.go | 2 +- 19 files changed, 466 insertions(+), 467 deletions(-) diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index 30881953..f461bdd3 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -67,6 +67,7 @@ type ComplexityRoot struct { ID func(childComplexity int) int IssueMatchChanges func(childComplexity int, filter *model.IssueMatchChangeFilter, first *int, after *string) int Issues func(childComplexity int, filter *model.IssueFilter, first *int, after *string) int + Metadata func(childComplexity int) int Services func(childComplexity int, filter *model.ServiceFilter, first *int, after *string) int Status func(childComplexity int) int } @@ -78,8 +79,9 @@ type ComplexityRoot struct { } ActivityEdge struct { - Cursor func(childComplexity int) int - Node func(childComplexity int) int + Cursor func(childComplexity int) int + Metadata func(childComplexity int) int + Node func(childComplexity int) int } CVSS struct { @@ -317,13 +319,12 @@ type ComplexityRoot struct { } IssueRepository struct { - CreatedAt func(childComplexity int) int ID func(childComplexity int) int IssueVariants func(childComplexity int, filter *model.IssueVariantFilter, first *int, after *string) int + Metadata func(childComplexity int) int Name func(childComplexity int) int Services func(childComplexity int, filter *model.ServiceFilter, first *int, after *string) int URL func(childComplexity int) int - UpdatedAt func(childComplexity int) int } IssueRepositoryConnection struct { @@ -333,24 +334,22 @@ type ComplexityRoot struct { } IssueRepositoryEdge struct { - CreatedAt func(childComplexity int) int - Cursor func(childComplexity int) int - Node func(childComplexity int) int - Priority func(childComplexity int) int - UpdatedAt func(childComplexity int) int + Cursor func(childComplexity int) int + Metadata func(childComplexity int) int + Node func(childComplexity int) int + Priority func(childComplexity int) int } IssueVariant struct { - CreatedAt func(childComplexity int) int Description func(childComplexity int) int ID func(childComplexity int) int Issue func(childComplexity int) int IssueID func(childComplexity int) int IssueRepository func(childComplexity int) int IssueRepositoryID func(childComplexity int) int + Metadata func(childComplexity int) int SecondaryName func(childComplexity int) int Severity func(childComplexity int) int - UpdatedAt func(childComplexity int) int } IssueVariantConnection struct { @@ -360,10 +359,9 @@ type ComplexityRoot struct { } IssueVariantEdge struct { - CreatedAt func(childComplexity int) int - Cursor func(childComplexity int) int - Node func(childComplexity int) int - UpdatedAt func(childComplexity int) int + Cursor func(childComplexity int) int + Metadata func(childComplexity int) int + Node func(childComplexity int) int } Metadata struct { @@ -761,6 +759,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Activity.Issues(childComplexity, args["filter"].(*model.IssueFilter), args["first"].(*int), args["after"].(*string)), true + case "Activity.metadata": + if e.complexity.Activity.Metadata == nil { + break + } + + return e.complexity.Activity.Metadata(childComplexity), true + case "Activity.services": if e.complexity.Activity.Services == nil { break @@ -808,6 +813,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ActivityEdge.Cursor(childComplexity), true + case "ActivityEdge.metadata": + if e.complexity.ActivityEdge.Metadata == nil { + break + } + + return e.complexity.ActivityEdge.Metadata(childComplexity), true + case "ActivityEdge.node": if e.complexity.ActivityEdge.Node == nil { break @@ -1924,13 +1936,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueMetadata.ServiceCount(childComplexity), true - case "IssueRepository.created_at": - if e.complexity.IssueRepository.CreatedAt == nil { - break - } - - return e.complexity.IssueRepository.CreatedAt(childComplexity), true - case "IssueRepository.id": if e.complexity.IssueRepository.ID == nil { break @@ -1950,6 +1955,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueRepository.IssueVariants(childComplexity, args["filter"].(*model.IssueVariantFilter), args["first"].(*int), args["after"].(*string)), true + case "IssueRepository.metadata": + if e.complexity.IssueRepository.Metadata == nil { + break + } + + return e.complexity.IssueRepository.Metadata(childComplexity), true + case "IssueRepository.name": if e.complexity.IssueRepository.Name == nil { break @@ -1976,13 +1988,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueRepository.URL(childComplexity), true - case "IssueRepository.updated_at": - if e.complexity.IssueRepository.UpdatedAt == nil { - break - } - - return e.complexity.IssueRepository.UpdatedAt(childComplexity), true - case "IssueRepositoryConnection.edges": if e.complexity.IssueRepositoryConnection.Edges == nil { break @@ -2004,19 +2009,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueRepositoryConnection.TotalCount(childComplexity), true - case "IssueRepositoryEdge.created_at": - if e.complexity.IssueRepositoryEdge.CreatedAt == nil { + case "IssueRepositoryEdge.cursor": + if e.complexity.IssueRepositoryEdge.Cursor == nil { break } - return e.complexity.IssueRepositoryEdge.CreatedAt(childComplexity), true + return e.complexity.IssueRepositoryEdge.Cursor(childComplexity), true - case "IssueRepositoryEdge.cursor": - if e.complexity.IssueRepositoryEdge.Cursor == nil { + case "IssueRepositoryEdge.metadata": + if e.complexity.IssueRepositoryEdge.Metadata == nil { break } - return e.complexity.IssueRepositoryEdge.Cursor(childComplexity), true + return e.complexity.IssueRepositoryEdge.Metadata(childComplexity), true case "IssueRepositoryEdge.node": if e.complexity.IssueRepositoryEdge.Node == nil { @@ -2032,20 +2037,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueRepositoryEdge.Priority(childComplexity), true - case "IssueRepositoryEdge.updated_at": - if e.complexity.IssueRepositoryEdge.UpdatedAt == nil { - break - } - - return e.complexity.IssueRepositoryEdge.UpdatedAt(childComplexity), true - - case "IssueVariant.created_at": - if e.complexity.IssueVariant.CreatedAt == nil { - break - } - - return e.complexity.IssueVariant.CreatedAt(childComplexity), true - case "IssueVariant.description": if e.complexity.IssueVariant.Description == nil { break @@ -2088,6 +2079,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueVariant.IssueRepositoryID(childComplexity), true + case "IssueVariant.metadata": + if e.complexity.IssueVariant.Metadata == nil { + break + } + + return e.complexity.IssueVariant.Metadata(childComplexity), true + case "IssueVariant.secondaryName": if e.complexity.IssueVariant.SecondaryName == nil { break @@ -2102,13 +2100,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueVariant.Severity(childComplexity), true - case "IssueVariant.updated_at": - if e.complexity.IssueVariant.UpdatedAt == nil { - break - } - - return e.complexity.IssueVariant.UpdatedAt(childComplexity), true - case "IssueVariantConnection.edges": if e.complexity.IssueVariantConnection.Edges == nil { break @@ -2130,13 +2121,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueVariantConnection.TotalCount(childComplexity), true - case "IssueVariantEdge.created_at": - if e.complexity.IssueVariantEdge.CreatedAt == nil { - break - } - - return e.complexity.IssueVariantEdge.CreatedAt(childComplexity), true - case "IssueVariantEdge.cursor": if e.complexity.IssueVariantEdge.Cursor == nil { break @@ -2144,19 +2128,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueVariantEdge.Cursor(childComplexity), true - case "IssueVariantEdge.node": - if e.complexity.IssueVariantEdge.Node == nil { + case "IssueVariantEdge.metadata": + if e.complexity.IssueVariantEdge.Metadata == nil { break } - return e.complexity.IssueVariantEdge.Node(childComplexity), true + return e.complexity.IssueVariantEdge.Metadata(childComplexity), true - case "IssueVariantEdge.updated_at": - if e.complexity.IssueVariantEdge.UpdatedAt == nil { + case "IssueVariantEdge.node": + if e.complexity.IssueVariantEdge.Node == nil { break } - return e.complexity.IssueVariantEdge.UpdatedAt(childComplexity), true + return e.complexity.IssueVariantEdge.Node(childComplexity), true case "Metadata.created_at": if e.complexity.Metadata.CreatedAt == nil { @@ -10261,6 +10245,59 @@ func (ec *executionContext) fieldContext_Activity_issueMatchChanges(ctx context. return fc, nil } +func (ec *executionContext) _Activity_metadata(ctx context.Context, field graphql.CollectedField, obj *model.Activity) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Activity_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Activity_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Activity", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _ActivityConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ActivityConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ActivityConnection_totalCount(ctx, field) if err != nil { @@ -10345,6 +10382,8 @@ func (ec *executionContext) fieldContext_ActivityConnection_edges(_ context.Cont return ec.fieldContext_ActivityEdge_node(ctx, field) case "cursor": return ec.fieldContext_ActivityEdge_cursor(ctx, field) + case "metadata": + return ec.fieldContext_ActivityEdge_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ActivityEdge", field.Name) }, @@ -10458,6 +10497,8 @@ func (ec *executionContext) fieldContext_ActivityEdge_node(_ context.Context, fi return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -10506,6 +10547,59 @@ func (ec *executionContext) fieldContext_ActivityEdge_cursor(_ context.Context, return fc, nil } +func (ec *executionContext) _ActivityEdge_metadata(ctx context.Context, field graphql.CollectedField, obj *model.ActivityEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ActivityEdge_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ActivityEdge_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ActivityEdge", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _CVSS_vector(ctx context.Context, field graphql.CollectedField, obj *model.Cvss) (ret graphql.Marshaler) { fc, err := ec.fieldContext_CVSS_vector(ctx, field) if err != nil { @@ -13924,6 +14018,8 @@ func (ec *executionContext) fieldContext_Evidence_activity(_ context.Context, fi return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -16303,6 +16399,8 @@ func (ec *executionContext) fieldContext_IssueMatchChange_activity(_ context.Con return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -17759,49 +17857,8 @@ func (ec *executionContext) fieldContext_IssueRepository_services(ctx context.Co return fc, nil } -func (ec *executionContext) _IssueRepository_created_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueRepository) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueRepository_created_at(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.CreatedAt, 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.marshalODateTime2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IssueRepository_created_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IssueRepository", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _IssueRepository_updated_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueRepository) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueRepository_updated_at(ctx, field) +func (ec *executionContext) _IssueRepository_metadata(ctx context.Context, field graphql.CollectedField, obj *model.IssueRepository) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IssueRepository_metadata(ctx, field) if err != nil { return graphql.Null } @@ -17814,7 +17871,7 @@ func (ec *executionContext) _IssueRepository_updated_at(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -17823,19 +17880,31 @@ func (ec *executionContext) _IssueRepository_updated_at(ctx context.Context, fie if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Metadata) fc.Result = res - return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IssueRepository_updated_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IssueRepository_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IssueRepository", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil @@ -17927,10 +17996,8 @@ func (ec *executionContext) fieldContext_IssueRepositoryConnection_edges(_ conte return ec.fieldContext_IssueRepositoryEdge_cursor(ctx, field) case "priority": return ec.fieldContext_IssueRepositoryEdge_priority(ctx, field) - case "created_at": - return ec.fieldContext_IssueRepositoryEdge_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueRepositoryEdge_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueRepositoryEdge_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueRepositoryEdge", field.Name) }, @@ -18042,10 +18109,8 @@ func (ec *executionContext) fieldContext_IssueRepositoryEdge_node(_ context.Cont return ec.fieldContext_IssueRepository_issueVariants(ctx, field) case "services": return ec.fieldContext_IssueRepository_services(ctx, field) - case "created_at": - return ec.fieldContext_IssueRepository_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueRepository_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueRepository_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueRepository", field.Name) }, @@ -18135,49 +18200,8 @@ func (ec *executionContext) fieldContext_IssueRepositoryEdge_priority(_ context. return fc, nil } -func (ec *executionContext) _IssueRepositoryEdge_created_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueRepositoryEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueRepositoryEdge_created_at(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.CreatedAt, 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.marshalODateTime2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IssueRepositoryEdge_created_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IssueRepositoryEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _IssueRepositoryEdge_updated_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueRepositoryEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueRepositoryEdge_updated_at(ctx, field) +func (ec *executionContext) _IssueRepositoryEdge_metadata(ctx context.Context, field graphql.CollectedField, obj *model.IssueRepositoryEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IssueRepositoryEdge_metadata(ctx, field) if err != nil { return graphql.Null } @@ -18190,7 +18214,7 @@ func (ec *executionContext) _IssueRepositoryEdge_updated_at(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -18199,19 +18223,31 @@ func (ec *executionContext) _IssueRepositoryEdge_updated_at(ctx context.Context, if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Metadata) fc.Result = res - return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IssueRepositoryEdge_updated_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IssueRepositoryEdge_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IssueRepositoryEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil @@ -18479,10 +18515,8 @@ func (ec *executionContext) fieldContext_IssueVariant_issueRepository(_ context. return ec.fieldContext_IssueRepository_issueVariants(ctx, field) case "services": return ec.fieldContext_IssueRepository_services(ctx, field) - case "created_at": - return ec.fieldContext_IssueRepository_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueRepository_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueRepository_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueRepository", field.Name) }, @@ -18594,8 +18628,8 @@ func (ec *executionContext) fieldContext_IssueVariant_issue(_ context.Context, f return fc, nil } -func (ec *executionContext) _IssueVariant_created_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueVariant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueVariant_created_at(ctx, field) +func (ec *executionContext) _IssueVariant_metadata(ctx context.Context, field graphql.CollectedField, obj *model.IssueVariant) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IssueVariant_metadata(ctx, field) if err != nil { return graphql.Null } @@ -18608,48 +18642,7 @@ func (ec *executionContext) _IssueVariant_created_at(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedAt, 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.marshalODateTime2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IssueVariant_created_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IssueVariant", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _IssueVariant_updated_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueVariant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueVariant_updated_at(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.UpdatedAt, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -18658,19 +18651,31 @@ func (ec *executionContext) _IssueVariant_updated_at(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Metadata) fc.Result = res - return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IssueVariant_updated_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IssueVariant_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IssueVariant", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil @@ -18760,10 +18765,8 @@ func (ec *executionContext) fieldContext_IssueVariantConnection_edges(_ context. return ec.fieldContext_IssueVariantEdge_node(ctx, field) case "cursor": return ec.fieldContext_IssueVariantEdge_cursor(ctx, field) - case "created_at": - return ec.fieldContext_IssueVariantEdge_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueVariantEdge_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueVariantEdge_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueVariantEdge", field.Name) }, @@ -18881,10 +18884,8 @@ func (ec *executionContext) fieldContext_IssueVariantEdge_node(_ context.Context return ec.fieldContext_IssueVariant_issueId(ctx, field) case "issue": return ec.fieldContext_IssueVariant_issue(ctx, field) - case "created_at": - return ec.fieldContext_IssueVariant_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueVariant_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueVariant_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueVariant", field.Name) }, @@ -18933,49 +18934,8 @@ func (ec *executionContext) fieldContext_IssueVariantEdge_cursor(_ context.Conte return fc, nil } -func (ec *executionContext) _IssueVariantEdge_created_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueVariantEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueVariantEdge_created_at(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.CreatedAt, 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.marshalODateTime2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IssueVariantEdge_created_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IssueVariantEdge", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _IssueVariantEdge_updated_at(ctx context.Context, field graphql.CollectedField, obj *model.IssueVariantEdge) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IssueVariantEdge_updated_at(ctx, field) +func (ec *executionContext) _IssueVariantEdge_metadata(ctx context.Context, field graphql.CollectedField, obj *model.IssueVariantEdge) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IssueVariantEdge_metadata(ctx, field) if err != nil { return graphql.Null } @@ -18988,7 +18948,7 @@ func (ec *executionContext) _IssueVariantEdge_updated_at(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -18997,19 +18957,31 @@ func (ec *executionContext) _IssueVariantEdge_updated_at(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Metadata) fc.Result = res - return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_IssueVariantEdge_updated_at(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_IssueVariantEdge_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "IssueVariantEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil @@ -20979,10 +20951,8 @@ func (ec *executionContext) fieldContext_Mutation_createIssueRepository(ctx cont return ec.fieldContext_IssueRepository_issueVariants(ctx, field) case "services": return ec.fieldContext_IssueRepository_services(ctx, field) - case "created_at": - return ec.fieldContext_IssueRepository_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueRepository_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueRepository_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueRepository", field.Name) }, @@ -21050,10 +21020,8 @@ func (ec *executionContext) fieldContext_Mutation_updateIssueRepository(ctx cont return ec.fieldContext_IssueRepository_issueVariants(ctx, field) case "services": return ec.fieldContext_IssueRepository_services(ctx, field) - case "created_at": - return ec.fieldContext_IssueRepository_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueRepository_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueRepository_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueRepository", field.Name) }, @@ -21545,10 +21513,8 @@ func (ec *executionContext) fieldContext_Mutation_createIssueVariant(ctx context return ec.fieldContext_IssueVariant_issueId(ctx, field) case "issue": return ec.fieldContext_IssueVariant_issue(ctx, field) - case "created_at": - return ec.fieldContext_IssueVariant_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueVariant_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueVariant_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueVariant", field.Name) }, @@ -21622,10 +21588,8 @@ func (ec *executionContext) fieldContext_Mutation_updateIssueVariant(ctx context return ec.fieldContext_IssueVariant_issueId(ctx, field) case "issue": return ec.fieldContext_IssueVariant_issue(ctx, field) - case "created_at": - return ec.fieldContext_IssueVariant_created_at(ctx, field) - case "updated_at": - return ec.fieldContext_IssueVariant_updated_at(ctx, field) + case "metadata": + return ec.fieldContext_IssueVariant_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueVariant", field.Name) }, @@ -22555,6 +22519,8 @@ func (ec *executionContext) fieldContext_Mutation_createActivity(ctx context.Con return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -22624,6 +22590,8 @@ func (ec *executionContext) fieldContext_Mutation_updateActivity(ctx context.Con return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -22748,6 +22716,8 @@ func (ec *executionContext) fieldContext_Mutation_addServiceToActivity(ctx conte return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -22817,6 +22787,8 @@ func (ec *executionContext) fieldContext_Mutation_removeServiceFromActivity(ctx return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -22886,6 +22858,8 @@ func (ec *executionContext) fieldContext_Mutation_addIssueToActivity(ctx context return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -22955,6 +22929,8 @@ func (ec *executionContext) fieldContext_Mutation_removeIssueFromActivity(ctx co return ec.fieldContext_Activity_evidences(ctx, field) case "issueMatchChanges": return ec.fieldContext_Activity_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_Activity_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Activity", field.Name) }, @@ -30088,6 +30064,28 @@ func (ec *executionContext) _Activity(ctx context.Context, sel ast.SelectionSet, continue } out.Values[i] = ec._Activity_issueMatchChanges(ctx, field, obj) + case "metadata": + field := field + + 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 ec._Activity_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Activity_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -30272,6 +30270,28 @@ func (ec *executionContext) _ActivityEdge(ctx context.Context, sel ast.Selection continue } out.Values[i] = ec._ActivityEdge_cursor(ctx, field, obj) + case "metadata": + field := field + + 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 ec._ActivityEdge_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ActivityEdge_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -34753,29 +34773,7 @@ func (ec *executionContext) _IssueRepository(ctx context.Context, sel ast.Select continue } out.Values[i] = ec._IssueRepository_services(ctx, field, obj) - case "created_at": - field := field - - 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 ec._IssueRepository_created_at(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - out.Values[i] = ec._IssueRepository_created_at(ctx, field, obj) - case "updated_at": + case "metadata": field := field if field.Deferrable != nil { @@ -34789,14 +34787,14 @@ func (ec *executionContext) _IssueRepository(ctx context.Context, sel ast.Select deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._IssueRepository_updated_at(ctx, field, obj) + return ec._IssueRepository_metadata(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } - out.Values[i] = ec._IssueRepository_updated_at(ctx, field, obj) + out.Values[i] = ec._IssueRepository_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -35003,29 +35001,7 @@ func (ec *executionContext) _IssueRepositoryEdge(ctx context.Context, sel ast.Se continue } out.Values[i] = ec._IssueRepositoryEdge_priority(ctx, field, obj) - case "created_at": - field := field - - 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 ec._IssueRepositoryEdge_created_at(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - out.Values[i] = ec._IssueRepositoryEdge_created_at(ctx, field, obj) - case "updated_at": + case "metadata": field := field if field.Deferrable != nil { @@ -35039,14 +35015,14 @@ func (ec *executionContext) _IssueRepositoryEdge(ctx context.Context, sel ast.Se deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._IssueRepositoryEdge_updated_at(ctx, field, obj) + return ec._IssueRepositoryEdge_metadata(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } - out.Values[i] = ec._IssueRepositoryEdge_updated_at(ctx, field, obj) + out.Values[i] = ec._IssueRepositoryEdge_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -35260,29 +35236,7 @@ func (ec *executionContext) _IssueVariant(ctx context.Context, sel ast.Selection continue } out.Values[i] = ec._IssueVariant_issue(ctx, field, obj) - case "created_at": - field := field - - 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 ec._IssueVariant_created_at(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - out.Values[i] = ec._IssueVariant_created_at(ctx, field, obj) - case "updated_at": + case "metadata": field := field if field.Deferrable != nil { @@ -35296,14 +35250,14 @@ func (ec *executionContext) _IssueVariant(ctx context.Context, sel ast.Selection deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._IssueVariant_updated_at(ctx, field, obj) + return ec._IssueVariant_metadata(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } - out.Values[i] = ec._IssueVariant_updated_at(ctx, field, obj) + out.Values[i] = ec._IssueVariant_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -35488,29 +35442,7 @@ func (ec *executionContext) _IssueVariantEdge(ctx context.Context, sel ast.Selec continue } out.Values[i] = ec._IssueVariantEdge_cursor(ctx, field, obj) - case "created_at": - field := field - - 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 ec._IssueVariantEdge_created_at(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - out.Values[i] = ec._IssueVariantEdge_created_at(ctx, field, obj) - case "updated_at": + case "metadata": field := field if field.Deferrable != nil { @@ -35524,14 +35456,14 @@ func (ec *executionContext) _IssueVariantEdge(ctx context.Context, sel ast.Selec deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._IssueVariantEdge_updated_at(ctx, field, obj) + return ec._IssueVariantEdge_metadata(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } - out.Values[i] = ec._IssueVariantEdge_updated_at(ctx, field, obj) + out.Values[i] = ec._IssueVariantEdge_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index e66b693c..cf35f5b2 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -259,16 +259,13 @@ func NewIssueMatchChangeEntity(imc *IssueMatchChangeInput) entity.IssueMatchChan } func NewIssueRepository(repo *entity.IssueRepository) IssueRepository { - createdAt := repo.BaseIssueRepository.CreatedAt.String() - updatedAt := repo.BaseIssueRepository.UpdatedAt.String() return IssueRepository{ ID: fmt.Sprintf("%d", repo.Id), Name: &repo.Name, URL: &repo.Url, Services: nil, IssueVariants: nil, - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, + Metadata: getModelMetadata(repo.Metadata), } } @@ -286,8 +283,6 @@ func NewIssueVariant(issueVariant *entity.IssueVariant) IssueVariant { if issueVariant.IssueRepository != nil { repo = NewIssueRepository(issueVariant.IssueRepository) } - createdAt := issueVariant.CreatedAt.String() - updatedAt := issueVariant.UpdatedAt.String() return IssueVariant{ ID: fmt.Sprintf("%d", issueVariant.Id), SecondaryName: &issueVariant.SecondaryName, @@ -296,20 +291,16 @@ func NewIssueVariant(issueVariant *entity.IssueVariant) IssueVariant { IssueID: util.Ptr(fmt.Sprintf("%d", issueVariant.IssueId)), IssueRepositoryID: util.Ptr(fmt.Sprintf("%d", issueVariant.IssueRepositoryId)), IssueRepository: &repo, - CreatedAt: &createdAt, - UpdatedAt: &updatedAt, + Metadata: getModelMetadata(issueVariant.Metadata), } } func NewIssueVariantEdge(issueVariant *entity.IssueVariant) IssueVariantEdge { iv := NewIssueVariant(issueVariant) - edgeCreationDate := issueVariant.CreatedAt.String() - edgeUpdateDate := issueVariant.UpdatedAt.String() issueVariantEdge := IssueVariantEdge{ Node: &iv, Cursor: &iv.ID, - CreatedAt: &edgeCreationDate, - UpdatedAt: &edgeUpdateDate, + Metadata: getModelMetadata(issueVariant.Metadata), } return issueVariantEdge } @@ -375,9 +366,9 @@ func NewSupportGroupEntity(supportGroup *SupportGroupInput) entity.SupportGroup func NewActivity(activity *entity.Activity) Activity { status := ActivityStatusValues(activity.Status.String()) return Activity{ - ID: fmt.Sprintf("%d", activity.Id), - Status: &status, - //Metadata: activity.getModelMetadata(activitiy), + ID: fmt.Sprintf("%d", activity.Id), + Status: &status, + Metadata: getModelMetadata(activity.Metadata), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index 2557d136..b47a0df9 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -32,6 +32,7 @@ type Activity struct { Issues *IssueConnection `json:"issues,omitempty"` Evidences *EvidenceConnection `json:"evidences,omitempty"` IssueMatchChanges *IssueMatchChangeConnection `json:"issueMatchChanges,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (Activity) IsNode() {} @@ -48,8 +49,9 @@ func (this ActivityConnection) GetTotalCount() int { return this.TotalCount func (this ActivityConnection) GetPageInfo() *PageInfo { return this.PageInfo } type ActivityEdge struct { - Node *Activity `json:"node"` - Cursor *string `json:"cursor,omitempty"` + Node *Activity `json:"node"` + Cursor *string `json:"cursor,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (ActivityEdge) IsEdge() {} @@ -477,8 +479,7 @@ type IssueRepository struct { URL *string `json:"url,omitempty"` IssueVariants *IssueVariantConnection `json:"issueVariants,omitempty"` Services *ServiceConnection `json:"services,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (IssueRepository) IsNode() {} @@ -495,11 +496,10 @@ func (this IssueRepositoryConnection) GetTotalCount() int { return this.Tota func (this IssueRepositoryConnection) GetPageInfo() *PageInfo { return this.PageInfo } type IssueRepositoryEdge struct { - Node *IssueRepository `json:"node"` - Cursor *string `json:"cursor,omitempty"` - Priority *int `json:"priority,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + Node *IssueRepository `json:"node"` + Cursor *string `json:"cursor,omitempty"` + Priority *int `json:"priority,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (IssueRepositoryEdge) IsEdge() {} @@ -526,8 +526,7 @@ type IssueVariant struct { IssueRepository *IssueRepository `json:"issueRepository,omitempty"` IssueID *string `json:"issueId,omitempty"` Issue *Issue `json:"issue,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (IssueVariant) IsNode() {} @@ -544,10 +543,9 @@ func (this IssueVariantConnection) GetTotalCount() int { return this.TotalCo func (this IssueVariantConnection) GetPageInfo() *PageInfo { return this.PageInfo } type IssueVariantEdge struct { - Node *IssueVariant `json:"node"` - Cursor *string `json:"cursor,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - UpdatedAt *string `json:"updated_at,omitempty"` + Node *IssueVariant `json:"node"` + Cursor *string `json:"cursor,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (IssueVariantEdge) IsEdge() {} diff --git a/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql b/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql index 31c599d7..20b394fe 100644 --- a/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql +++ b/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql @@ -33,16 +33,22 @@ query ($filter: IssueFilter, $first: Int, $after: String) { id name url + metadata { + created_at + updated_at + } + } + issueId + metadata { created_at updated_at } - issueId + } + cursor + metadata { created_at updated_at } - cursor - created_at - updated_at } pageInfo { hasNextPage @@ -98,4 +104,4 @@ query ($filter: IssueFilter, $first: Int, $after: String) { } } } -} \ No newline at end of file +} diff --git a/internal/api/graphql/graph/queryCollection/issueRepository/directRelations.graphql b/internal/api/graphql/graph/queryCollection/issueRepository/directRelations.graphql index 259d50d3..31e87718 100644 --- a/internal/api/graphql/graph/queryCollection/issueRepository/directRelations.graphql +++ b/internal/api/graphql/graph/queryCollection/issueRepository/directRelations.graphql @@ -23,12 +23,16 @@ query ($filter: IssueRepositoryFilter, $first: Int, $after: String) { description issueRepositoryId issueId + metadata { + created_at + updated_at + } + } + cursor + metadata { created_at updated_at } - cursor - created_at - updated_at } pageInfo { hasNextPage @@ -50,12 +54,16 @@ query ($filter: IssueRepositoryFilter, $first: Int, $after: String) { nextPageAfter } } + metadata { + created_at + updated_at + } + } + cursor + metadata { created_at updated_at } - cursor - created_at - updated_at } pageInfo { hasNextPage @@ -71,4 +79,4 @@ query ($filter: IssueRepositoryFilter, $first: Int, $after: String) { } } } -} \ No newline at end of file +} diff --git a/internal/api/graphql/graph/queryCollection/issueVariant/directRelations.graphql b/internal/api/graphql/graph/queryCollection/issueVariant/directRelations.graphql index f2402acd..a9c1bae3 100644 --- a/internal/api/graphql/graph/queryCollection/issueVariant/directRelations.graphql +++ b/internal/api/graphql/graph/queryCollection/issueVariant/directRelations.graphql @@ -23,20 +23,26 @@ query ($filter: IssueVariantFilter, $first: Int, $after: String) { id name url - created_at - updated_at + metadata { + created_at + updated_at + } } issueId issue { id lastModified } + metadata { + created_at + updated_at + } + } + cursor + metadata { created_at updated_at } - cursor - created_at - updated_at } pageInfo { hasNextPage @@ -52,4 +58,4 @@ query ($filter: IssueVariantFilter, $first: Int, $after: String) { } } } -} \ No newline at end of file +} diff --git a/internal/api/graphql/graph/queryCollection/service/directRelations.graphql b/internal/api/graphql/graph/queryCollection/service/directRelations.graphql index 16e131dc..9587f956 100644 --- a/internal/api/graphql/graph/queryCollection/service/directRelations.graphql +++ b/internal/api/graphql/graph/queryCollection/service/directRelations.graphql @@ -63,13 +63,17 @@ query ($filter: ServiceFilter, $first: Int, $after: String) { id name url - created_at - updated_at + metadata { + created_at + updated_at + } } cursor priority - created_at - updated_at + metadata { + created_at + updated_at + } } pageInfo { hasNextPage diff --git a/internal/api/graphql/graph/schema/activity.graphqls b/internal/api/graphql/graph/schema/activity.graphqls index b7ccc630..2ebe53b2 100644 --- a/internal/api/graphql/graph/schema/activity.graphqls +++ b/internal/api/graphql/graph/schema/activity.graphqls @@ -8,6 +8,7 @@ type Activity implements Node { issues(filter: IssueFilter, first: Int, after: String): IssueConnection evidences(filter: EvidenceFilter, first: Int, after: String): EvidenceConnection issueMatchChanges(filter: IssueMatchChangeFilter, first: Int, after: String): IssueMatchChangeConnection + metadata: Metadata } input ActivityInput { @@ -23,6 +24,7 @@ type ActivityConnection implements Connection { type ActivityEdge implements Edge { node: Activity! cursor: String + metadata: Metadata } input ActivityFilter { @@ -34,4 +36,4 @@ enum ActivityStatusValues { open, closed, in_progress -} \ No newline at end of file +} diff --git a/internal/api/graphql/graph/schema/issue_repository.graphqls b/internal/api/graphql/graph/schema/issue_repository.graphqls index a85967a7..69756b22 100644 --- a/internal/api/graphql/graph/schema/issue_repository.graphqls +++ b/internal/api/graphql/graph/schema/issue_repository.graphqls @@ -7,8 +7,7 @@ type IssueRepository implements Node { url: String issueVariants(filter: IssueVariantFilter, first: Int, after: String): IssueVariantConnection services(filter: ServiceFilter, first: Int, after: String): ServiceConnection - created_at: DateTime - updated_at: DateTime + metadata: Metadata } input IssueRepositoryInput { @@ -26,12 +25,11 @@ type IssueRepositoryEdge implements Edge { node: IssueRepository! cursor: String priority: Int - created_at: DateTime - updated_at: DateTime + metadata: Metadata } input IssueRepositoryFilter { serviceName: [String] serviceId: [String] name: [String] -} \ No newline at end of file +} diff --git a/internal/api/graphql/graph/schema/issue_variant.graphqls b/internal/api/graphql/graph/schema/issue_variant.graphqls index f6ffc280..36d1d9be 100644 --- a/internal/api/graphql/graph/schema/issue_variant.graphqls +++ b/internal/api/graphql/graph/schema/issue_variant.graphqls @@ -10,8 +10,7 @@ type IssueVariant implements Node { issueRepository: IssueRepository issueId: String issue: Issue - created_at: DateTime - updated_at: DateTime + metadata: Metadata } input IssueVariantInput { @@ -31,10 +30,9 @@ type IssueVariantConnection implements Connection { type IssueVariantEdge implements Edge { node: IssueVariant! cursor: String - created_at: DateTime - updated_at: DateTime + metadata: Metadata } input IssueVariantFilter { secondaryName: [String] -} \ No newline at end of file +} diff --git a/internal/app/activity/activity_handler.go b/internal/app/activity/activity_handler.go index b85dd821..bccec92d 100644 --- a/internal/app/activity/activity_handler.go +++ b/internal/app/activity/activity_handler.go @@ -132,6 +132,7 @@ func (a *activityHandler) ListActivities(filter *entity.ActivityFilter, options } func (a *activityHandler) CreateActivity(activity *entity.Activity) (*entity.Activity, error) { + activity.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": ActivityCreateEventName, "object": activity, @@ -152,6 +153,7 @@ func (a *activityHandler) CreateActivity(activity *entity.Activity) (*entity.Act } func (a *activityHandler) UpdateActivity(activity *entity.Activity) (*entity.Activity, error) { + activity.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": ActivityUpdateEventName, "object": activity, diff --git a/internal/app/issue_repository/issue_repository_handler.go b/internal/app/issue_repository/issue_repository_handler.go index bc38f1b7..27f7562d 100644 --- a/internal/app/issue_repository/issue_repository_handler.go +++ b/internal/app/issue_repository/issue_repository_handler.go @@ -102,6 +102,7 @@ func (ir *issueRepositoryHandler) ListIssueRepositories(filter *entity.IssueRepo } func (ir *issueRepositoryHandler) CreateIssueRepository(issueRepository *entity.IssueRepository) (*entity.IssueRepository, error) { + issueRepository.CreatedBy = "Creator" f := &entity.IssueRepositoryFilter{ Name: []*string{&issueRepository.Name}, } @@ -137,6 +138,7 @@ func (ir *issueRepositoryHandler) CreateIssueRepository(issueRepository *entity. } func (ir *issueRepositoryHandler) UpdateIssueRepository(issueRepository *entity.IssueRepository) (*entity.IssueRepository, error) { + issueRepository.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueRepositoryEventName, "object": issueRepository, diff --git a/internal/app/issue_variant/issue_variant_handler.go b/internal/app/issue_variant/issue_variant_handler.go index 6ac751e8..3e7f2cd0 100644 --- a/internal/app/issue_variant/issue_variant_handler.go +++ b/internal/app/issue_variant/issue_variant_handler.go @@ -168,6 +168,7 @@ func (iv *issueVariantHandler) ListEffectiveIssueVariants(filter *entity.IssueVa } func (iv *issueVariantHandler) CreateIssueVariant(issueVariant *entity.IssueVariant) (*entity.IssueVariant, error) { + issueVariant.CreatedBy = "Creator" f := &entity.IssueVariantFilter{ SecondaryName: []*string{&issueVariant.SecondaryName}, } @@ -203,6 +204,7 @@ func (iv *issueVariantHandler) CreateIssueVariant(issueVariant *entity.IssueVari } func (iv *issueVariantHandler) UpdateIssueVariant(issueVariant *entity.IssueVariant) (*entity.IssueVariant, error) { + issueVariant.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueVariantEventName, "object": issueVariant, diff --git a/internal/database/mariadb/activity.go b/internal/database/mariadb/activity.go index 681f0543..e5bd8aee 100644 --- a/internal/database/mariadb/activity.go +++ b/internal/database/mariadb/activity.go @@ -68,6 +68,9 @@ func (s *SqlDatabase) getActivityUpdateFields(activity *entity.Activity) string if activity.Status != "" { fl = append(fl, "activity_status = :activity_status") } + if activity.UpdatedBy != "" { + fl = append(fl, "activity_updated_by = :activity_updated_by") + } return strings.Join(fl, ", ") } @@ -208,9 +211,11 @@ func (s *SqlDatabase) CreateActivity(activity *entity.Activity) (*entity.Activit query := ` INSERT INTO Activity ( - activity_status + activity_status, + activity_created_by ) VALUES ( - :activity_status + :activity_status, + :activity_created_by ) ` diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index 2e802693..e0870777 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -1,6 +1,10 @@ // SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors // SPDX-License-Identifier: Apache-2.0 +//TODO: add Metadata type for mariadb package +//TODO: add Metadata converter mariadb - entity +//TODO: add Metadata converter entity - mariadb + package mariadb import ( @@ -247,8 +251,10 @@ type BaseIssueRepositoryRow struct { Name sql.NullString `db:"issuerepository_name"` Url sql.NullString `db:"issuerepository_url"` CreatedAt sql.NullTime `db:"issuerepository_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"issuerepository_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuerepository_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuerepository_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"issuerepository_updated_by" json:"updated_by"` } func (irr *IssueRepositoryRow) FromIssueRepository(ir *entity.IssueRepository) { @@ -258,6 +264,11 @@ func (irr *IssueRepositoryRow) FromIssueRepository(ir *entity.IssueRepository) { irr.Priority = sql.NullInt64{Int64: ir.Priority, Valid: true} irr.ServiceId = sql.NullInt64{Int64: ir.ServiceId, Valid: true} irr.IssueRepositoryId = sql.NullInt64{Int64: ir.IssueRepositoryId, Valid: true} + irr.BaseIssueRepositoryRow.CreatedAt = sql.NullTime{Time: ir.CreatedAt, Valid: true} + irr.BaseIssueRepositoryRow.CreatedBy = sql.NullString{String: ir.CreatedBy, Valid: true} + irr.BaseIssueRepositoryRow.DeletedAt = sql.NullTime{Time: ir.DeletedAt, Valid: true} + irr.BaseIssueRepositoryRow.UpdatedAt = sql.NullTime{Time: ir.UpdatedAt, Valid: true} + irr.BaseIssueRepositoryRow.UpdatedBy = sql.NullString{String: ir.UpdatedBy, Valid: true} } func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepository { @@ -269,8 +280,10 @@ func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepo Services: nil, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(birr.CreatedAt), + CreatedBy: GetStringValue(birr.CreatedBy), DeletedAt: GetTimeValue(birr.DeletedAt), UpdatedAt: GetTimeValue(birr.UpdatedAt), + UpdatedBy: GetStringValue(birr.UpdatedBy), }, } } @@ -285,8 +298,10 @@ func (barr *BaseIssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Services: nil, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(barr.CreatedAt), + CreatedBy: GetStringValue(barr.CreatedBy), DeletedAt: GetTimeValue(barr.DeletedAt), UpdatedAt: GetTimeValue(barr.UpdatedAt), + UpdatedBy: GetStringValue(barr.UpdatedBy), }, }, } @@ -302,8 +317,10 @@ func (irr *IssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Services: nil, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.CreatedAt), + CreatedBy: GetStringValue(irr.BaseIssueRepositoryRow.CreatedBy), DeletedAt: GetTimeValue(irr.BaseIssueRepositoryRow.DeletedAt), UpdatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.UpdatedAt), + UpdatedBy: GetStringValue(irr.BaseIssueRepositoryRow.UpdatedBy), }, }, IssueRepositoryService: entity.IssueRepositoryService{ @@ -322,8 +339,10 @@ type IssueVariantRow struct { Rating sql.NullString `db:"issuevariant_rating" json:"rating"` Description sql.NullString `db:"issuevariant_description" json:"description"` CreatedAt sql.NullTime `db:"issuevariant_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"issuevariant_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuevariant_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuevariant_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"issuevariant_updated_by" json:"updated_by"` } func (ivr *IssueVariantRow) AsIssueVariant(repository *entity.IssueRepository) entity.IssueVariant { @@ -338,8 +357,10 @@ func (ivr *IssueVariantRow) AsIssueVariant(repository *entity.IssueRepository) e Description: GetStringValue(ivr.Description), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ivr.CreatedAt), + CreatedBy: GetStringValue(ivr.CreatedBy), DeletedAt: GetTimeValue(ivr.DeletedAt), UpdatedAt: GetTimeValue(ivr.UpdatedAt), + UpdatedBy: GetStringValue(ivr.UpdatedBy), }, } } @@ -353,8 +374,10 @@ func (ivr *IssueVariantRow) FromIssueVariant(iv *entity.IssueVariant) { ivr.Rating = sql.NullString{String: iv.Severity.Value, Valid: true} ivr.Description = sql.NullString{String: iv.Description, Valid: true} ivr.CreatedAt = sql.NullTime{Time: iv.CreatedAt, Valid: true} + ivr.CreatedBy = sql.NullString{String: iv.CreatedBy, Valid: true} ivr.DeletedAt = sql.NullTime{Time: iv.DeletedAt, Valid: true} ivr.UpdatedAt = sql.NullTime{Time: iv.UpdatedAt, Valid: true} + ivr.UpdatedBy = sql.NullString{String: iv.UpdatedBy, Valid: true} } type IssueVariantWithRepository struct { @@ -537,8 +560,10 @@ type ActivityRow struct { Id sql.NullInt64 `db:"activity_id" json:"id"` Status sql.NullString `db:"activity_status" json:"status"` CreatedAt sql.NullTime `db:"activity_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"activity_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"activity_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"activity_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"activity_updated_by" json:"updated_by"` } func (ar *ActivityRow) AsActivity() entity.Activity { @@ -549,8 +574,10 @@ func (ar *ActivityRow) AsActivity() entity.Activity { Evidences: []entity.Evidence{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ar.CreatedAt), + CreatedBy: GetStringValue(ar.CreatedBy), DeletedAt: GetTimeValue(ar.DeletedAt), UpdatedAt: GetTimeValue(ar.UpdatedAt), + UpdatedBy: GetStringValue(ar.UpdatedBy), }, } } @@ -559,8 +586,10 @@ func (ar *ActivityRow) FromActivity(a *entity.Activity) { ar.Id = sql.NullInt64{Int64: a.Id, Valid: true} ar.Status = sql.NullString{String: a.Status.String(), Valid: true} ar.CreatedAt = sql.NullTime{Time: a.CreatedAt, Valid: true} + ar.CreatedBy = sql.NullString{String: a.CreatedBy, Valid: true} ar.DeletedAt = sql.NullTime{Time: a.DeletedAt, Valid: true} ar.UpdatedAt = sql.NullTime{Time: a.UpdatedAt, Valid: true} + ar.UpdatedBy = sql.NullString{String: a.UpdatedBy, Valid: true} } type ComponentInstanceRow struct { diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index c8a82d9d..9a91c794 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -88,8 +88,10 @@ create table if not exists Activity primary key, activity_status enum('open','closed','in_progress') not null, activity_created_at timestamp default current_timestamp() not null, + activity_created_by varchar(256) null, activity_deleted_at timestamp null, activity_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + activity_updated_by varchar(256) null, constraint id_UNIQUE unique (activity_id) ); @@ -201,9 +203,11 @@ create table if not exists IssueRepository issuerepository_id int unsigned auto_increment primary key, issuerepository_name varchar(2048) not null, issuerepository_url varchar(2048) not null, + issuerepository_created_by varchar(256) null, issuerepository_created_at timestamp default current_timestamp() not null, issuerepository_deleted_at timestamp null, issuerepository_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + issuerepository_updated_by varchar(256) null, constraint id_UNIQUE unique (issuerepository_id), constraint name_UNIQUE @@ -237,8 +241,10 @@ create table if not exists IssueVariant issuevariant_secondary_name varchar(256) not null, issuevariant_description longtext not null, issuevariant_created_at timestamp default current_timestamp() not null, + issuevariant_created_by varchar(256) null, issuevariant_deleted_at timestamp null, issuevariant_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + issuevariant_updated_by varchar(256) null, constraint id_UNIQUE unique (issuevariant_id), constraint name_UNIQUE diff --git a/internal/database/mariadb/issue_repository.go b/internal/database/mariadb/issue_repository.go index 431d4735..89e2943c 100644 --- a/internal/database/mariadb/issue_repository.go +++ b/internal/database/mariadb/issue_repository.go @@ -46,6 +46,9 @@ func (s *SqlDatabase) getIssueRepositoryUpdateFields(issueRepository *entity.Iss if issueRepository.Url != "" { fl = append(fl, "issuerepository_url = :issuerepository_url") } + if issueRepository.UpdatedBy != "" { + fl = append(fl, "issuerepository_updated_by = :issuerepository_updated_by") + } return strings.Join(fl, ", ") } @@ -218,10 +221,12 @@ func (s *SqlDatabase) CreateIssueRepository(issueRepository *entity.IssueReposit query := ` INSERT INTO IssueRepository ( issuerepository_name, - issuerepository_url + issuerepository_url, + issuerepository_created_by ) VALUES ( :issuerepository_name, - :issuerepository_url + :issuerepository_url, + :issuerepository_created_by ) ` diff --git a/internal/database/mariadb/issue_variant.go b/internal/database/mariadb/issue_variant.go index 651a28e7..bec8ecec 100644 --- a/internal/database/mariadb/issue_variant.go +++ b/internal/database/mariadb/issue_variant.go @@ -96,6 +96,9 @@ func (s *SqlDatabase) getIssueVariantUpdateFields(issueVariant *entity.IssueVari if issueVariant.IssueRepositoryId != 0 { fl = append(fl, "issuevariant_repository_id = :issuevariant_repository_id") } + if issueVariant.UpdatedBy != "" { + fl = append(fl, "issuevariant_updated_by = :issuevariant_updated_by") + } return strings.Join(fl, ", ") } @@ -242,14 +245,16 @@ func (s *SqlDatabase) CreateIssueVariant(issueVariant *entity.IssueVariant) (*en issuevariant_vector, issuevariant_rating, issuevariant_secondary_name, - issuevariant_description + issuevariant_description, + issuevariant_created_by ) VALUES ( :issuevariant_issue_id, :issuevariant_repository_id, :issuevariant_vector, :issuevariant_rating, :issuevariant_secondary_name, - :issuevariant_description + :issuevariant_description, + :issuevariant_created_by ) ` diff --git a/internal/database/mariadb/user.go b/internal/database/mariadb/user.go index 86fd3127..f5405dcd 100644 --- a/internal/database/mariadb/user.go +++ b/internal/database/mariadb/user.go @@ -62,7 +62,7 @@ func (s *SqlDatabase) getUserUpdateFields(user *entity.User) string { if user.Type != entity.InvalidUserType { fl = append(fl, "user_type = :user_type") } - if user.Metadata.UpdatedBy != "" { + if user.UpdatedBy != "" { fl = append(fl, "user_updated_by = :user_updated_by") } From d6d569856c0019b2123f45ca17fc6e2a3c5e15e4 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Tue, 1 Oct 2024 12:01:54 +0200 Subject: [PATCH 04/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Add metadata for component --- internal/api/graphql/graph/generated.go | 91 +++++++++++++++++++ internal/api/graphql/graph/model/models.go | 7 +- .../api/graphql/graph/model/models_gen.go | 1 + .../graphql/graph/schema/component.graphqls | 3 +- internal/app/component/component_handler.go | 2 + internal/database/mariadb/component.go | 9 +- internal/database/mariadb/entity.go | 6 ++ internal/database/mariadb/init/schema.sql | 2 + 8 files changed, 115 insertions(+), 6 deletions(-) diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index f461bdd3..924e2d10 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -133,6 +133,7 @@ type ComplexityRoot struct { Component struct { ComponentVersions func(childComplexity int, filter *model.ComponentVersionFilter, first *int, after *string) int ID func(childComplexity int) int + Metadata func(childComplexity int) int Name func(childComplexity int) int Type func(childComplexity int) int } @@ -1063,6 +1064,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Component.ID(childComplexity), true + case "Component.metadata": + if e.complexity.Component.Metadata == nil { + break + } + + return e.complexity.Component.Metadata(childComplexity), true + case "Component.name": if e.complexity.Component.Name == nil { break @@ -12113,6 +12121,59 @@ func (ec *executionContext) fieldContext_Component_componentVersions(ctx context return fc, nil } +func (ec *executionContext) _Component_metadata(ctx context.Context, field graphql.CollectedField, obj *model.Component) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Component_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Component_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Component", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _ComponentConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ComponentConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ComponentConnection_totalCount(ctx, field) if err != nil { @@ -12306,6 +12367,8 @@ func (ec *executionContext) fieldContext_ComponentEdge_node(_ context.Context, f return ec.fieldContext_Component_type(ctx, field) case "componentVersions": return ec.fieldContext_Component_componentVersions(ctx, field) + case "metadata": + return ec.fieldContext_Component_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Component", field.Name) }, @@ -13242,6 +13305,8 @@ func (ec *executionContext) fieldContext_ComponentVersion_component(_ context.Co return ec.fieldContext_Component_type(ctx, field) case "componentVersions": return ec.fieldContext_Component_componentVersions(ctx, field) + case "metadata": + return ec.fieldContext_Component_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Component", field.Name) }, @@ -19881,6 +19946,8 @@ func (ec *executionContext) fieldContext_Mutation_createComponent(ctx context.Co return ec.fieldContext_Component_type(ctx, field) case "componentVersions": return ec.fieldContext_Component_componentVersions(ctx, field) + case "metadata": + return ec.fieldContext_Component_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Component", field.Name) }, @@ -19946,6 +20013,8 @@ func (ec *executionContext) fieldContext_Mutation_updateComponent(ctx context.Co return ec.fieldContext_Component_type(ctx, field) case "componentVersions": return ec.fieldContext_Component_componentVersions(ctx, field) + case "metadata": + return ec.fieldContext_Component_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Component", field.Name) }, @@ -31269,6 +31338,28 @@ func (ec *executionContext) _Component(ctx context.Context, sel ast.SelectionSet continue } out.Values[i] = ec._Component_componentVersions(ctx, field, obj) + case "metadata": + field := field + + 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 ec._Component_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Component_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index cf35f5b2..9f3fa361 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -418,9 +418,10 @@ func NewEvidenceEntity(evidence *EvidenceInput) entity.Evidence { func NewComponent(component *entity.Component) Component { componentType, _ := ComponentTypeValue(component.Type) return Component{ - ID: fmt.Sprintf("%d", component.Id), - Name: &component.Name, - Type: &componentType, + ID: fmt.Sprintf("%d", component.Id), + Name: &component.Name, + Type: &componentType, + Metadata: getModelMetadata(component.Metadata), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index b47a0df9..54a26178 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -118,6 +118,7 @@ type Component struct { Name *string `json:"name,omitempty"` Type *ComponentTypeValues `json:"type,omitempty"` ComponentVersions *ComponentVersionConnection `json:"componentVersions,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (Component) IsNode() {} diff --git a/internal/api/graphql/graph/schema/component.graphqls b/internal/api/graphql/graph/schema/component.graphqls index e2805fd1..da8a11ea 100644 --- a/internal/api/graphql/graph/schema/component.graphqls +++ b/internal/api/graphql/graph/schema/component.graphqls @@ -6,6 +6,7 @@ type Component implements Node { name: String type: ComponentTypeValues componentVersions(filter: ComponentVersionFilter, first: Int, after: String): ComponentVersionConnection + metadata: Metadata } input ComponentInput { @@ -32,4 +33,4 @@ type ComponentConnection implements Connection { type ComponentEdge implements Edge { node: Component! cursor: String -} \ No newline at end of file +} diff --git a/internal/app/component/component_handler.go b/internal/app/component/component_handler.go index 2da923fd..2cc0a5c4 100644 --- a/internal/app/component/component_handler.go +++ b/internal/app/component/component_handler.go @@ -105,6 +105,7 @@ func (cs *componentHandler) ListComponents(filter *entity.ComponentFilter, optio } func (cs *componentHandler) CreateComponent(component *entity.Component) (*entity.Component, error) { + component.CreatedBy = "Creator" f := &entity.ComponentFilter{ Name: []*string{&component.Name}, } @@ -139,6 +140,7 @@ func (cs *componentHandler) CreateComponent(component *entity.Component) (*entit } func (cs *componentHandler) UpdateComponent(component *entity.Component) (*entity.Component, error) { + component.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateComponentEventName, "object": component, diff --git a/internal/database/mariadb/component.go b/internal/database/mariadb/component.go index 41773aae..6c8ccd97 100644 --- a/internal/database/mariadb/component.go +++ b/internal/database/mariadb/component.go @@ -64,6 +64,9 @@ func (s *SqlDatabase) getComponentUpdateFields(component *entity.Component) stri if component.Type != "" { fl = append(fl, "component_type = :component_type") } + if component.UpdatedBy != "" { + fl = append(fl, "component_updated_by = :component_updated_by") + } return strings.Join(fl, ", ") } @@ -202,10 +205,12 @@ func (s *SqlDatabase) CreateComponent(component *entity.Component) (*entity.Comp query := ` INSERT INTO Component ( component_name, - component_type + component_type, + component_created_by ) VALUES ( :component_name, - :component_type + :component_type, + :component_created_by ) ` diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index e0870777..d9f07e09 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -409,8 +409,10 @@ type ComponentRow struct { Name sql.NullString `db:"component_name" json:"name"` Type sql.NullString `db:"component_type" json:"type"` CreatedAt sql.NullTime `db:"component_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"component_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"component_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"component_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"component_updated_by" json:"updated_by"` } func (cr *ComponentRow) AsComponent() entity.Component { @@ -420,8 +422,10 @@ func (cr *ComponentRow) AsComponent() entity.Component { Type: GetStringValue(cr.Type), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cr.CreatedAt), + CreatedBy: GetStringValue(cr.CreatedBy), DeletedAt: GetTimeValue(cr.DeletedAt), UpdatedAt: GetTimeValue(cr.UpdatedAt), + UpdatedBy: GetStringValue(cr.UpdatedBy), }, } } @@ -431,8 +435,10 @@ func (cr *ComponentRow) FromComponent(c *entity.Component) { cr.Name = sql.NullString{String: c.Name, Valid: true} cr.Type = sql.NullString{String: c.Type, Valid: true} cr.CreatedAt = sql.NullTime{Time: c.CreatedAt, Valid: true} + cr.CreatedBy = sql.NullString{String: c.CreatedBy, Valid: true} cr.DeletedAt = sql.NullTime{Time: c.DeletedAt, Valid: true} cr.UpdatedAt = sql.NullTime{Time: c.UpdatedAt, Valid: true} + cr.UpdatedBy = sql.NullString{String: c.UpdatedBy, Valid: true} } type ComponentVersionRow struct { diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index 9a91c794..cdb279d6 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -12,8 +12,10 @@ create table if not exists Component component_name varchar(256) not null, component_type varchar(256) not null, component_created_at timestamp default current_timestamp() not null, + component_created_by varchar(256) null, component_deleted_at timestamp null, component_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + component_updated_by varchar(256) null, constraint id_UNIQUE unique (component_id), constraint name_UNIQUE From b8d5d0a180ffa2f362d9400e73e7a08ddb5d74ee Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Tue, 1 Oct 2024 15:48:21 +0200 Subject: [PATCH 05/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Add metadata for componentInstance, componentVersion --- internal/api/graphql/graph/generated.go | 234 ++++++++++-------- internal/api/graphql/graph/model/models.go | 8 +- .../api/graphql/graph/model/models_gen.go | 4 +- .../componentInstance/directRelations.graphql | 8 +- .../issue/directRelations.graphql | 6 +- .../graph/schema/component_instance.graphqls | 5 +- .../graph/schema/component_version.graphqls | 3 +- .../component_instance_handler.go | 2 + .../component_version_handler.go | 2 + .../database/mariadb/component_instance.go | 10 +- .../database/mariadb/component_version.go | 9 +- internal/database/mariadb/entity.go | 12 + internal/database/mariadb/init/schema.sql | 4 + 13 files changed, 184 insertions(+), 123 deletions(-) diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index 924e2d10..c8f2b98e 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -154,12 +154,11 @@ type ComplexityRoot struct { ComponentVersion func(childComplexity int) int ComponentVersionID func(childComplexity int) int Count func(childComplexity int) int - CreatedAt func(childComplexity int) int ID func(childComplexity int) int IssueMatches func(childComplexity int, filter *model.IssueMatchFilter, first *int, after *string) int + Metadata func(childComplexity int) int Service func(childComplexity int) int ServiceID func(childComplexity int) int - UpdatedAt func(childComplexity int) int } ComponentInstanceConnection struct { @@ -179,6 +178,7 @@ type ComplexityRoot struct { ComponentInstances func(childComplexity int, first *int, after *string) int ID func(childComplexity int) int Issues func(childComplexity int, first *int, after *string) int + Metadata func(childComplexity int) int Version func(childComplexity int) int } @@ -1148,13 +1148,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ComponentInstance.Count(childComplexity), true - case "ComponentInstance.createdAt": - if e.complexity.ComponentInstance.CreatedAt == nil { - break - } - - return e.complexity.ComponentInstance.CreatedAt(childComplexity), true - case "ComponentInstance.id": if e.complexity.ComponentInstance.ID == nil { break @@ -1174,6 +1167,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ComponentInstance.IssueMatches(childComplexity, args["filter"].(*model.IssueMatchFilter), args["first"].(*int), args["after"].(*string)), true + case "ComponentInstance.metadata": + if e.complexity.ComponentInstance.Metadata == nil { + break + } + + return e.complexity.ComponentInstance.Metadata(childComplexity), true + case "ComponentInstance.service": if e.complexity.ComponentInstance.Service == nil { break @@ -1188,13 +1188,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ComponentInstance.ServiceID(childComplexity), true - case "ComponentInstance.updatedAt": - if e.complexity.ComponentInstance.UpdatedAt == nil { - break - } - - return e.complexity.ComponentInstance.UpdatedAt(childComplexity), true - case "ComponentInstanceConnection.edges": if e.complexity.ComponentInstanceConnection.Edges == nil { break @@ -1275,6 +1268,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ComponentVersion.Issues(childComplexity, args["first"].(*int), args["after"].(*string)), true + case "ComponentVersion.metadata": + if e.complexity.ComponentVersion.Metadata == nil { + break + } + + return e.complexity.ComponentVersion.Metadata(childComplexity), true + case "ComponentVersion.version": if e.complexity.ComponentVersion.Version == nil { break @@ -12632,6 +12632,8 @@ func (ec *executionContext) fieldContext_ComponentInstance_componentVersion(_ co return ec.fieldContext_ComponentVersion_issues(ctx, field) case "componentInstances": return ec.fieldContext_ComponentVersion_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_ComponentVersion_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentVersion", field.Name) }, @@ -12797,49 +12799,8 @@ func (ec *executionContext) fieldContext_ComponentInstance_service(_ context.Con return fc, nil } -func (ec *executionContext) _ComponentInstance_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.ComponentInstance) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ComponentInstance_createdAt(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.CreatedAt, 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.marshalODateTime2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ComponentInstance_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ComponentInstance", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ComponentInstance_updatedAt(ctx context.Context, field graphql.CollectedField, obj *model.ComponentInstance) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ComponentInstance_updatedAt(ctx, field) +func (ec *executionContext) _ComponentInstance_metadata(ctx context.Context, field graphql.CollectedField, obj *model.ComponentInstance) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComponentInstance_metadata(ctx, field) if err != nil { return graphql.Null } @@ -12852,7 +12813,7 @@ func (ec *executionContext) _ComponentInstance_updatedAt(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UpdatedAt, nil + return obj.Metadata, nil }) if err != nil { ec.Error(ctx, err) @@ -12861,19 +12822,31 @@ func (ec *executionContext) _ComponentInstance_updatedAt(ctx context.Context, fi if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*model.Metadata) fc.Result = res - return ec.marshalODateTime2ᚖstring(ctx, field.Selections, res) + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_ComponentInstance_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ComponentInstance_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "ComponentInstance", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type DateTime does not have child fields") + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) }, } return fc, nil @@ -13083,10 +13056,8 @@ func (ec *executionContext) fieldContext_ComponentInstanceEdge_node(_ context.Co return ec.fieldContext_ComponentInstance_serviceId(ctx, field) case "service": return ec.fieldContext_ComponentInstance_service(ctx, field) - case "createdAt": - return ec.fieldContext_ComponentInstance_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_ComponentInstance_updatedAt(ctx, field) + case "metadata": + return ec.fieldContext_ComponentInstance_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentInstance", field.Name) }, @@ -13440,6 +13411,59 @@ func (ec *executionContext) fieldContext_ComponentVersion_componentInstances(ctx return fc, nil } +func (ec *executionContext) _ComponentVersion_metadata(ctx context.Context, field graphql.CollectedField, obj *model.ComponentVersion) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ComponentVersion_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ComponentVersion_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ComponentVersion", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _ComponentVersionConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ComponentVersionConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ComponentVersionConnection_totalCount(ctx, field) if err != nil { @@ -13640,6 +13664,8 @@ func (ec *executionContext) fieldContext_ComponentVersionEdge_node(_ context.Con return ec.fieldContext_ComponentVersion_issues(ctx, field) case "componentInstances": return ec.fieldContext_ComponentVersion_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_ComponentVersion_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentVersion", field.Name) }, @@ -16099,10 +16125,8 @@ func (ec *executionContext) fieldContext_IssueMatch_componentInstance(_ context. return ec.fieldContext_ComponentInstance_serviceId(ctx, field) case "service": return ec.fieldContext_ComponentInstance_service(ctx, field) - case "createdAt": - return ec.fieldContext_ComponentInstance_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_ComponentInstance_updatedAt(ctx, field) + case "metadata": + return ec.fieldContext_ComponentInstance_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentInstance", field.Name) }, @@ -20143,10 +20167,8 @@ func (ec *executionContext) fieldContext_Mutation_createComponentInstance(ctx co return ec.fieldContext_ComponentInstance_serviceId(ctx, field) case "service": return ec.fieldContext_ComponentInstance_service(ctx, field) - case "createdAt": - return ec.fieldContext_ComponentInstance_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_ComponentInstance_updatedAt(ctx, field) + case "metadata": + return ec.fieldContext_ComponentInstance_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentInstance", field.Name) }, @@ -20220,10 +20242,8 @@ func (ec *executionContext) fieldContext_Mutation_updateComponentInstance(ctx co return ec.fieldContext_ComponentInstance_serviceId(ctx, field) case "service": return ec.fieldContext_ComponentInstance_service(ctx, field) - case "createdAt": - return ec.fieldContext_ComponentInstance_createdAt(ctx, field) - case "updatedAt": - return ec.fieldContext_ComponentInstance_updatedAt(ctx, field) + case "metadata": + return ec.fieldContext_ComponentInstance_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentInstance", field.Name) }, @@ -20348,6 +20368,8 @@ func (ec *executionContext) fieldContext_Mutation_createComponentVersion(ctx con return ec.fieldContext_ComponentVersion_issues(ctx, field) case "componentInstances": return ec.fieldContext_ComponentVersion_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_ComponentVersion_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentVersion", field.Name) }, @@ -20417,6 +20439,8 @@ func (ec *executionContext) fieldContext_Mutation_updateComponentVersion(ctx con return ec.fieldContext_ComponentVersion_issues(ctx, field) case "componentInstances": return ec.fieldContext_ComponentVersion_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_ComponentVersion_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type ComponentVersion", field.Name) }, @@ -31757,29 +31781,7 @@ func (ec *executionContext) _ComponentInstance(ctx context.Context, sel ast.Sele continue } out.Values[i] = ec._ComponentInstance_service(ctx, field, obj) - case "createdAt": - field := field - - 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 ec._ComponentInstance_createdAt(ctx, field, obj) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - out.Values[i] = ec._ComponentInstance_createdAt(ctx, field, obj) - case "updatedAt": + case "metadata": field := field if field.Deferrable != nil { @@ -31793,14 +31795,14 @@ func (ec *executionContext) _ComponentInstance(ctx context.Context, sel ast.Sele deferred[field.Deferrable.Label] = dfs } dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return ec._ComponentInstance_updatedAt(ctx, field, obj) + return ec._ComponentInstance_metadata(ctx, field, obj) }) // don't run the out.Concurrently() call below out.Values[i] = graphql.Null continue } - out.Values[i] = ec._ComponentInstance_updatedAt(ctx, field, obj) + out.Values[i] = ec._ComponentInstance_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -32157,6 +32159,28 @@ func (ec *executionContext) _ComponentVersion(ctx context.Context, sel ast.Selec continue } out.Values[i] = ec._ComponentVersion_componentInstances(ctx, field, obj) + case "metadata": + field := field + + 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 ec._ComponentVersion_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._ComponentVersion_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index 9f3fa361..19d2984b 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -298,9 +298,9 @@ func NewIssueVariant(issueVariant *entity.IssueVariant) IssueVariant { func NewIssueVariantEdge(issueVariant *entity.IssueVariant) IssueVariantEdge { iv := NewIssueVariant(issueVariant) issueVariantEdge := IssueVariantEdge{ - Node: &iv, - Cursor: &iv.ID, - Metadata: getModelMetadata(issueVariant.Metadata), + Node: &iv, + Cursor: &iv.ID, + Metadata: getModelMetadata(issueVariant.Metadata), } return issueVariantEdge } @@ -441,6 +441,7 @@ func NewComponentVersion(componentVersion *entity.ComponentVersion) ComponentVer ID: fmt.Sprintf("%d", componentVersion.Id), Version: &componentVersion.Version, ComponentID: util.Ptr(fmt.Sprintf("%d", componentVersion.ComponentId)), + Metadata: getModelMetadata(componentVersion.Metadata), } } @@ -463,6 +464,7 @@ func NewComponentInstance(componentInstance *entity.ComponentInstance) Component Count: &count, ComponentVersionID: util.Ptr(fmt.Sprintf("%d", componentInstance.ComponentVersionId)), ServiceID: util.Ptr(fmt.Sprintf("%d", componentInstance.ServiceId)), + Metadata: getModelMetadata(componentInstance.Metadata), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index 54a26178..58f219b1 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -161,8 +161,7 @@ type ComponentInstance struct { IssueMatches *IssueMatchConnection `json:"issueMatches,omitempty"` ServiceID *string `json:"serviceId,omitempty"` Service *Service `json:"service,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - UpdatedAt *string `json:"updatedAt,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (ComponentInstance) IsNode() {} @@ -205,6 +204,7 @@ type ComponentVersion struct { Component *Component `json:"component,omitempty"` Issues *IssueConnection `json:"issues,omitempty"` ComponentInstances *ComponentInstanceConnection `json:"componentInstances,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (ComponentVersion) IsNode() {} diff --git a/internal/api/graphql/graph/queryCollection/componentInstance/directRelations.graphql b/internal/api/graphql/graph/queryCollection/componentInstance/directRelations.graphql index e7d97d74..ca024035 100644 --- a/internal/api/graphql/graph/queryCollection/componentInstance/directRelations.graphql +++ b/internal/api/graphql/graph/queryCollection/componentInstance/directRelations.graphql @@ -25,8 +25,10 @@ query ($filter: ComponentInstanceFilter, $first: Int, $after: String) { id name } - createdAt - updatedAt + metadata { + created_at + updated_at + } issueMatches { totalCount edges { @@ -57,4 +59,4 @@ query ($filter: ComponentInstanceFilter, $first: Int, $after: String) { } } } -} \ No newline at end of file +} diff --git a/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql b/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql index 20b394fe..2fbfbcbe 100644 --- a/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql +++ b/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql @@ -67,8 +67,10 @@ query ($filter: IssueFilter, $first: Int, $after: String) { componentInstance { id count - createdAt - updatedAt + metadata { + created_at + updated_at + } ccrn } } diff --git a/internal/api/graphql/graph/schema/component_instance.graphqls b/internal/api/graphql/graph/schema/component_instance.graphqls index 9342c93e..03fa4ba8 100644 --- a/internal/api/graphql/graph/schema/component_instance.graphqls +++ b/internal/api/graphql/graph/schema/component_instance.graphqls @@ -10,8 +10,7 @@ type ComponentInstance implements Node { issueMatches(filter: IssueMatchFilter, first: Int, after: String): IssueMatchConnection serviceId: String service: Service - createdAt: DateTime - updatedAt: DateTime + metadata: Metadata } input ComponentInstanceInput { @@ -34,4 +33,4 @@ type ComponentInstanceEdge implements Edge { input ComponentInstanceFilter { issueMatchId: [String], -} \ No newline at end of file +} diff --git a/internal/api/graphql/graph/schema/component_version.graphqls b/internal/api/graphql/graph/schema/component_version.graphqls index cebb4e36..573e6ddf 100644 --- a/internal/api/graphql/graph/schema/component_version.graphqls +++ b/internal/api/graphql/graph/schema/component_version.graphqls @@ -8,6 +8,7 @@ type ComponentVersion implements Node { component: Component issues(first: Int, after: String): IssueConnection componentInstances(first: Int, after: String): ComponentInstanceConnection + metadata: Metadata } input ComponentVersionInput { @@ -29,4 +30,4 @@ type ComponentVersionEdge implements Edge { input ComponentVersionFilter { issueId: [String], version: [String], -} \ No newline at end of file +} diff --git a/internal/app/component_instance/component_instance_handler.go b/internal/app/component_instance/component_instance_handler.go index b03cbd99..fda1efd1 100644 --- a/internal/app/component_instance/component_instance_handler.go +++ b/internal/app/component_instance/component_instance_handler.go @@ -111,6 +111,7 @@ func (ci *componentInstanceHandler) ListComponentInstances(filter *entity.Compon } func (ci *componentInstanceHandler) CreateComponentInstance(componentInstance *entity.ComponentInstance) (*entity.ComponentInstance, error) { + componentInstance.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateComponentInstanceEventName, "object": componentInstance, @@ -131,6 +132,7 @@ func (ci *componentInstanceHandler) CreateComponentInstance(componentInstance *e } func (ci *componentInstanceHandler) UpdateComponentInstance(componentInstance *entity.ComponentInstance) (*entity.ComponentInstance, error) { + componentInstance.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateComponentInstanceEventName, "object": componentInstance, diff --git a/internal/app/component_version/component_version_handler.go b/internal/app/component_version/component_version_handler.go index 39d73dac..ea42bb2b 100644 --- a/internal/app/component_version/component_version_handler.go +++ b/internal/app/component_version/component_version_handler.go @@ -109,6 +109,7 @@ func (cv *componentVersionHandler) ListComponentVersions(filter *entity.Componen } func (cv *componentVersionHandler) CreateComponentVersion(componentVersion *entity.ComponentVersion) (*entity.ComponentVersion, error) { + componentVersion.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateComponentVersionEventName, "object": componentVersion, @@ -129,6 +130,7 @@ func (cv *componentVersionHandler) CreateComponentVersion(componentVersion *enti } func (cv *componentVersionHandler) UpdateComponentVersion(componentVersion *entity.ComponentVersion) (*entity.ComponentVersion, error) { + componentVersion.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateComponentVersionEventName, "object": componentVersion, diff --git a/internal/database/mariadb/component_instance.go b/internal/database/mariadb/component_instance.go index 3556e68e..89535dc9 100644 --- a/internal/database/mariadb/component_instance.go +++ b/internal/database/mariadb/component_instance.go @@ -69,6 +69,10 @@ func (s *SqlDatabase) getComponentInstanceUpdateFields(componentInstance *entity if componentInstance.ServiceId != 0 { fl = append(fl, "componentinstance_service_id = :componentinstance_service_id") } + if componentInstance.UpdatedBy != "" { + fl = append(fl, "componentinstance_updated_by = :componentinstance_updated_by") + } + return strings.Join(fl, ", ") } @@ -208,12 +212,14 @@ func (s *SqlDatabase) CreateComponentInstance(componentInstance *entity.Componen componentinstance_ccrn, componentinstance_count, componentinstance_component_version_id, - componentinstance_service_id + componentinstance_service_id, + componentinstance_created_by ) VALUES ( :componentinstance_ccrn, :componentinstance_count, :componentinstance_component_version_id, - :componentinstance_service_id + :componentinstance_service_id, + :componentinstance_created_by ) ` diff --git a/internal/database/mariadb/component_version.go b/internal/database/mariadb/component_version.go index 1644431a..f9d38d33 100644 --- a/internal/database/mariadb/component_version.go +++ b/internal/database/mariadb/component_version.go @@ -51,6 +51,9 @@ func (s *SqlDatabase) getComponentVersionUpdateFields(componentVersion *entity.C if componentVersion.ComponentId != 0 { fl = append(fl, "componentversion_component_id = :componentversion_component_id") } + if componentVersion.UpdatedBy != "" { + fl = append(fl, "componentversion_updated_by = :componentversion_updated_by") + } return strings.Join(fl, ", ") } @@ -201,10 +204,12 @@ func (s *SqlDatabase) CreateComponentVersion(componentVersion *entity.ComponentV query := ` INSERT INTO ComponentVersion ( componentversion_component_id, - componentversion_version + componentversion_version, + componentversion_created_by ) VALUES ( :componentversion_component_id, - :componentversion_version + :componentversion_version, + :componentversion_created_by ) ` diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index d9f07e09..d85f7d6b 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -446,8 +446,10 @@ type ComponentVersionRow struct { Version sql.NullString `db:"componentversion_version" json:"version"` ComponentId sql.NullInt64 `db:"componentversion_component_id"` CreatedAt sql.NullTime `db:"componentversion_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"componentversion_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"componentversion_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"componentversion_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"componentversion_updated_by" json:"updated_by"` } func (cvr *ComponentVersionRow) AsComponentVersion() entity.ComponentVersion { @@ -457,8 +459,10 @@ func (cvr *ComponentVersionRow) AsComponentVersion() entity.ComponentVersion { ComponentId: GetInt64Value(cvr.ComponentId), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cvr.CreatedAt), + CreatedBy: GetStringValue(cvr.CreatedBy), DeletedAt: GetTimeValue(cvr.DeletedAt), UpdatedAt: GetTimeValue(cvr.UpdatedAt), + UpdatedBy: GetStringValue(cvr.UpdatedBy), }, } } @@ -468,8 +472,10 @@ func (cvr *ComponentVersionRow) FromComponentVersion(cv *entity.ComponentVersion cvr.Version = sql.NullString{String: cv.Version, Valid: true} cvr.ComponentId = sql.NullInt64{Int64: cv.ComponentId, Valid: true} cvr.CreatedAt = sql.NullTime{Time: cv.CreatedAt, Valid: true} + cvr.CreatedBy = sql.NullString{String: cv.CreatedBy, Valid: true} cvr.DeletedAt = sql.NullTime{Time: cv.DeletedAt, Valid: true} cvr.UpdatedAt = sql.NullTime{Time: cv.UpdatedAt, Valid: true} + cvr.UpdatedBy = sql.NullString{String: cv.UpdatedBy, Valid: true} } type SupportGroupRow struct { @@ -605,8 +611,10 @@ type ComponentInstanceRow struct { ComponentVersionId sql.NullInt64 `db:"componentinstance_component_version_id"` ServiceId sql.NullInt64 `db:"componentinstance_service_id"` CreatedAt sql.NullTime `db:"componentinstance_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"componentinstance_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"componentinstance_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"componentinstance_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"componentinstance_updated_by" json:"udpated_by"` } func (cir *ComponentInstanceRow) AsComponentInstance() entity.ComponentInstance { @@ -620,8 +628,10 @@ func (cir *ComponentInstanceRow) AsComponentInstance() entity.ComponentInstance ServiceId: GetInt64Value(cir.ServiceId), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cir.CreatedAt), + CreatedBy: GetStringValue(cir.CreatedBy), DeletedAt: GetTimeValue(cir.DeletedAt), UpdatedAt: GetTimeValue(cir.UpdatedAt), + UpdatedBy: GetStringValue(cir.UpdatedBy), }, } } @@ -633,8 +643,10 @@ func (cir *ComponentInstanceRow) FromComponentInstance(ci *entity.ComponentInsta cir.ComponentVersionId = sql.NullInt64{Int64: ci.ComponentVersionId, Valid: true} cir.ServiceId = sql.NullInt64{Int64: ci.ServiceId, Valid: true} cir.CreatedAt = sql.NullTime{Time: ci.CreatedAt, Valid: true} + cir.CreatedBy = sql.NullString{String: ci.CreatedBy, Valid: true} cir.DeletedAt = sql.NullTime{Time: ci.DeletedAt, Valid: true} cir.UpdatedAt = sql.NullTime{Time: ci.UpdatedAt, Valid: true} + cir.UpdatedBy = sql.NullString{String: ci.UpdatedBy, Valid: true} } type UserRow struct { diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index cdb279d6..e11511d8 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -29,8 +29,10 @@ create table if not exists ComponentVersion componentversion_version varchar(256) not null, componentversion_component_id int unsigned not null, componentversion_created_at timestamp default current_timestamp() not null, + componentversion_created_by varchar(256) null, componentversion_deleted_at timestamp null, componentversion_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + componentversion_updated_by varchar(256) null, constraint id_UNIQUE unique (componentversion_id), constraint version_component_unique @@ -108,8 +110,10 @@ create table if not exists ComponentInstance componentinstance_component_version_id int unsigned not null, componentinstance_service_id int unsigned not null, componentinstance_created_at timestamp default current_timestamp() not null, + componentinstance_created_by varchar(256) null, componentinstance_deleted_at timestamp null, componentinstance_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + componentinstance_updated_by varchar(256) null, constraint id_UNIQUE unique (componentinstance_id), constraint name_service_unique From 98500cb9486f2989148410780a867ba21409c7ba Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 2 Oct 2024 00:41:20 +0200 Subject: [PATCH 06/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Add metadata for evidence --- internal/api/graphql/graph/generated.go | 89 +++++++++++++++++++ internal/api/graphql/graph/model/models.go | 1 + .../api/graphql/graph/model/models_gen.go | 1 + .../graphql/graph/schema/evidence.graphqls | 3 +- internal/app/evidence/evidence_handler.go | 2 + internal/database/mariadb/entity.go | 6 ++ internal/database/mariadb/evidence.go | 9 +- internal/database/mariadb/init/schema.sql | 2 + 8 files changed, 110 insertions(+), 3 deletions(-) diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index c8f2b98e..12965222 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -201,6 +201,7 @@ type ComplexityRoot struct { Description func(childComplexity int) int ID func(childComplexity int) int IssueMatches func(childComplexity int, filter *model.IssueMatchFilter, first *int, after *string) int + Metadata func(childComplexity int) int RaaEnd func(childComplexity int) int Type func(childComplexity int) int Vector func(childComplexity int) int @@ -1371,6 +1372,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Evidence.IssueMatches(childComplexity, args["filter"].(*model.IssueMatchFilter), args["first"].(*int), args["after"].(*string)), true + case "Evidence.metadata": + if e.complexity.Evidence.Metadata == nil { + break + } + + return e.complexity.Evidence.Metadata(childComplexity), true + case "Evidence.raaEnd": if e.complexity.Evidence.RaaEnd == nil { break @@ -14178,6 +14186,59 @@ func (ec *executionContext) fieldContext_Evidence_issueMatches(ctx context.Conte return fc, nil } +func (ec *executionContext) _Evidence_metadata(ctx context.Context, field graphql.CollectedField, obj *model.Evidence) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Evidence_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Evidence_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Evidence", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _EvidenceConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.EvidenceConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_EvidenceConnection_totalCount(ctx, field) if err != nil { @@ -14383,6 +14444,8 @@ func (ec *executionContext) fieldContext_EvidenceEdge_node(_ context.Context, fi return ec.fieldContext_Evidence_activity(ctx, field) case "issueMatches": return ec.fieldContext_Evidence_issueMatches(ctx, field) + case "metadata": + return ec.fieldContext_Evidence_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Evidence", field.Name) }, @@ -21815,6 +21878,8 @@ func (ec *executionContext) fieldContext_Mutation_createEvidence(ctx context.Con return ec.fieldContext_Evidence_activity(ctx, field) case "issueMatches": return ec.fieldContext_Evidence_issueMatches(ctx, field) + case "metadata": + return ec.fieldContext_Evidence_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Evidence", field.Name) }, @@ -21892,6 +21957,8 @@ func (ec *executionContext) fieldContext_Mutation_updateEvidence(ctx context.Con return ec.fieldContext_Evidence_activity(ctx, field) case "issueMatches": return ec.fieldContext_Evidence_issueMatches(ctx, field) + case "metadata": + return ec.fieldContext_Evidence_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Evidence", field.Name) }, @@ -32625,6 +32692,28 @@ func (ec *executionContext) _Evidence(ctx context.Context, sel ast.SelectionSet, continue } out.Values[i] = ec._Evidence_issueMatches(ctx, field, obj) + case "metadata": + field := field + + 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 ec._Evidence_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Evidence_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index 19d2984b..03c65cde 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -396,6 +396,7 @@ func NewEvidence(evidence *entity.Evidence) Evidence { Vector: severity.Cvss.Vector, Type: &t, RaaEnd: &raaEnd, + Metadata: getModelMetadata(evidence.Metadata), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index 58f219b1..4b6917b5 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -255,6 +255,7 @@ type Evidence struct { ActivityID *string `json:"activityId,omitempty"` Activity *Activity `json:"activity,omitempty"` IssueMatches *IssueMatchConnection `json:"issueMatches,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (Evidence) IsNode() {} diff --git a/internal/api/graphql/graph/schema/evidence.graphqls b/internal/api/graphql/graph/schema/evidence.graphqls index 9f76a0ed..faee3485 100644 --- a/internal/api/graphql/graph/schema/evidence.graphqls +++ b/internal/api/graphql/graph/schema/evidence.graphqls @@ -13,6 +13,7 @@ type Evidence implements Node { activityId: String activity: Activity issueMatches(filter: IssueMatchFilter, first: Int, after: String): IssueMatchConnection + metadata: Metadata } input EvidenceInput { @@ -37,4 +38,4 @@ type EvidenceEdge implements Edge { input EvidenceFilter { placeholder: [Boolean] -} \ No newline at end of file +} diff --git a/internal/app/evidence/evidence_handler.go b/internal/app/evidence/evidence_handler.go index f3a8eb21..7b40f388 100644 --- a/internal/app/evidence/evidence_handler.go +++ b/internal/app/evidence/evidence_handler.go @@ -104,6 +104,7 @@ func (e *evidenceHandler) ListEvidences(filter *entity.EvidenceFilter, options * } func (e *evidenceHandler) CreateEvidence(evidence *entity.Evidence) (*entity.Evidence, error) { + evidence.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateEvidenceEventName, "object": evidence, @@ -122,6 +123,7 @@ func (e *evidenceHandler) CreateEvidence(evidence *entity.Evidence) (*entity.Evi } func (e *evidenceHandler) UpdateEvidence(evidence *entity.Evidence) (*entity.Evidence, error) { + evidence.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateEvidenceEventName, "object": evidence, diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index d85f7d6b..8fc26b6b 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -701,8 +701,10 @@ type EvidenceRow struct { Activity *ActivityRow `json:"activity,omitempty"` ActivityId sql.NullInt64 `db:"evidence_activity_id"` CreatedAt sql.NullTime `db:"evidence_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"evidence_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"evidence_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"evidence_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"evidence_updated_by" json:"updated_by"` } func (er *EvidenceRow) AsEvidence() entity.Evidence { @@ -718,8 +720,10 @@ func (er *EvidenceRow) AsEvidence() entity.Evidence { ActivityId: GetInt64Value(er.ActivityId), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(er.CreatedAt), + CreatedBy: GetStringValue(er.CreatedBy), DeletedAt: GetTimeValue(er.DeletedAt), UpdatedAt: GetTimeValue(er.UpdatedAt), + UpdatedBy: GetStringValue(er.UpdatedBy), }, } } @@ -734,8 +738,10 @@ func (er *EvidenceRow) FromEvidence(e *entity.Evidence) { er.UserId = sql.NullInt64{Int64: e.UserId, Valid: true} er.ActivityId = sql.NullInt64{Int64: e.ActivityId, Valid: true} er.CreatedAt = sql.NullTime{Time: e.CreatedAt, Valid: true} + er.CreatedBy = sql.NullString{String: e.CreatedBy, Valid: true} er.DeletedAt = sql.NullTime{Time: e.DeletedAt, Valid: true} er.UpdatedAt = sql.NullTime{Time: e.UpdatedAt, Valid: true} + er.UpdatedBy = sql.NullString{String: e.UpdatedBy, Valid: true} } type IssueMatchChangeRow struct { diff --git a/internal/database/mariadb/evidence.go b/internal/database/mariadb/evidence.go index 73d7c693..41223899 100644 --- a/internal/database/mariadb/evidence.go +++ b/internal/database/mariadb/evidence.go @@ -76,6 +76,9 @@ func (s *SqlDatabase) getEvidenceUpdateFields(evidence *entity.Evidence) string if !evidence.RaaEnd.IsZero() { fl = append(fl, "evidence_raa_end = :evidence_raa_end") } + if evidence.UpdatedBy != "" { + fl = append(fl, "evidence_updated_by = :evidence_updated_by") + } return strings.Join(fl, ", ") } @@ -220,7 +223,8 @@ func (s *SqlDatabase) CreateEvidence(evidence *entity.Evidence) (*entity.Evidenc evidence_description, evidence_vector, evidence_rating, - evidence_raa_end + evidence_raa_end, + evidence_created_by ) VALUES ( :evidence_author_id, :evidence_activity_id, @@ -228,7 +232,8 @@ func (s *SqlDatabase) CreateEvidence(evidence *entity.Evidence) (*entity.Evidenc :evidence_description, :evidence_vector, :evidence_rating, - :evidence_raa_end + :evidence_raa_end, + :evidence_created_by ) ` diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index e11511d8..dc280ca5 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -156,8 +156,10 @@ create table if not exists Evidence evidence_rating enum('None','Low','Medium','High','Critical') null, evidence_raa_end datetime null, evidence_created_at timestamp default current_timestamp() not null, + evidence_created_by varchar(256) null, evidence_deleted_at timestamp null, evidence_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + evidence_updated_by varchar(256) null, constraint id_UNIQUE unique (evidence_id), constraint fk_evidence_user From 69b5884d0f0f379a5bb08d721d42cfd0bd0ab2b0 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 2 Oct 2024 10:55:57 +0200 Subject: [PATCH 07/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Issue Metadata rename to IssueMetadata, because now metadata means data related to creation time, creation user, update time and update user Add Metadata for Issue --- internal/api/graphql/graph/generated.go | 105 +++++++++++++++++- internal/api/graphql/graph/model/models.go | 16 +-- .../api/graphql/graph/model/models_gen.go | 3 +- .../issue/directRelations.graphql | 2 +- .../api/graphql/graph/schema/issue.graphqls | 3 +- internal/app/issue/issue_handler.go | 2 + internal/database/mariadb/entity.go | 10 ++ internal/database/mariadb/init/schema.sql | 4 +- internal/database/mariadb/issue.go | 9 +- 9 files changed, 137 insertions(+), 17 deletions(-) diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index 12965222..47b9b179 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -230,6 +230,7 @@ type ComplexityRoot struct { Description func(childComplexity int) int ID func(childComplexity int) int IssueMatches func(childComplexity int, filter *model.IssueMatchFilter, first *int, after *string) int + IssueMetadata func(childComplexity int) int IssueVariants func(childComplexity int, filter *model.IssueVariantFilter, first *int, after *string) int LastModified func(childComplexity int) int Metadata func(childComplexity int) int @@ -1506,6 +1507,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Issue.IssueMatches(childComplexity, args["filter"].(*model.IssueMatchFilter), args["first"].(*int), args["after"].(*string)), true + case "Issue.issueMetadata": + if e.complexity.Issue.IssueMetadata == nil { + break + } + + return e.complexity.Issue.IssueMetadata(childComplexity), true + case "Issue.issueVariants": if e.complexity.Issue.IssueVariants == nil { break @@ -15065,8 +15073,8 @@ func (ec *executionContext) fieldContext_Issue_componentVersions(ctx context.Con return fc, nil } -func (ec *executionContext) _Issue_metadata(ctx context.Context, field graphql.CollectedField, obj *model.Issue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Issue_metadata(ctx, field) +func (ec *executionContext) _Issue_issueMetadata(ctx context.Context, field graphql.CollectedField, obj *model.Issue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Issue_issueMetadata(ctx, field) if err != nil { return graphql.Null } @@ -15079,7 +15087,7 @@ func (ec *executionContext) _Issue_metadata(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Metadata, nil + return obj.IssueMetadata, nil }) if err != nil { ec.Error(ctx, err) @@ -15093,7 +15101,7 @@ func (ec *executionContext) _Issue_metadata(ctx context.Context, field graphql.C return ec.marshalOIssueMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐIssueMetadata(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Issue_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Issue_issueMetadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Issue", Field: field, @@ -15122,6 +15130,59 @@ func (ec *executionContext) fieldContext_Issue_metadata(_ context.Context, field return fc, nil } +func (ec *executionContext) _Issue_metadata(ctx context.Context, field graphql.CollectedField, obj *model.Issue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Issue_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Issue_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Issue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _IssueConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.IssueConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IssueConnection_totalCount(ctx, field) if err != nil { @@ -15460,6 +15521,8 @@ func (ec *executionContext) fieldContext_IssueEdge_node(_ context.Context, field return ec.fieldContext_Issue_issueMatches(ctx, field) case "componentVersions": return ec.fieldContext_Issue_componentVersions(ctx, field) + case "issueMetadata": + return ec.fieldContext_Issue_issueMetadata(ctx, field) case "metadata": return ec.fieldContext_Issue_metadata(ctx, field) } @@ -15985,6 +16048,8 @@ func (ec *executionContext) fieldContext_IssueMatch_issue(_ context.Context, fie return ec.fieldContext_Issue_issueMatches(ctx, field) case "componentVersions": return ec.fieldContext_Issue_componentVersions(ctx, field) + case "issueMetadata": + return ec.fieldContext_Issue_issueMetadata(ctx, field) case "metadata": return ec.fieldContext_Issue_metadata(ctx, field) } @@ -18771,6 +18836,8 @@ func (ec *executionContext) fieldContext_IssueVariant_issue(_ context.Context, f return ec.fieldContext_Issue_issueMatches(ctx, field) case "componentVersions": return ec.fieldContext_Issue_componentVersions(ctx, field) + case "issueMetadata": + return ec.fieldContext_Issue_issueMetadata(ctx, field) case "metadata": return ec.fieldContext_Issue_metadata(ctx, field) } @@ -21308,6 +21375,8 @@ func (ec *executionContext) fieldContext_Mutation_createIssue(ctx context.Contex return ec.fieldContext_Issue_issueMatches(ctx, field) case "componentVersions": return ec.fieldContext_Issue_componentVersions(ctx, field) + case "issueMetadata": + return ec.fieldContext_Issue_issueMetadata(ctx, field) case "metadata": return ec.fieldContext_Issue_metadata(ctx, field) } @@ -21385,6 +21454,8 @@ func (ec *executionContext) fieldContext_Mutation_updateIssue(ctx context.Contex return ec.fieldContext_Issue_issueMatches(ctx, field) case "componentVersions": return ec.fieldContext_Issue_componentVersions(ctx, field) + case "issueMetadata": + return ec.fieldContext_Issue_issueMetadata(ctx, field) case "metadata": return ec.fieldContext_Issue_metadata(ctx, field) } @@ -21517,6 +21588,8 @@ func (ec *executionContext) fieldContext_Mutation_addComponentVersionToIssue(ctx return ec.fieldContext_Issue_issueMatches(ctx, field) case "componentVersions": return ec.fieldContext_Issue_componentVersions(ctx, field) + case "issueMetadata": + return ec.fieldContext_Issue_issueMetadata(ctx, field) case "metadata": return ec.fieldContext_Issue_metadata(ctx, field) } @@ -21594,6 +21667,8 @@ func (ec *executionContext) fieldContext_Mutation_removeComponentVersionFromIssu return ec.fieldContext_Issue_issueMatches(ctx, field) case "componentVersions": return ec.fieldContext_Issue_componentVersions(ctx, field) + case "issueMetadata": + return ec.fieldContext_Issue_issueMetadata(ctx, field) case "metadata": return ec.fieldContext_Issue_metadata(ctx, field) } @@ -33233,6 +33308,28 @@ func (ec *executionContext) _Issue(ctx context.Context, sel ast.SelectionSet, ob continue } out.Values[i] = ec._Issue_componentVersions(ctx, field, obj) + case "issueMetadata": + field := field + + 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 ec._Issue_issueMetadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Issue_issueMetadata(ctx, field, obj) case "metadata": field := field diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index 03c65cde..21cd0f06 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -151,6 +151,7 @@ func NewIssue(issue *entity.Issue) Issue { Type: &issueType, Description: &issue.Description, LastModified: &lastModified, + Metadata: getModelMetadata(issue.Metadata), } } @@ -158,10 +159,10 @@ func NewIssueWithAggregations(issue *entity.IssueResult) Issue { lastModified := issue.Issue.UpdatedAt.String() issueType := IssueTypes(issue.Type.String()) - var metadata IssueMetadata + var issueMetadata IssueMetadata if issue.IssueAggregations != nil { - metadata = IssueMetadata{ + issueMetadata = IssueMetadata{ ServiceCount: int(issue.IssueAggregations.AffectedServices), ActivityCount: int(issue.IssueAggregations.Activites), IssueMatchCount: int(issue.IssueAggregations.IssueMatches), @@ -173,11 +174,12 @@ func NewIssueWithAggregations(issue *entity.IssueResult) Issue { } return Issue{ - ID: fmt.Sprintf("%d", issue.Issue.Id), - PrimaryName: &issue.Issue.PrimaryName, - Type: &issueType, - LastModified: &lastModified, - Metadata: &metadata, + ID: fmt.Sprintf("%d", issue.Issue.Id), + PrimaryName: &issue.Issue.PrimaryName, + Type: &issueType, + LastModified: &lastModified, + IssueMetadata: &issueMetadata, + Metadata: getModelMetadata(issue.Issue.Metadata), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index 4b6917b5..47bbe4af 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -309,7 +309,8 @@ type Issue struct { Activities *ActivityConnection `json:"activities,omitempty"` IssueMatches *IssueMatchConnection `json:"issueMatches,omitempty"` ComponentVersions *ComponentVersionConnection `json:"componentVersions,omitempty"` - Metadata *IssueMetadata `json:"metadata,omitempty"` + IssueMetadata *IssueMetadata `json:"issueMetadata,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (Issue) IsNode() {} diff --git a/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql b/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql index 2fbfbcbe..c81db043 100644 --- a/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql +++ b/internal/api/graphql/graph/queryCollection/issue/directRelations.graphql @@ -81,7 +81,7 @@ query ($filter: IssueFilter, $first: Int, $after: String) { nextPageAfter } } - metadata { + issueMetadata { serviceCount activityCount issueMatchCount diff --git a/internal/api/graphql/graph/schema/issue.graphqls b/internal/api/graphql/graph/schema/issue.graphqls index 5236b9f8..7f1251d0 100644 --- a/internal/api/graphql/graph/schema/issue.graphqls +++ b/internal/api/graphql/graph/schema/issue.graphqls @@ -13,7 +13,8 @@ type Issue implements Node { activities(filter: ActivityFilter, first: Int, after: String): ActivityConnection issueMatches(filter: IssueMatchFilter, first: Int, after: String): IssueMatchConnection componentVersions(filter: ComponentVersionFilter, first: Int, after: String): ComponentVersionConnection - metadata: IssueMetadata + issueMetadata: IssueMetadata + metadata: Metadata } type IssueMetadata { diff --git a/internal/app/issue/issue_handler.go b/internal/app/issue/issue_handler.go index cd9ca681..eb17b53f 100644 --- a/internal/app/issue/issue_handler.go +++ b/internal/app/issue/issue_handler.go @@ -160,6 +160,7 @@ func (is *issueHandler) ListIssues(filter *entity.IssueFilter, options *entity.I } func (is *issueHandler) CreateIssue(issue *entity.Issue) (*entity.Issue, error) { + issue.CreatedBy = "Creator" f := &entity.IssueFilter{ PrimaryName: []*string{&issue.PrimaryName}, } @@ -193,6 +194,7 @@ func (is *issueHandler) CreateIssue(issue *entity.Issue) (*entity.Issue, error) } func (is *issueHandler) UpdateIssue(issue *entity.Issue) (*entity.Issue, error) { + issue.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueEventName, "object": issue, diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index 8fc26b6b..ac1da2f5 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -87,8 +87,10 @@ type IssueRow struct { PrimaryName sql.NullString `db:"issue_primary_name" json:"primary_name"` Description sql.NullString `db:"issue_description" json:"description"` CreatedAt sql.NullTime `db:"issue_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"issue_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issue_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issue_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"issue_updated_by" json:"updated_by"` } func (ir *IssueRow) AsIssue() entity.Issue { @@ -102,8 +104,10 @@ func (ir *IssueRow) AsIssue() entity.Issue { Activity: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ir.CreatedAt), + CreatedBy: GetStringValue(ir.CreatedBy), DeletedAt: GetTimeValue(ir.DeletedAt), UpdatedAt: GetTimeValue(ir.UpdatedAt), + UpdatedBy: GetStringValue(ir.UpdatedBy), }, } } @@ -144,8 +148,10 @@ func (ibr *GetIssuesByRow) AsIssueWithAggregations() entity.IssueWithAggregation Activity: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), + CreatedBy: GetStringValue(ibr.IssueRow.CreatedBy), DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), + UpdatedBy: GetStringValue(ibr.IssueRow.UpdatedBy), }, }, } @@ -162,8 +168,10 @@ func (ibr *GetIssuesByRow) AsIssue() entity.Issue { Activity: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), + CreatedBy: GetStringValue(ibr.IssueRow.CreatedBy), DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), + UpdatedBy: GetStringValue(ibr.IssueRow.UpdatedBy), }, } } @@ -186,8 +194,10 @@ func (ir *IssueRow) FromIssue(i *entity.Issue) { ir.Type = sql.NullString{String: i.Type.String(), Valid: true} ir.Description = sql.NullString{String: i.Description, Valid: true} ir.CreatedAt = sql.NullTime{Time: i.CreatedAt, Valid: true} + ir.CreatedBy = sql.NullString{String: i.CreatedBy, Valid: true} ir.DeletedAt = sql.NullTime{Time: i.DeletedAt, Valid: true} ir.UpdatedAt = sql.NullTime{Time: i.UpdatedAt, Valid: true} + ir.UpdatedBy = sql.NullString{String: i.UpdatedBy, Valid: true} } type IssueMatchRow struct { diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index dc280ca5..fc11c5e8 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -211,8 +211,8 @@ create table if not exists IssueRepository issuerepository_id int unsigned auto_increment primary key, issuerepository_name varchar(2048) not null, issuerepository_url varchar(2048) not null, - issuerepository_created_by varchar(256) null, issuerepository_created_at timestamp default current_timestamp() not null, + issuerepository_created_by varchar(256) null, issuerepository_deleted_at timestamp null, issuerepository_updated_at timestamp default current_timestamp() not null on update current_timestamp(), issuerepository_updated_by varchar(256) null, @@ -230,8 +230,10 @@ create table if not exists Issue issue_primary_name varchar(256) not null, issue_description longtext not null, issue_created_at timestamp default current_timestamp() not null, + issue_created_by varchar(256) null, issue_deleted_at timestamp null, issue_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + issue_updated_by varchar(256) null, constraint id_UNIQUE unique (issue_id), constraint name_UNIQUE diff --git a/internal/database/mariadb/issue.go b/internal/database/mariadb/issue.go index c1428539..ce12ffe1 100644 --- a/internal/database/mariadb/issue.go +++ b/internal/database/mariadb/issue.go @@ -112,6 +112,9 @@ func (s *SqlDatabase) getIssueUpdateFields(issue *entity.Issue) string { if issue.Description != "" { fl = append(fl, "issue_description = :issue_description") } + if issue.UpdatedBy != "" { + fl = append(fl, "issue_updated_by = :issue_updated_by") + } return strings.Join(fl, ", ") } @@ -359,11 +362,13 @@ func (s *SqlDatabase) CreateIssue(issue *entity.Issue) (*entity.Issue, error) { INSERT INTO Issue ( issue_primary_name, issue_type, - issue_description + issue_description, + issue_updated_by ) VALUES ( :issue_primary_name, :issue_type, - :issue_description + :issue_description, + :issue_updated_by ) ` From 6d15ae2065230078da906d77a3deb923f46d196f Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 2 Oct 2024 16:51:02 +0200 Subject: [PATCH 08/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Add metadata for IssueMatch --- internal/api/graphql/graph/generated.go | 95 +++++++++++++++++++ internal/api/graphql/graph/model/models.go | 1 + .../api/graphql/graph/model/models_gen.go | 1 + .../graphql/graph/schema/issue_match.graphqls | 1 + .../app/issue_match/issue_match_handler.go | 2 + internal/database/mariadb/entity.go | 6 ++ internal/database/mariadb/init/schema.sql | 2 + internal/database/mariadb/issue_match.go | 9 +- 8 files changed, 115 insertions(+), 2 deletions(-) diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index 47b9b179..42f00a71 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -262,6 +262,7 @@ type ComplexityRoot struct { Issue func(childComplexity int) int IssueID func(childComplexity int) int IssueMatchChanges func(childComplexity int, filter *model.IssueMatchChangeFilter, first *int, after *string) int + Metadata func(childComplexity int) int RemediationDate func(childComplexity int) int Severity func(childComplexity int) int Status func(childComplexity int) int @@ -1688,6 +1689,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueMatch.IssueMatchChanges(childComplexity, args["filter"].(*model.IssueMatchChangeFilter), args["first"].(*int), args["after"].(*string)), true + case "IssueMatch.metadata": + if e.complexity.IssueMatch.Metadata == nil { + break + } + + return e.complexity.IssueMatch.Metadata(childComplexity), true + case "IssueMatch.remediationDate": if e.complexity.IssueMatch.RemediationDate == nil { break @@ -16322,6 +16330,59 @@ func (ec *executionContext) fieldContext_IssueMatch_issueMatchChanges(ctx contex return fc, nil } +func (ec *executionContext) _IssueMatch_metadata(ctx context.Context, field graphql.CollectedField, obj *model.IssueMatch) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IssueMatch_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IssueMatch_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IssueMatch", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _IssueMatchChange_id(ctx context.Context, field graphql.CollectedField, obj *model.IssueMatchChange) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IssueMatchChange_id(ctx, field) if err != nil { @@ -16517,6 +16578,8 @@ func (ec *executionContext) fieldContext_IssueMatchChange_issueMatch(_ context.C return ec.fieldContext_IssueMatch_componentInstance(ctx, field) case "issueMatchChanges": return ec.fieldContext_IssueMatch_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatch_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatch", field.Name) }, @@ -17085,6 +17148,8 @@ func (ec *executionContext) fieldContext_IssueMatchEdge_node(_ context.Context, return ec.fieldContext_IssueMatch_componentInstance(ctx, field) case "issueMatchChanges": return ec.fieldContext_IssueMatch_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatch_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatch", field.Name) }, @@ -22176,6 +22241,8 @@ func (ec *executionContext) fieldContext_Mutation_createIssueMatch(ctx context.C return ec.fieldContext_IssueMatch_componentInstance(ctx, field) case "issueMatchChanges": return ec.fieldContext_IssueMatch_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatch_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatch", field.Name) }, @@ -22263,6 +22330,8 @@ func (ec *executionContext) fieldContext_Mutation_updateIssueMatch(ctx context.C return ec.fieldContext_IssueMatch_componentInstance(ctx, field) case "issueMatchChanges": return ec.fieldContext_IssueMatch_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatch_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatch", field.Name) }, @@ -22405,6 +22474,8 @@ func (ec *executionContext) fieldContext_Mutation_addEvidenceToIssueMatch(ctx co return ec.fieldContext_IssueMatch_componentInstance(ctx, field) case "issueMatchChanges": return ec.fieldContext_IssueMatch_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatch_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatch", field.Name) }, @@ -22492,6 +22563,8 @@ func (ec *executionContext) fieldContext_Mutation_removeEvidenceFromIssueMatch(c return ec.fieldContext_IssueMatch_componentInstance(ctx, field) case "issueMatchChanges": return ec.fieldContext_IssueMatch_issueMatchChanges(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatch_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatch", field.Name) }, @@ -33987,6 +34060,28 @@ func (ec *executionContext) _IssueMatch(ctx context.Context, sel ast.SelectionSe continue } out.Values[i] = ec._IssueMatch_issueMatchChanges(ctx, field, obj) + case "metadata": + field := field + + 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 ec._IssueMatch_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatch_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index 21cd0f06..c4680630 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -211,6 +211,7 @@ func NewIssueMatch(im *entity.IssueMatch) IssueMatch { IssueID: util.Ptr(fmt.Sprintf("%d", im.IssueId)), ComponentInstanceID: util.Ptr(fmt.Sprintf("%d", im.ComponentInstanceId)), UserID: util.Ptr(fmt.Sprintf("%d", im.UserId)), + Metadata: getModelMetadata(im.Metadata), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index 47bbe4af..46846788 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -369,6 +369,7 @@ type IssueMatch struct { ComponentInstanceID *string `json:"componentInstanceId,omitempty"` ComponentInstance *ComponentInstance `json:"componentInstance"` IssueMatchChanges *IssueMatchChangeConnection `json:"issueMatchChanges,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (IssueMatch) IsNode() {} diff --git a/internal/api/graphql/graph/schema/issue_match.graphqls b/internal/api/graphql/graph/schema/issue_match.graphqls index 479a82f8..c25aaabf 100644 --- a/internal/api/graphql/graph/schema/issue_match.graphqls +++ b/internal/api/graphql/graph/schema/issue_match.graphqls @@ -17,6 +17,7 @@ type IssueMatch implements Node { componentInstanceId: String componentInstance: ComponentInstance! issueMatchChanges(filter: IssueMatchChangeFilter, first: Int, after: String): IssueMatchChangeConnection + metadata: Metadata } input IssueMatchInput { diff --git a/internal/app/issue_match/issue_match_handler.go b/internal/app/issue_match/issue_match_handler.go index 49f4de05..a8a10010 100644 --- a/internal/app/issue_match/issue_match_handler.go +++ b/internal/app/issue_match/issue_match_handler.go @@ -136,6 +136,7 @@ func (im *issueMatchHandler) ListIssueMatches(filter *entity.IssueMatchFilter, o } func (im *issueMatchHandler) CreateIssueMatch(issueMatch *entity.IssueMatch) (*entity.IssueMatch, error) { + issueMatch.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateIssueMatchEventName, "object": issueMatch, @@ -170,6 +171,7 @@ func (im *issueMatchHandler) CreateIssueMatch(issueMatch *entity.IssueMatch) (*e } func (im *issueMatchHandler) UpdateIssueMatch(issueMatch *entity.IssueMatch) (*entity.IssueMatch, error) { + issueMatch.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueMatchEventName, "object": issueMatch, diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index ac1da2f5..c26d4b0d 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -211,8 +211,10 @@ type IssueMatchRow struct { RemediationDate sql.NullTime `db:"issuematch_remediation_date" json:"remediation_date"` TargetRemediationDate sql.NullTime `db:"issuematch_target_remediation_date" json:"target_remediation_date"` CreatedAt sql.NullTime `db:"issuematch_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"issuematch_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuematch_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuematch_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"issuematch_updated_by" json:"updated_by"` } func (imr IssueMatchRow) AsIssueMatch() entity.IssueMatch { @@ -230,8 +232,10 @@ func (imr IssueMatchRow) AsIssueMatch() entity.IssueMatch { Severity: entity.NewSeverity(GetStringValue(imr.Vector)), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(imr.CreatedAt), + CreatedBy: GetStringValue(imr.CreatedBy), DeletedAt: GetTimeValue(imr.DeletedAt), UpdatedAt: GetTimeValue(imr.UpdatedAt), + UpdatedBy: GetStringValue(imr.UpdatedBy), }, } } @@ -247,8 +251,10 @@ func (imr *IssueMatchRow) FromIssueMatch(im *entity.IssueMatch) { imr.RemediationDate = sql.NullTime{Time: im.RemediationDate, Valid: true} imr.TargetRemediationDate = sql.NullTime{Time: im.TargetRemediationDate, Valid: true} imr.CreatedAt = sql.NullTime{Time: im.CreatedAt, Valid: true} + imr.CreatedBy = sql.NullString{String: im.CreatedBy, Valid: true} imr.DeletedAt = sql.NullTime{Time: im.DeletedAt, Valid: true} imr.UpdatedAt = sql.NullTime{Time: im.UpdatedAt, Valid: true} + imr.UpdatedBy = sql.NullString{String: im.UpdatedBy, Valid: true} } type IssueRepositoryRow struct { diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index fc11c5e8..0844bb5b 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -310,8 +310,10 @@ create table if not exists IssueMatch issuematch_component_instance_id int unsigned not null, issuematch_created_at timestamp default current_timestamp() not null, + issuematch_created_by varchar(256) null, issuematch_deleted_at timestamp null, issuematch_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + issuematch_updated_by varchar(256) null, constraint id_UNIQUE unique (issuematch_id), constraint fk_issue_match_user_id diff --git a/internal/database/mariadb/issue_match.go b/internal/database/mariadb/issue_match.go index e851ef82..672196b5 100644 --- a/internal/database/mariadb/issue_match.go +++ b/internal/database/mariadb/issue_match.go @@ -122,6 +122,9 @@ func (s *SqlDatabase) getIssueMatchUpdateFields(issueMatch *entity.IssueMatch) s if !issueMatch.TargetRemediationDate.IsZero() { fl = append(fl, "issuematch_target_remediation_date = :issuematch_target_remediation_date") } + if issueMatch.UpdatedBy != "" { + fl = append(fl, "issuematch_updated_by = :issuematch_updated_by") + } return strings.Join(fl, ", ") } @@ -270,7 +273,8 @@ func (s *SqlDatabase) CreateIssueMatch(issueMatch *entity.IssueMatch) (*entity.I issuematch_rating, issuematch_user_id, issuematch_component_instance_id, - issuematch_issue_id + issuematch_issue_id, + issuematch_created_by ) VALUES ( :issuematch_status, :issuematch_remediation_date, @@ -279,7 +283,8 @@ func (s *SqlDatabase) CreateIssueMatch(issueMatch *entity.IssueMatch) (*entity.I :issuematch_rating, :issuematch_user_id, :issuematch_component_instance_id, - :issuematch_issue_id + :issuematch_issue_id, + :issuematch_created_by ) ` From 65343885984918c36aeccbd2419fbff5e6b50d6a Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Thu, 3 Oct 2024 19:12:26 +0200 Subject: [PATCH 09/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Add Metadata for IssueMatchChange, Service and SupportGroup --- internal/api/graphql/graph/generated.go | 285 ++++++++++++++++++ internal/api/graphql/graph/model/models.go | 11 +- .../api/graphql/graph/model/models_gen.go | 3 + .../graph/schema/issue_match_change.graphqls | 1 + .../api/graphql/graph/schema/service.graphqls | 1 + .../graph/schema/support_group.graphqls | 3 +- .../issue_match_change_handler.go | 2 + internal/app/service/service_handler.go | 2 + .../support_group/support_group_handler.go | 2 + internal/database/mariadb/entity.go | 20 ++ internal/database/mariadb/init/schema.sql | 6 + internal/database/mariadb/issue.go | 4 +- .../database/mariadb/issue_match_change.go | 9 +- internal/database/mariadb/service.go | 9 +- internal/database/mariadb/support_group.go | 9 +- 15 files changed, 354 insertions(+), 13 deletions(-) diff --git a/internal/api/graphql/graph/generated.go b/internal/api/graphql/graph/generated.go index 42f00a71..cd762d91 100644 --- a/internal/api/graphql/graph/generated.go +++ b/internal/api/graphql/graph/generated.go @@ -278,6 +278,7 @@ type ComplexityRoot struct { ID func(childComplexity int) int IssueMatch func(childComplexity int) int IssueMatchID func(childComplexity int) int + Metadata func(childComplexity int) int } IssueMatchChangeConnection struct { @@ -473,6 +474,7 @@ type ComplexityRoot struct { ComponentInstances func(childComplexity int, filter *model.ComponentInstanceFilter, first *int, after *string) int ID func(childComplexity int) int IssueRepositories func(childComplexity int, filter *model.IssueRepositoryFilter, first *int, after *string) int + Metadata func(childComplexity int) int Name func(childComplexity int) int Owners func(childComplexity int, filter *model.UserFilter, first *int, after *string) int SupportGroups func(childComplexity int, filter *model.SupportGroupFilter, first *int, after *string) int @@ -505,6 +507,7 @@ type ComplexityRoot struct { SupportGroup struct { ID func(childComplexity int) int + Metadata func(childComplexity int) int Name func(childComplexity int) int Services func(childComplexity int, filter *model.ServiceFilter, first *int, after *string) int Users func(childComplexity int, filter *model.UserFilter, first *int, after *string) int @@ -1780,6 +1783,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.IssueMatchChange.IssueMatchID(childComplexity), true + case "IssueMatchChange.metadata": + if e.complexity.IssueMatchChange.Metadata == nil { + break + } + + return e.complexity.IssueMatchChange.Metadata(childComplexity), true + case "IssueMatchChangeConnection.edges": if e.complexity.IssueMatchChangeConnection.Edges == nil { break @@ -3152,6 +3162,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Service.IssueRepositories(childComplexity, args["filter"].(*model.IssueRepositoryFilter), args["first"].(*int), args["after"].(*string)), true + case "Service.metadata": + if e.complexity.Service.Metadata == nil { + break + } + + return e.complexity.Service.Metadata(childComplexity), true + case "Service.name": if e.complexity.Service.Name == nil { break @@ -3301,6 +3318,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.SupportGroup.ID(childComplexity), true + case "SupportGroup.metadata": + if e.complexity.SupportGroup.Metadata == nil { + break + } + + return e.complexity.SupportGroup.Metadata(childComplexity), true + case "SupportGroup.name": if e.complexity.SupportGroup.Name == nil { break @@ -12816,6 +12840,8 @@ func (ec *executionContext) fieldContext_ComponentInstance_service(_ context.Con return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -16688,6 +16714,59 @@ func (ec *executionContext) fieldContext_IssueMatchChange_activity(_ context.Con return fc, nil } +func (ec *executionContext) _IssueMatchChange_metadata(ctx context.Context, field graphql.CollectedField, obj *model.IssueMatchChange) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IssueMatchChange_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IssueMatchChange_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IssueMatchChange", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _IssueMatchChangeConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.IssueMatchChangeConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_IssueMatchChangeConnection_totalCount(ctx, field) if err != nil { @@ -16885,6 +16964,8 @@ func (ec *executionContext) fieldContext_IssueMatchChangeEdge_node(_ context.Con return ec.fieldContext_IssueMatchChange_activityId(ctx, field) case "activity": return ec.fieldContext_IssueMatchChange_activity(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatchChange_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatchChange", field.Name) }, @@ -19720,6 +19801,8 @@ func (ec *executionContext) fieldContext_Mutation_createSupportGroup(ctx context return ec.fieldContext_SupportGroup_users(ctx, field) case "services": return ec.fieldContext_SupportGroup_services(ctx, field) + case "metadata": + return ec.fieldContext_SupportGroup_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) }, @@ -19785,6 +19868,8 @@ func (ec *executionContext) fieldContext_Mutation_updateSupportGroup(ctx context return ec.fieldContext_SupportGroup_users(ctx, field) case "services": return ec.fieldContext_SupportGroup_services(ctx, field) + case "metadata": + return ec.fieldContext_SupportGroup_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) }, @@ -19905,6 +19990,8 @@ func (ec *executionContext) fieldContext_Mutation_addServiceToSupportGroup(ctx c return ec.fieldContext_SupportGroup_users(ctx, field) case "services": return ec.fieldContext_SupportGroup_services(ctx, field) + case "metadata": + return ec.fieldContext_SupportGroup_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) }, @@ -19970,6 +20057,8 @@ func (ec *executionContext) fieldContext_Mutation_removeServiceFromSupportGroup( return ec.fieldContext_SupportGroup_users(ctx, field) case "services": return ec.fieldContext_SupportGroup_services(ctx, field) + case "metadata": + return ec.fieldContext_SupportGroup_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) }, @@ -20035,6 +20124,8 @@ func (ec *executionContext) fieldContext_Mutation_addUserToSupportGroup(ctx cont return ec.fieldContext_SupportGroup_users(ctx, field) case "services": return ec.fieldContext_SupportGroup_services(ctx, field) + case "metadata": + return ec.fieldContext_SupportGroup_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) }, @@ -20100,6 +20191,8 @@ func (ec *executionContext) fieldContext_Mutation_removeUserFromSupportGroup(ctx return ec.fieldContext_SupportGroup_users(ctx, field) case "services": return ec.fieldContext_SupportGroup_services(ctx, field) + case "metadata": + return ec.fieldContext_SupportGroup_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) }, @@ -20762,6 +20855,8 @@ func (ec *executionContext) fieldContext_Mutation_createService(ctx context.Cont return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -20833,6 +20928,8 @@ func (ec *executionContext) fieldContext_Mutation_updateService(ctx context.Cont return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -20959,6 +21056,8 @@ func (ec *executionContext) fieldContext_Mutation_addOwnerToService(ctx context. return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -21030,6 +21129,8 @@ func (ec *executionContext) fieldContext_Mutation_removeOwnerFromService(ctx con return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -21101,6 +21202,8 @@ func (ec *executionContext) fieldContext_Mutation_addIssueRepositoryToService(ct return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -21172,6 +21275,8 @@ func (ec *executionContext) fieldContext_Mutation_removeIssueRepositoryFromServi return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -22634,6 +22739,8 @@ func (ec *executionContext) fieldContext_Mutation_createIssueMatchChange(ctx con return ec.fieldContext_IssueMatchChange_activityId(ctx, field) case "activity": return ec.fieldContext_IssueMatchChange_activity(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatchChange_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatchChange", field.Name) }, @@ -22703,6 +22810,8 @@ func (ec *executionContext) fieldContext_Mutation_updateIssueMatchChange(ctx con return ec.fieldContext_IssueMatchChange_activityId(ctx, field) case "activity": return ec.fieldContext_IssueMatchChange_activity(ctx, field) + case "metadata": + return ec.fieldContext_IssueMatchChange_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type IssueMatchChange", field.Name) }, @@ -25085,6 +25194,59 @@ func (ec *executionContext) fieldContext_Service_componentInstances(ctx context. return fc, nil } +func (ec *executionContext) _Service_metadata(ctx context.Context, field graphql.CollectedField, obj *model.Service) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Service_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Service_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Service", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _ServiceConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.ServiceConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_ServiceConnection_totalCount(ctx, field) if err != nil { @@ -25286,6 +25448,8 @@ func (ec *executionContext) fieldContext_ServiceEdge_node(_ context.Context, fie return ec.fieldContext_Service_issueRepositories(ctx, field) case "componentInstances": return ec.fieldContext_Service_componentInstances(ctx, field) + case "metadata": + return ec.fieldContext_Service_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type Service", field.Name) }, @@ -25953,6 +26117,59 @@ func (ec *executionContext) fieldContext_SupportGroup_services(ctx context.Conte return fc, nil } +func (ec *executionContext) _SupportGroup_metadata(ctx context.Context, field graphql.CollectedField, obj *model.SupportGroup) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SupportGroup_metadata(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.Metadata, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Metadata) + fc.Result = res + return ec.marshalOMetadata2ᚖgithubᚗcomᚋcloudoperatorsᚋheurekaᚋinternalᚋapiᚋgraphqlᚋgraphᚋmodelᚐMetadata(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SupportGroup_metadata(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SupportGroup", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "created_at": + return ec.fieldContext_Metadata_created_at(ctx, field) + case "created_by": + return ec.fieldContext_Metadata_created_by(ctx, field) + case "deleted_at": + return ec.fieldContext_Metadata_deleted_at(ctx, field) + case "updated_at": + return ec.fieldContext_Metadata_updated_at(ctx, field) + case "updated_by": + return ec.fieldContext_Metadata_updated_by(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Metadata", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _SupportGroupConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *model.SupportGroupConnection) (ret graphql.Marshaler) { fc, err := ec.fieldContext_SupportGroupConnection_totalCount(ctx, field) if err != nil { @@ -26146,6 +26363,8 @@ func (ec *executionContext) fieldContext_SupportGroupEdge_node(_ context.Context return ec.fieldContext_SupportGroup_users(ctx, field) case "services": return ec.fieldContext_SupportGroup_services(ctx, field) + case "metadata": + return ec.fieldContext_SupportGroup_metadata(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SupportGroup", field.Name) }, @@ -34257,6 +34476,28 @@ func (ec *executionContext) _IssueMatchChange(ctx context.Context, sel ast.Selec if out.Values[i] == graphql.Null { out.Invalids++ } + case "metadata": + field := field + + 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 ec._IssueMatchChange_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._IssueMatchChange_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -37164,6 +37405,28 @@ func (ec *executionContext) _Service(ctx context.Context, sel ast.SelectionSet, continue } out.Values[i] = ec._Service_componentInstances(ctx, field, obj) + case "metadata": + field := field + + 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 ec._Service_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._Service_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -37717,6 +37980,28 @@ func (ec *executionContext) _SupportGroup(ctx context.Context, sel ast.Selection continue } out.Values[i] = ec._SupportGroup_services(ctx, field, obj) + case "metadata": + field := field + + 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 ec._SupportGroup_metadata(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + out.Values[i] = ec._SupportGroup_metadata(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index c4680630..f8d30c13 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -247,6 +247,7 @@ func NewIssueMatchChange(imc *entity.IssueMatchChange) IssueMatchChange { IssueMatch: nil, ActivityID: util.Ptr(fmt.Sprintf("%d", imc.ActivityId)), Activity: nil, + Metadata: getModelMetadata(imc.Metadata), } } @@ -340,8 +341,9 @@ func NewUserEntity(user *UserInput) entity.User { func NewService(s *entity.Service) Service { return Service{ - ID: fmt.Sprintf("%d", s.Id), - Name: &s.Name, + ID: fmt.Sprintf("%d", s.Id), + Name: &s.Name, + Metadata: getModelMetadata(s.Metadata), } } @@ -355,8 +357,9 @@ func NewServiceEntity(service *ServiceInput) entity.Service { func NewSupportGroup(supportGroup *entity.SupportGroup) SupportGroup { return SupportGroup{ - ID: fmt.Sprintf("%d", supportGroup.Id), - Name: &supportGroup.Name, + ID: fmt.Sprintf("%d", supportGroup.Id), + Name: &supportGroup.Name, + Metadata: getModelMetadata(supportGroup.Metadata), } } diff --git a/internal/api/graphql/graph/model/models_gen.go b/internal/api/graphql/graph/model/models_gen.go index 46846788..ec293ceb 100644 --- a/internal/api/graphql/graph/model/models_gen.go +++ b/internal/api/graphql/graph/model/models_gen.go @@ -382,6 +382,7 @@ type IssueMatchChange struct { IssueMatch *IssueMatch `json:"issueMatch"` ActivityID *string `json:"activityId,omitempty"` Activity *Activity `json:"activity"` + Metadata *Metadata `json:"metadata,omitempty"` } func (IssueMatchChange) IsNode() {} @@ -606,6 +607,7 @@ type Service struct { Activities *ActivityConnection `json:"activities,omitempty"` IssueRepositories *IssueRepositoryConnection `json:"issueRepositories,omitempty"` ComponentInstances *ComponentInstanceConnection `json:"componentInstances,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (Service) IsNode() {} @@ -666,6 +668,7 @@ type SupportGroup struct { Name *string `json:"name,omitempty"` Users *UserConnection `json:"users,omitempty"` Services *ServiceConnection `json:"services,omitempty"` + Metadata *Metadata `json:"metadata,omitempty"` } func (SupportGroup) IsNode() {} diff --git a/internal/api/graphql/graph/schema/issue_match_change.graphqls b/internal/api/graphql/graph/schema/issue_match_change.graphqls index 84724ac0..65385d01 100644 --- a/internal/api/graphql/graph/schema/issue_match_change.graphqls +++ b/internal/api/graphql/graph/schema/issue_match_change.graphqls @@ -9,6 +9,7 @@ type IssueMatchChange implements Node { issueMatch: IssueMatch! activityId: String activity: Activity! + metadata: Metadata } input IssueMatchChangeInput { diff --git a/internal/api/graphql/graph/schema/service.graphqls b/internal/api/graphql/graph/schema/service.graphqls index dc202967..a90bfd0e 100644 --- a/internal/api/graphql/graph/schema/service.graphqls +++ b/internal/api/graphql/graph/schema/service.graphqls @@ -9,6 +9,7 @@ type Service implements Node { activities(filter: ActivityFilter, first: Int, after: String): ActivityConnection issueRepositories(filter: IssueRepositoryFilter, first: Int, after: String): IssueRepositoryConnection componentInstances(filter: ComponentInstanceFilter, first: Int, after: String): ComponentInstanceConnection + metadata: Metadata } input ServiceInput { diff --git a/internal/api/graphql/graph/schema/support_group.graphqls b/internal/api/graphql/graph/schema/support_group.graphqls index 9f1df03d..2af7a186 100644 --- a/internal/api/graphql/graph/schema/support_group.graphqls +++ b/internal/api/graphql/graph/schema/support_group.graphqls @@ -6,6 +6,7 @@ type SupportGroup implements Node { name: String users(filter: UserFilter, first: Int, after: String): UserConnection services(filter: ServiceFilter, first: Int, after: String): ServiceConnection + metadata: Metadata } input SupportGroupInput { @@ -26,4 +27,4 @@ type SupportGroupEdge implements Edge { input SupportGroupFilter { supportGroupName: [String], userIds: [String], -} \ No newline at end of file +} diff --git a/internal/app/issue_match_change/issue_match_change_handler.go b/internal/app/issue_match_change/issue_match_change_handler.go index 876a235c..0a8137aa 100644 --- a/internal/app/issue_match_change/issue_match_change_handler.go +++ b/internal/app/issue_match_change/issue_match_change_handler.go @@ -108,6 +108,7 @@ func (imc *issueMatchChangeHandler) ListIssueMatchChanges(filter *entity.IssueMa } func (imc *issueMatchChangeHandler) CreateIssueMatchChange(issueMatchChange *entity.IssueMatchChange) (*entity.IssueMatchChange, error) { + issueMatchChange.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateIssueMatchChangeEventName, "object": issueMatchChange, @@ -128,6 +129,7 @@ func (imc *issueMatchChangeHandler) CreateIssueMatchChange(issueMatchChange *ent } func (imc *issueMatchChangeHandler) UpdateIssueMatchChange(issueMatchChange *entity.IssueMatchChange) (*entity.IssueMatchChange, error) { + issueMatchChange.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueMatchChangeEventName, "object": issueMatchChange, diff --git a/internal/app/service/service_handler.go b/internal/app/service/service_handler.go index 415b883a..414b366e 100644 --- a/internal/app/service/service_handler.go +++ b/internal/app/service/service_handler.go @@ -125,6 +125,7 @@ func (s *serviceHandler) ListServices(filter *entity.ServiceFilter, options *ent } func (s *serviceHandler) CreateService(service *entity.Service) (*entity.Service, error) { + service.CreatedBy = "Creator" f := &entity.ServiceFilter{ Name: []*string{&service.Name}, } @@ -159,6 +160,7 @@ func (s *serviceHandler) CreateService(service *entity.Service) (*entity.Service } func (s *serviceHandler) UpdateService(service *entity.Service) (*entity.Service, error) { + service.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateServiceEventName, "object": service, diff --git a/internal/app/support_group/support_group_handler.go b/internal/app/support_group/support_group_handler.go index bb76a40b..e07535c1 100644 --- a/internal/app/support_group/support_group_handler.go +++ b/internal/app/support_group/support_group_handler.go @@ -133,6 +133,7 @@ func (sg *supportGroupHandler) ListSupportGroups(filter *entity.SupportGroupFilt } func (sg *supportGroupHandler) CreateSupportGroup(supportGroup *entity.SupportGroup) (*entity.SupportGroup, error) { + supportGroup.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateSupportGroupEventName, "object": supportGroup, @@ -168,6 +169,7 @@ func (sg *supportGroupHandler) CreateSupportGroup(supportGroup *entity.SupportGr } func (sg *supportGroupHandler) UpdateSupportGroup(supportGroup *entity.SupportGroup) (*entity.SupportGroup, error) { + supportGroup.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateSupportGroupEventName, "object": supportGroup, diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index c26d4b0d..411332af 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -498,8 +498,10 @@ type SupportGroupRow struct { Id sql.NullInt64 `db:"supportgroup_id" json:"id"` Name sql.NullString `db:"supportgroup_name" json:"name"` CreatedAt sql.NullTime `db:"supportgroup_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"supportgroup_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"supportgroup_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"supportgroup_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"supportgroup_updated_by" json:"updated_by"` } func (sgr *SupportGroupRow) AsSupportGroup() entity.SupportGroup { @@ -508,8 +510,10 @@ func (sgr *SupportGroupRow) AsSupportGroup() entity.SupportGroup { Name: GetStringValue(sgr.Name), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(sgr.CreatedAt), + CreatedBy: GetStringValue(sgr.CreatedBy), DeletedAt: GetTimeValue(sgr.DeletedAt), UpdatedAt: GetTimeValue(sgr.UpdatedAt), + UpdatedBy: GetStringValue(sgr.UpdatedBy), }, } } @@ -518,8 +522,10 @@ func (sgr *SupportGroupRow) FromSupportGroup(sg *entity.SupportGroup) { sgr.Id = sql.NullInt64{Int64: sg.Id, Valid: true} sgr.Name = sql.NullString{String: sg.Name, Valid: true} sgr.CreatedAt = sql.NullTime{Time: sg.CreatedAt, Valid: true} + sgr.CreatedBy = sql.NullString{String: sg.CreatedBy, Valid: true} sgr.DeletedAt = sql.NullTime{Time: sg.DeletedAt, Valid: true} sgr.UpdatedAt = sql.NullTime{Time: sg.UpdatedAt, Valid: true} + sgr.UpdatedBy = sql.NullString{String: sg.UpdatedBy, Valid: true} } type ServiceRow struct { @@ -531,8 +537,10 @@ type BaseServiceRow struct { Id sql.NullInt64 `db:"service_id" json:"id"` Name sql.NullString `db:"service_name" json:"name"` CreatedAt sql.NullTime `db:"service_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"service_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"service_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"service_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"service_updated_by" json:"updated_by"` } func (bsr *BaseServiceRow) AsBaseService() entity.BaseService { @@ -543,8 +551,10 @@ func (bsr *BaseServiceRow) AsBaseService() entity.BaseService { Activities: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(bsr.CreatedAt), + CreatedBy: GetStringValue(bsr.CreatedBy), DeletedAt: GetTimeValue(bsr.DeletedAt), UpdatedAt: GetTimeValue(bsr.UpdatedAt), + UpdatedBy: GetStringValue(bsr.UpdatedBy), }, } } @@ -565,8 +575,10 @@ func (sr *ServiceRow) AsService() entity.Service { Activities: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(sr.BaseServiceRow.CreatedAt), + CreatedBy: GetStringValue(sr.BaseServiceRow.CreatedBy), DeletedAt: GetTimeValue(sr.BaseServiceRow.DeletedAt), UpdatedAt: GetTimeValue(sr.BaseServiceRow.UpdatedAt), + UpdatedBy: GetStringValue(sr.BaseServiceRow.UpdatedBy), }, }, IssueRepositoryService: entity.IssueRepositoryService{ @@ -580,8 +592,10 @@ func (sr *ServiceRow) FromService(s *entity.Service) { sr.Id = sql.NullInt64{Int64: s.Id, Valid: true} sr.Name = sql.NullString{String: s.Name, Valid: true} sr.BaseServiceRow.CreatedAt = sql.NullTime{Time: s.BaseService.CreatedAt, Valid: true} + sr.BaseServiceRow.CreatedBy = sql.NullString{String: s.BaseService.CreatedBy, Valid: true} sr.BaseServiceRow.DeletedAt = sql.NullTime{Time: s.BaseService.DeletedAt, Valid: true} sr.BaseServiceRow.UpdatedAt = sql.NullTime{Time: s.BaseService.UpdatedAt, Valid: true} + sr.BaseServiceRow.UpdatedBy = sql.NullString{String: s.BaseService.UpdatedBy, Valid: true} } type ActivityRow struct { @@ -766,8 +780,10 @@ type IssueMatchChangeRow struct { ActivityId sql.NullInt64 `db:"issuematchchange_activity_id" json:"activity_id"` Action sql.NullString `db:"issuematchchange_action" json:"action"` CreatedAt sql.NullTime `db:"issuematchchange_created_at" json:"created_at"` + CreatedBy sql.NullString `db:"issuematchchange_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuematchchange_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuematchchange_updated_at" json:"updated_at"` + UpdatedBy sql.NullString `db:"issuematchchange_updated_by" json:"updated_by"` } func (imcr *IssueMatchChangeRow) AsIssueMatchChange() entity.IssueMatchChange { @@ -778,8 +794,10 @@ func (imcr *IssueMatchChangeRow) AsIssueMatchChange() entity.IssueMatchChange { Action: GetStringValue(imcr.Action), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(imcr.CreatedAt), + CreatedBy: GetStringValue(imcr.CreatedBy), DeletedAt: GetTimeValue(imcr.DeletedAt), UpdatedAt: GetTimeValue(imcr.UpdatedAt), + UpdatedBy: GetStringValue(imcr.UpdatedBy), }, } } @@ -790,8 +808,10 @@ func (imcr *IssueMatchChangeRow) FromIssueMatchChange(imc *entity.IssueMatchChan imcr.ActivityId = sql.NullInt64{Int64: imc.ActivityId, Valid: true} imcr.Action = sql.NullString{String: imc.Action, Valid: true} imcr.CreatedAt = sql.NullTime{Time: imc.CreatedAt, Valid: true} + imcr.CreatedBy = sql.NullString{String: imc.CreatedBy, Valid: true} imcr.DeletedAt = sql.NullTime{Time: imc.DeletedAt, Valid: true} imcr.UpdatedAt = sql.NullTime{Time: imc.UpdatedAt, Valid: true} + imcr.UpdatedBy = sql.NullString{String: imc.UpdatedBy, Valid: true} } type OwnerRow struct { diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index 0844bb5b..0bf4953b 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -48,8 +48,10 @@ create table if not exists SupportGroup primary key, supportgroup_name varchar(256) not null, supportgroup_created_at timestamp default current_timestamp() not null, + supportgroup_created_by varchar(256) null, supportgroup_deleted_at timestamp null, supportgroup_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + supportgroup_updated_by varchar(256) null, constraint id_UNIQUE unique (supportgroup_id), constraint name_UNIQUE @@ -62,8 +64,10 @@ create table if not exists Service primary key, service_name varchar(256) not null, service_created_at timestamp default current_timestamp() not null, + service_created_by varchar(256) null, service_deleted_at timestamp null, service_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + service_updated_by varchar(256) null, constraint id_UNIQUE unique (service_id), constraint name_UNIQUE @@ -335,8 +339,10 @@ create table if not exists IssueMatchChange issuematchchange_issue_match_id int unsigned not null, issuematchchange_action enum('add','remove') not null, issuematchchange_created_at timestamp default current_timestamp() not null, + issuematchchange_created_by varchar(256) null, issuematchchange_deleted_at timestamp null, issuematchchange_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + issuematchchange_updated_by varchar(256) null, constraint fk_issuematchchange_activity foreign key (issuematchchange_activity_id) references Activity (activity_id), constraint fk_issuematchchange_issue_match diff --git a/internal/database/mariadb/issue.go b/internal/database/mariadb/issue.go index ce12ffe1..cb187c68 100644 --- a/internal/database/mariadb/issue.go +++ b/internal/database/mariadb/issue.go @@ -363,12 +363,12 @@ func (s *SqlDatabase) CreateIssue(issue *entity.Issue) (*entity.Issue, error) { issue_primary_name, issue_type, issue_description, - issue_updated_by + issue_created_by ) VALUES ( :issue_primary_name, :issue_type, :issue_description, - :issue_updated_by + :issue_created_by ) ` diff --git a/internal/database/mariadb/issue_match_change.go b/internal/database/mariadb/issue_match_change.go index 264d295b..8049b018 100644 --- a/internal/database/mariadb/issue_match_change.go +++ b/internal/database/mariadb/issue_match_change.go @@ -46,6 +46,9 @@ func (s *SqlDatabase) getIssueMatchChangeUpdateFields(imc *entity.IssueMatchChan if imc.Action != "" { fl = append(fl, "issuematchchange_action = :issuematchchange_action") } + if imc.UpdatedBy != "" { + fl = append(fl, "issuematchchange_updated_by = :issuematchchange_updated_by") + } return strings.Join(fl, ", ") } @@ -181,11 +184,13 @@ func (s *SqlDatabase) CreateIssueMatchChange(imc *entity.IssueMatchChange) (*ent INSERT INTO IssueMatchChange ( issuematchchange_action, issuematchchange_activity_id, - issuematchchange_issue_match_id + issuematchchange_issue_match_id, + issuematchchange_created_by ) VALUES ( :issuematchchange_action, :issuematchchange_activity_id, - :issuematchchange_issue_match_id + :issuematchchange_issue_match_id, + :issuematchchange_created_by ) ` diff --git a/internal/database/mariadb/service.go b/internal/database/mariadb/service.go index 65e15cb4..ca22ca46 100644 --- a/internal/database/mariadb/service.go +++ b/internal/database/mariadb/service.go @@ -115,6 +115,9 @@ func (s *SqlDatabase) getServiceUpdateFields(service *entity.Service) string { if service.Name != "" { fl = append(fl, "service_name = :service_name") } + if service.UpdatedBy != "" { + fl = append(fl, "service_updated_by = :service_updated_by") + } return strings.Join(fl, ", ") } @@ -260,9 +263,11 @@ func (s *SqlDatabase) CreateService(service *entity.Service) (*entity.Service, e query := ` INSERT INTO Service ( - service_name + service_name, + service_created_by ) VALUES ( - :service_name + :service_name, + :service_created_by ) ` diff --git a/internal/database/mariadb/support_group.go b/internal/database/mariadb/support_group.go index 2074f04f..7ee812bf 100644 --- a/internal/database/mariadb/support_group.go +++ b/internal/database/mariadb/support_group.go @@ -28,6 +28,9 @@ func (s *SqlDatabase) getSupportGroupUpdateFields(supportGroup *entity.SupportGr if supportGroup.Name != "" { fl = append(fl, "supportgroup_name = :supportgroup_name") } + if supportGroup.UpdatedBy != "" { + fl = append(fl, "supportgroup_updated_by = :supportgroup_updated_by") + } return strings.Join(fl, ", ") } @@ -206,9 +209,11 @@ func (s *SqlDatabase) CreateSupportGroup(supportGroup *entity.SupportGroup) (*en query := ` INSERT INTO SupportGroup ( - supportgroup_name + supportgroup_name, + supportgroup_created_by ) VALUES ( - :supportgroup_name + :supportgroup_name, + :supportgroup_created_by ) ` From 8dd97ebabf7952ec1ea01bc378c07cbaf8e14eeb Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 9 Oct 2024 12:01:05 +0200 Subject: [PATCH 10/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Refactor and review fixes --- .../graphql/graph/schema/activity.graphqls | 2 +- .../graph/schema/issue_variant.graphqls | 4 +- internal/e2e/common/user.go | 105 ++++++++++++++++ internal/e2e/metadata_test.go | 116 ++++-------------- internal/e2e/user_query_test.go | 67 ++-------- 5 files changed, 139 insertions(+), 155 deletions(-) create mode 100644 internal/e2e/common/user.go diff --git a/internal/api/graphql/graph/schema/activity.graphqls b/internal/api/graphql/graph/schema/activity.graphqls index 2ebe53b2..9e911725 100644 --- a/internal/api/graphql/graph/schema/activity.graphqls +++ b/internal/api/graphql/graph/schema/activity.graphqls @@ -24,7 +24,7 @@ type ActivityConnection implements Connection { type ActivityEdge implements Edge { node: Activity! cursor: String - metadata: Metadata + metadata: Metadata } input ActivityFilter { diff --git a/internal/api/graphql/graph/schema/issue_variant.graphqls b/internal/api/graphql/graph/schema/issue_variant.graphqls index 36d1d9be..8f688f65 100644 --- a/internal/api/graphql/graph/schema/issue_variant.graphqls +++ b/internal/api/graphql/graph/schema/issue_variant.graphqls @@ -10,7 +10,7 @@ type IssueVariant implements Node { issueRepository: IssueRepository issueId: String issue: Issue - metadata: Metadata + metadata: Metadata } input IssueVariantInput { @@ -30,7 +30,7 @@ type IssueVariantConnection implements Connection { type IssueVariantEdge implements Edge { node: IssueVariant! cursor: String - metadata: Metadata + metadata: Metadata } input IssueVariantFilter { diff --git a/internal/e2e/common/user.go b/internal/e2e/common/user.go new file mode 100644 index 00000000..b36c4ab3 --- /dev/null +++ b/internal/e2e/common/user.go @@ -0,0 +1,105 @@ +// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +// SPDX-License-Identifier: Apache-2.0 + +package e2e_common + +import ( + "context" + "fmt" + "os" + + "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" + "github.com/cloudoperators/heureka/internal/entity" + util2 "github.com/cloudoperators/heureka/pkg/util" + + "github.com/machinebox/graphql" + . "github.com/onsi/gomega" + "github.com/sirupsen/logrus" +) + +type User struct { + Id string + Type entity.UserType + Name string +} + +func QueryCreateUser(port string, user User) *model.User { + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/create.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("input", map[string]string{ + "uniqueUserId": user.Id, + "type": entity.GetUserTypeString(user.Type), + "name": user.Name, + }) + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + User model.User `json:"createUser"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + return &respData.User +} + +func QueryUpdateUser(port string, user User) *model.User { + // create a queryCollection (safe to share across requests) + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/update.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("id", user.Id) + req.Var("input", map[string]string{ + "name": user.Name, + "type": entity.GetUserTypeString(user.Type), + }) + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + User model.User `json:"updateUser"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + return &respData.User +} + +func QueryGetUser(port string, userId string) *model.UserConnection { + // create a queryCollection (safe to share across requests) + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/listUsers.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("filter", map[string]string{"uniqueUserId": userId}) + req.Var("first", 1) + req.Var("after", "0") + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + Users model.UserConnection `json:"Users"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + return &respData.Users +} diff --git a/internal/e2e/metadata_test.go b/internal/e2e/metadata_test.go index 262fb648..a86e7a3c 100644 --- a/internal/e2e/metadata_test.go +++ b/internal/e2e/metadata_test.go @@ -4,26 +4,23 @@ package e2e_test import ( - "context" - "fmt" - "os" "time" "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" + "github.com/cloudoperators/heureka/internal/e2e/common" "github.com/cloudoperators/heureka/internal/entity" "github.com/cloudoperators/heureka/internal/server" "github.com/cloudoperators/heureka/internal/util" util2 "github.com/cloudoperators/heureka/pkg/util" - "github.com/machinebox/graphql" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/sirupsen/logrus" ) const ( testUniqueUserId = "1" testUserType = entity.HumanUserType + testUpdatedUserType = entity.TechnicalUserType testUserName = "Joe" testUpdatedUserName = "Donald" testCreatedBy = "Creator" @@ -31,93 +28,24 @@ const ( dbDateLayout = "2006-01-02 15:04:05 -0700 MST" ) -var () - -func createUser(port string) { - client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) - - //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? - b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/create.graphql") - Expect(err).To(BeNil()) - str := string(b) - req := graphql.NewRequest(str) - - req.Var("input", map[string]string{ - "uniqueUserId": testUniqueUserId, - "type": entity.GetUserTypeString(testUserType), - "name": testUserName, - }) - - req.Header.Set("Cache-Control", "no-cache") - ctx := context.Background() - - var respData struct { - User model.User `json:"createUser"` - } - if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { - logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") - } - - Expect(*respData.User.Name).To(Equal(testUserName)) - Expect(*respData.User.UniqueUserID).To(Equal(testUniqueUserId)) - Expect(entity.UserType(respData.User.Type)).To(Equal(testUserType)) +func createTestUser(port string) { + user := e2e_common.QueryCreateUser(port, e2e_common.User{Id: testUniqueUserId, Type: testUserType, Name: testUserName}) + Expect(*user.Name).To(Equal(testUserName)) + Expect(*user.UniqueUserID).To(Equal(testUniqueUserId)) + Expect(entity.UserType(user.Type)).To(Equal(testUserType)) } -func updateUser(port string) { - // create a queryCollection (safe to share across requests) - client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) - - //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? - b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/update.graphql") - Expect(err).To(BeNil()) - str := string(b) - req := graphql.NewRequest(str) - - req.Var("id", testUniqueUserId) - req.Var("input", map[string]string{ - "name": testUpdatedUserName, - }) - - req.Header.Set("Cache-Control", "no-cache") - ctx := context.Background() - - var respData struct { - User model.User `json:"updateUser"` - } - if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { - logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") - } - - Expect(*respData.User.Name).To(Equal(testUpdatedUserName)) - Expect(*respData.User.UniqueUserID).To(Equal(testUniqueUserId)) - Expect(entity.UserType(respData.User.Type)).To(Equal(testUserType)) +func updateTestUser(port string) { + user := e2e_common.QueryUpdateUser(port, e2e_common.User{Id: testUniqueUserId, Type: testUpdatedUserType, Name: testUpdatedUserName}) + Expect(*user.Name).To(Equal(testUpdatedUserName)) + Expect(*user.UniqueUserID).To(Equal(testUniqueUserId)) + Expect(entity.UserType(user.Type)).To(Equal(testUpdatedUserType)) } -func getUser(port string) model.User { - // create a queryCollection (safe to share across requests) - client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) - - //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? - b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/listUsers.graphql") - Expect(err).To(BeNil()) - str := string(b) - req := graphql.NewRequest(str) - - req.Var("filter", map[string]string{"uniqueUserId": testUniqueUserId}) - req.Var("first", 1) - req.Var("after", "0") - - req.Header.Set("Cache-Control", "no-cache") - ctx := context.Background() - - var respData struct { - Users model.UserConnection `json:"Users"` - } - if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { - logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") - } - Expect(respData.Users.TotalCount).To(Equal(1)) - return *respData.Users.Edges[0].Node +func getTestUser(port string) model.User { + users := e2e_common.QueryGetUser(port, testUniqueUserId) + Expect(users.TotalCount).To(Equal(1)) + return *users.Edges[0].Node } var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities"), func() { @@ -141,8 +69,8 @@ var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities" When("New user is created via API", func() { var user model.User BeforeEach(func() { - createUser(cfg.Port) - user = getUser(cfg.Port) + createTestUser(cfg.Port) + user = getTestUser(cfg.Port) }) It("shall assign CreatedBy and CreatedAt metadata fields and shall keep nil in UpdatedBy, UpdatedAt and DeltedAt metadata fields", func() { Expect(entity.UserType(user.Type)).To(Equal(testUserType)) @@ -163,13 +91,13 @@ var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities" When("User is updated via API", func() { var user model.User BeforeEach(func() { - createUser(cfg.Port) + createTestUser(cfg.Port) time.Sleep(1100 * time.Millisecond) - updateUser(cfg.Port) - user = getUser(cfg.Port) + updateTestUser(cfg.Port) + user = getTestUser(cfg.Port) }) It("shall assign UpdatedBy and UpdatedAt metadata fields and shall keep nil in DeletedAt metadata field", func() { - Expect(entity.UserType(user.Type)).To(Equal(testUserType)) + Expect(entity.UserType(user.Type)).To(Equal(testUpdatedUserType)) Expect(user.Metadata).To(Not(BeNil())) Expect(*user.Metadata.CreatedBy).To(Equal(testCreatedBy)) diff --git a/internal/e2e/user_query_test.go b/internal/e2e/user_query_test.go index d57ab0ad..4813acd5 100644 --- a/internal/e2e/user_query_test.go +++ b/internal/e2e/user_query_test.go @@ -21,6 +21,7 @@ import ( "github.com/sirupsen/logrus" "github.com/cloudoperators/heureka/internal/database/mariadb/test" + "github.com/cloudoperators/heureka/internal/e2e/common" testentity "github.com/cloudoperators/heureka/internal/entity/test" "github.com/cloudoperators/heureka/internal/server" ) @@ -229,35 +230,10 @@ var _ = Describe("Creating User via API", Label("e2e", "Users"), func() { Context("and a mutation query is performed", Label("create.graphql"), func() { It("creates new user", func() { - // create a queryCollection (safe to share across requests) - client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", cfg.Port)) - - //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? - b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/create.graphql") - - Expect(err).To(BeNil()) - str := string(b) - req := graphql.NewRequest(str) - - req.Var("input", map[string]string{ - "uniqueUserId": user.UniqueUserID, - "type": entity.GetUserTypeString(user.Type), - "name": user.Name, - }) - - req.Header.Set("Cache-Control", "no-cache") - ctx := context.Background() - - var respData struct { - User model.User `json:"createUser"` - } - if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { - logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") - } - - Expect(*respData.User.Name).To(Equal(user.Name)) - Expect(*respData.User.UniqueUserID).To(Equal(user.UniqueUserID)) - Expect(entity.UserType(respData.User.Type)).To(Equal(user.Type)) + respUser := e2e_common.QueryCreateUser(cfg.Port, e2e_common.User{Id: user.UniqueUserID, Type: user.Type, Name: user.Name}) + Expect(*respUser.Name).To(Equal(user.Name)) + Expect(*respUser.UniqueUserID).To(Equal(user.UniqueUserID)) + Expect(entity.UserType(respUser.Type)).To(Equal(user.Type)) }) }) }) @@ -295,37 +271,12 @@ var _ = Describe("Updating User via API", Label("e2e", "Users"), func() { Context("and a mutation query is performed", Label("update.graphql"), func() { It("updates user", func() { - // create a queryCollection (safe to share across requests) - client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", cfg.Port)) - - //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? - b, err := os.ReadFile("../api/graphql/graph/queryCollection/user/update.graphql") - - Expect(err).To(BeNil()) - str := string(b) - req := graphql.NewRequest(str) - user := seedCollection.UserRows[0].AsUser() user.Name = "Sauron" - - req.Var("id", fmt.Sprintf("%d", user.Id)) - req.Var("input", map[string]string{ - "name": user.Name, - }) - - req.Header.Set("Cache-Control", "no-cache") - ctx := context.Background() - - var respData struct { - User model.User `json:"updateUser"` - } - if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { - logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") - } - - Expect(*respData.User.Name).To(Equal(user.Name)) - Expect(*respData.User.UniqueUserID).To(Equal(user.UniqueUserID)) - Expect(entity.UserType(respData.User.Type)).To(Equal(user.Type)) + respUser := e2e_common.QueryUpdateUser(cfg.Port, e2e_common.User{Id: fmt.Sprintf("%d", user.Id), Name: user.Name, Type: user.Type}) + Expect(*respUser.Name).To(Equal(user.Name)) + Expect(*respUser.UniqueUserID).To(Equal(user.UniqueUserID)) + Expect(entity.UserType(respUser.Type)).To(Equal(user.Type)) }) }) }) From 7889f9192dbb1dfdab8386baf8e78478bd584752 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 9 Oct 2024 14:26:58 +0200 Subject: [PATCH 11/17] feat(authN): Add to all DB entries 'Modified_by'... (#81) Test foreign key --- internal/database/mariadb/init/schema.sql | 44 +++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index 0bf4953b..fb3f5a03 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -5,6 +5,24 @@ create schema if not exists heureka; use heureka; +create table if not exists User +( + user_id int unsigned auto_increment + primary key, + user_name varchar(256) not null, + user_unique_user_id varchar(64) not null, + user_type int unsigned, + user_created_at timestamp default current_timestamp() not null, + user_created_by varchar(256) null, + user_deleted_at timestamp null, + user_updated_at timestamp default current_timestamp() not null on update current_timestamp(), + user_updated_by varchar(256) null, + constraint id_UNIQUE + unique (user_id), + constraint unique_user_id_UNIQUE + unique (user_unique_user_id) +); + create table if not exists Component ( component_id int unsigned auto_increment @@ -19,7 +37,13 @@ create table if not exists Component constraint id_UNIQUE unique (component_id), constraint name_UNIQUE - unique (component_name) + unique (component_name), + constraint fk_component_created_by + foreign key (component_created_by) references User (user_unique_user_id) + on update cascade, + constraint fk_component_updated_by + foreign key (component_updated_by) references User (user_unique_user_id) + on update cascade ); create table if not exists ComponentVersion @@ -130,24 +154,6 @@ create table if not exists ComponentInstance on update cascade ); -create table if not exists User -( - user_id int unsigned auto_increment - primary key, - user_name varchar(256) not null, - user_unique_user_id varchar(64) not null, - user_type int unsigned, - user_created_at timestamp default current_timestamp() not null, - user_created_by varchar(256) null, - user_deleted_at timestamp null, - user_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - user_updated_by varchar(256) null, - constraint id_UNIQUE - unique (user_id), - constraint unique_user_id_UNIQUE - unique (user_unique_user_id) -); - create table if not exists Evidence ( evidence_id int unsigned auto_increment From 70f0cf525e73c9e301394907e5ff6597d6a5ae93 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Tue, 15 Oct 2024 13:22:29 +0200 Subject: [PATCH 12/17] Add Foreign Key --- internal/api/graphql/graph/model/models.go | 10 +- internal/app/activity/activity_handler.go | 18 +- internal/app/common/user_id.go | 19 ++ internal/app/component/component_handler.go | 18 +- .../component_instance_handler.go | 18 +- .../component_version_handler.go | 18 +- internal/app/evidence/evidence_handler.go | 18 +- internal/app/issue/issue_handler.go | 18 +- .../app/issue_match/issue_match_handler.go | 18 +- .../issue_match_change_handler.go | 18 +- .../issue_repository_handler.go | 18 +- .../issue_variant/issue_variant_handler.go | 18 +- internal/app/service/service_handler.go | 18 +- .../support_group/support_group_handler.go | 18 +- internal/app/user/user_handler.go | 18 +- internal/database/mariadb/activity.go | 2 +- internal/database/mariadb/component.go | 2 +- .../database/mariadb/component_instance.go | 2 +- .../database/mariadb/component_version.go | 2 +- internal/database/mariadb/entity.go | 176 +++++++++--------- internal/database/mariadb/evidence.go | 2 +- internal/database/mariadb/init/schema.sql | 134 ++++++++----- internal/database/mariadb/issue.go | 2 +- internal/database/mariadb/issue_match.go | 2 +- .../database/mariadb/issue_match_change.go | 2 +- internal/database/mariadb/issue_repository.go | 2 +- internal/database/mariadb/issue_variant.go | 2 +- internal/database/mariadb/service.go | 2 +- internal/database/mariadb/support_group.go | 2 +- internal/database/mariadb/test/fixture.go | 6 +- internal/database/mariadb/user.go | 2 +- internal/entity/common.go | 4 +- 32 files changed, 413 insertions(+), 196 deletions(-) create mode 100644 internal/app/common/user_id.go diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index f8d30c13..c79198ca 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -20,11 +20,11 @@ func getModelMetadata(em entity.Metadata) *Metadata { deletedAt := em.DeletedAt.String() updatedAt := em.UpdatedAt.String() return &Metadata{ - CreatedAt: &createdAt, - CreatedBy: &em.CreatedBy, - DeletedAt: &deletedAt, - UpdatedAt: &updatedAt, - UpdatedBy: &em.UpdatedBy, + CreatedAt: util.Ptr(createdAt), + CreatedBy: util.Ptr(fmt.Sprintf("%d", em.CreatedBy)), + DeletedAt: util.Ptr(deletedAt), + UpdatedAt: util.Ptr(updatedAt), + UpdatedBy: util.Ptr(fmt.Sprintf("%d", em.UpdatedBy)), } } diff --git a/internal/app/activity/activity_handler.go b/internal/app/activity/activity_handler.go index bccec92d..152b7ad4 100644 --- a/internal/app/activity/activity_handler.go +++ b/internal/app/activity/activity_handler.go @@ -132,12 +132,18 @@ func (a *activityHandler) ListActivities(filter *entity.ActivityFilter, options } func (a *activityHandler) CreateActivity(activity *entity.Activity) (*entity.Activity, error) { - activity.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": ActivityCreateEventName, "object": activity, }) + var err error + activity.CreatedBy, err = common.GetUserId(a.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewActivityHandlerError("Internal error while creating activity (GetUserId).") + } + newActivity, err := a.database.CreateActivity(activity) if err != nil { @@ -153,13 +159,19 @@ func (a *activityHandler) CreateActivity(activity *entity.Activity) (*entity.Act } func (a *activityHandler) UpdateActivity(activity *entity.Activity) (*entity.Activity, error) { - activity.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": ActivityUpdateEventName, "object": activity, }) - err := a.database.UpdateActivity(activity) + var err error + activity.UpdatedBy, err = common.GetUserId(a.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewActivityHandlerError("Internal error while updating activity (GetUserId).") + } + + err = a.database.UpdateActivity(activity) if err != nil { l.Error(err) diff --git a/internal/app/common/user_id.go b/internal/app/common/user_id.go new file mode 100644 index 00000000..54d450cb --- /dev/null +++ b/internal/app/common/user_id.go @@ -0,0 +1,19 @@ +package common + +import ( + "fmt" + + "github.com/cloudoperators/heureka/internal/database" + "github.com/cloudoperators/heureka/internal/entity" +) + +func GetUserId(db database.Database, uniqueUserId string) (int64, error) { + filter := &entity.UserFilter{UniqueUserID: []*string{&uniqueUserId}} + ids, err := db.GetAllUserIds(filter) + if err != nil { + return 0, fmt.Errorf("Unable to get user ids %w", err) + } else if len(ids) < 1 { + return 0, nil + } + return ids[0], nil +} diff --git a/internal/app/component/component_handler.go b/internal/app/component/component_handler.go index 2cc0a5c4..cf9eba87 100644 --- a/internal/app/component/component_handler.go +++ b/internal/app/component/component_handler.go @@ -105,7 +105,6 @@ func (cs *componentHandler) ListComponents(filter *entity.ComponentFilter, optio } func (cs *componentHandler) CreateComponent(component *entity.Component) (*entity.Component, error) { - component.CreatedBy = "Creator" f := &entity.ComponentFilter{ Name: []*string{&component.Name}, } @@ -116,6 +115,13 @@ func (cs *componentHandler) CreateComponent(component *entity.Component) (*entit "filter": f, }) + var err error + component.CreatedBy, err = common.GetUserId(cs.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewUserHandlerError("Internal error while creating component (GetUserId).") + } + components, err := cs.ListComponents(f, &entity.ListOptions{}) if err != nil { @@ -140,13 +146,19 @@ func (cs *componentHandler) CreateComponent(component *entity.Component) (*entit } func (cs *componentHandler) UpdateComponent(component *entity.Component) (*entity.Component, error) { - component.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateComponentEventName, "object": component, }) - err := cs.database.UpdateComponent(component) + var err error + component.UpdatedBy, err = common.GetUserId(cs.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewUserHandlerError("Internal error while updating component (GetUserId).") + } + + err = cs.database.UpdateComponent(component) if err != nil { l.Error(err) diff --git a/internal/app/component_instance/component_instance_handler.go b/internal/app/component_instance/component_instance_handler.go index fda1efd1..2981c4c4 100644 --- a/internal/app/component_instance/component_instance_handler.go +++ b/internal/app/component_instance/component_instance_handler.go @@ -111,12 +111,18 @@ func (ci *componentInstanceHandler) ListComponentInstances(filter *entity.Compon } func (ci *componentInstanceHandler) CreateComponentInstance(componentInstance *entity.ComponentInstance) (*entity.ComponentInstance, error) { - componentInstance.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateComponentInstanceEventName, "object": componentInstance, }) + var err error + componentInstance.CreatedBy, err = common.GetUserId(ci.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewComponentInstanceHandlerError("Internal error while creating componentInstance (GetUserId).") + } + newComponentInstance, err := ci.database.CreateComponentInstance(componentInstance) if err != nil { @@ -132,13 +138,19 @@ func (ci *componentInstanceHandler) CreateComponentInstance(componentInstance *e } func (ci *componentInstanceHandler) UpdateComponentInstance(componentInstance *entity.ComponentInstance) (*entity.ComponentInstance, error) { - componentInstance.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateComponentInstanceEventName, "object": componentInstance, }) - err := ci.database.UpdateComponentInstance(componentInstance) + var err error + componentInstance.UpdatedBy, err = common.GetUserId(ci.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewComponentInstanceHandlerError("Internal error while updating componentInstance (GetUserId).") + } + + err = ci.database.UpdateComponentInstance(componentInstance) if err != nil { l.Error(err) diff --git a/internal/app/component_version/component_version_handler.go b/internal/app/component_version/component_version_handler.go index ea42bb2b..79ed0448 100644 --- a/internal/app/component_version/component_version_handler.go +++ b/internal/app/component_version/component_version_handler.go @@ -109,12 +109,18 @@ func (cv *componentVersionHandler) ListComponentVersions(filter *entity.Componen } func (cv *componentVersionHandler) CreateComponentVersion(componentVersion *entity.ComponentVersion) (*entity.ComponentVersion, error) { - componentVersion.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateComponentVersionEventName, "object": componentVersion, }) + var err error + componentVersion.CreatedBy, err = common.GetUserId(cv.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewComponentVersionHandlerError("Internal error while creating componentVersion (GetUserId).") + } + newComponent, err := cv.database.CreateComponentVersion(componentVersion) if err != nil { @@ -130,13 +136,19 @@ func (cv *componentVersionHandler) CreateComponentVersion(componentVersion *enti } func (cv *componentVersionHandler) UpdateComponentVersion(componentVersion *entity.ComponentVersion) (*entity.ComponentVersion, error) { - componentVersion.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateComponentVersionEventName, "object": componentVersion, }) - err := cv.database.UpdateComponentVersion(componentVersion) + var err error + componentVersion.UpdatedBy, err = common.GetUserId(cv.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewComponentVersionHandlerError("Internal error while updating componentVersion (GetUserId).") + } + + err = cv.database.UpdateComponentVersion(componentVersion) if err != nil { l.Error(err) diff --git a/internal/app/evidence/evidence_handler.go b/internal/app/evidence/evidence_handler.go index 7b40f388..9b658f57 100644 --- a/internal/app/evidence/evidence_handler.go +++ b/internal/app/evidence/evidence_handler.go @@ -104,12 +104,18 @@ func (e *evidenceHandler) ListEvidences(filter *entity.EvidenceFilter, options * } func (e *evidenceHandler) CreateEvidence(evidence *entity.Evidence) (*entity.Evidence, error) { - evidence.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateEvidenceEventName, "object": evidence, }) + var err error + evidence.CreatedBy, err = common.GetUserId(e.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewEvidenceHandlerError("Internal error while creating evidence (GetUserId).") + } + newEvidence, err := e.database.CreateEvidence(evidence) if err != nil { @@ -123,13 +129,19 @@ func (e *evidenceHandler) CreateEvidence(evidence *entity.Evidence) (*entity.Evi } func (e *evidenceHandler) UpdateEvidence(evidence *entity.Evidence) (*entity.Evidence, error) { - evidence.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateEvidenceEventName, "object": evidence, }) - err := e.database.UpdateEvidence(evidence) + var err error + evidence.UpdatedBy, err = common.GetUserId(e.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewEvidenceHandlerError("Internal error while updating evidence (GetUserId).") + } + + err = e.database.UpdateEvidence(evidence) if err != nil { l.Error(err) diff --git a/internal/app/issue/issue_handler.go b/internal/app/issue/issue_handler.go index eb17b53f..341d9133 100644 --- a/internal/app/issue/issue_handler.go +++ b/internal/app/issue/issue_handler.go @@ -160,7 +160,6 @@ func (is *issueHandler) ListIssues(filter *entity.IssueFilter, options *entity.I } func (is *issueHandler) CreateIssue(issue *entity.Issue) (*entity.Issue, error) { - issue.CreatedBy = "Creator" f := &entity.IssueFilter{ PrimaryName: []*string{&issue.PrimaryName}, } @@ -171,6 +170,13 @@ func (is *issueHandler) CreateIssue(issue *entity.Issue) (*entity.Issue, error) "filter": f, }) + var err error + issue.CreatedBy, err = common.GetUserId(is.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewIssueHandlerError("Internal error while creating issue (GetUserId).") + } + issues, err := is.ListIssues(f, &entity.IssueListOptions{}) if err != nil { @@ -194,13 +200,19 @@ func (is *issueHandler) CreateIssue(issue *entity.Issue) (*entity.Issue, error) } func (is *issueHandler) UpdateIssue(issue *entity.Issue) (*entity.Issue, error) { - issue.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueEventName, "object": issue, }) - err := is.database.UpdateIssue(issue) + var err error + issue.UpdatedBy, err = common.GetUserId(is.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewIssueHandlerError("Internal error while updating issue (GetUserId).") + } + + err = is.database.UpdateIssue(issue) if err != nil { l.Error(err) diff --git a/internal/app/issue_match/issue_match_handler.go b/internal/app/issue_match/issue_match_handler.go index a8a10010..c9a02587 100644 --- a/internal/app/issue_match/issue_match_handler.go +++ b/internal/app/issue_match/issue_match_handler.go @@ -136,12 +136,18 @@ func (im *issueMatchHandler) ListIssueMatches(filter *entity.IssueMatchFilter, o } func (im *issueMatchHandler) CreateIssueMatch(issueMatch *entity.IssueMatch) (*entity.IssueMatch, error) { - issueMatch.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateIssueMatchEventName, "object": issueMatch, }) + var err error + issueMatch.CreatedBy, err = common.GetUserId(im.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewIssueMatchHandlerError("Internal error while retrieving effective severity (GetUserId).") + } + severityFilter := &entity.SeverityFilter{ IssueId: []*int64{&issueMatch.IssueId}, } @@ -171,13 +177,19 @@ func (im *issueMatchHandler) CreateIssueMatch(issueMatch *entity.IssueMatch) (*e } func (im *issueMatchHandler) UpdateIssueMatch(issueMatch *entity.IssueMatch) (*entity.IssueMatch, error) { - issueMatch.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueMatchEventName, "object": issueMatch, }) - err := im.database.UpdateIssueMatch(issueMatch) + var err error + issueMatch.UpdatedBy, err = common.GetUserId(im.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewIssueMatchHandlerError("Internal error while retrieving effective severity (GetUserId).") + } + + err = im.database.UpdateIssueMatch(issueMatch) if err != nil { l.Error(err) diff --git a/internal/app/issue_match_change/issue_match_change_handler.go b/internal/app/issue_match_change/issue_match_change_handler.go index 0a8137aa..cd1dc23d 100644 --- a/internal/app/issue_match_change/issue_match_change_handler.go +++ b/internal/app/issue_match_change/issue_match_change_handler.go @@ -108,12 +108,18 @@ func (imc *issueMatchChangeHandler) ListIssueMatchChanges(filter *entity.IssueMa } func (imc *issueMatchChangeHandler) CreateIssueMatchChange(issueMatchChange *entity.IssueMatchChange) (*entity.IssueMatchChange, error) { - issueMatchChange.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateIssueMatchChangeEventName, "object": issueMatchChange, }) + var err error + issueMatchChange.CreatedBy, err = common.GetUserId(imc.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewIssueMatchChangeHandlerError("Internal error while creating issueMatchChange (GetUserId).") + } + newIssueMatchChange, err := imc.database.CreateIssueMatchChange(issueMatchChange) if err != nil { @@ -129,13 +135,19 @@ func (imc *issueMatchChangeHandler) CreateIssueMatchChange(issueMatchChange *ent } func (imc *issueMatchChangeHandler) UpdateIssueMatchChange(issueMatchChange *entity.IssueMatchChange) (*entity.IssueMatchChange, error) { - issueMatchChange.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueMatchChangeEventName, "object": issueMatchChange, }) - err := imc.database.UpdateIssueMatchChange(issueMatchChange) + var err error + issueMatchChange.UpdatedBy, err = common.GetUserId(imc.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewIssueMatchChangeHandlerError("Internal error while updating issueMatchChange (GetUserId).") + } + + err = imc.database.UpdateIssueMatchChange(issueMatchChange) if err != nil { l.Error(err) diff --git a/internal/app/issue_repository/issue_repository_handler.go b/internal/app/issue_repository/issue_repository_handler.go index 27f7562d..138fe386 100644 --- a/internal/app/issue_repository/issue_repository_handler.go +++ b/internal/app/issue_repository/issue_repository_handler.go @@ -102,7 +102,6 @@ func (ir *issueRepositoryHandler) ListIssueRepositories(filter *entity.IssueRepo } func (ir *issueRepositoryHandler) CreateIssueRepository(issueRepository *entity.IssueRepository) (*entity.IssueRepository, error) { - issueRepository.CreatedBy = "Creator" f := &entity.IssueRepositoryFilter{ Name: []*string{&issueRepository.Name}, } @@ -113,6 +112,13 @@ func (ir *issueRepositoryHandler) CreateIssueRepository(issueRepository *entity. "filter": f, }) + var err error + issueRepository.CreatedBy, err = common.GetUserId(ir.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewIssueRepositoryHandlerError("Internal error while creating issueRepository (GetUserId).") + } + issueRepositories, err := ir.ListIssueRepositories(f, &entity.ListOptions{}) if err != nil { @@ -138,13 +144,19 @@ func (ir *issueRepositoryHandler) CreateIssueRepository(issueRepository *entity. } func (ir *issueRepositoryHandler) UpdateIssueRepository(issueRepository *entity.IssueRepository) (*entity.IssueRepository, error) { - issueRepository.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueRepositoryEventName, "object": issueRepository, }) - err := ir.database.UpdateIssueRepository(issueRepository) + var err error + issueRepository.UpdatedBy, err = common.GetUserId(ir.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewIssueRepositoryHandlerError("Internal error while updating issueRepository (GetUserId).") + } + + err = ir.database.UpdateIssueRepository(issueRepository) if err != nil { l.Error(err) diff --git a/internal/app/issue_variant/issue_variant_handler.go b/internal/app/issue_variant/issue_variant_handler.go index 3e7f2cd0..460e0bf9 100644 --- a/internal/app/issue_variant/issue_variant_handler.go +++ b/internal/app/issue_variant/issue_variant_handler.go @@ -168,7 +168,6 @@ func (iv *issueVariantHandler) ListEffectiveIssueVariants(filter *entity.IssueVa } func (iv *issueVariantHandler) CreateIssueVariant(issueVariant *entity.IssueVariant) (*entity.IssueVariant, error) { - issueVariant.CreatedBy = "Creator" f := &entity.IssueVariantFilter{ SecondaryName: []*string{&issueVariant.SecondaryName}, } @@ -179,6 +178,13 @@ func (iv *issueVariantHandler) CreateIssueVariant(issueVariant *entity.IssueVari "filter": f, }) + var err error + issueVariant.CreatedBy, err = common.GetUserId(iv.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewIssueVariantHandlerError("Internal error while creating issueVariant (GetUserId).") + } + issueVariants, err := iv.ListIssueVariants(f, &entity.ListOptions{}) if err != nil { @@ -204,13 +210,19 @@ func (iv *issueVariantHandler) CreateIssueVariant(issueVariant *entity.IssueVari } func (iv *issueVariantHandler) UpdateIssueVariant(issueVariant *entity.IssueVariant) (*entity.IssueVariant, error) { - issueVariant.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateIssueVariantEventName, "object": issueVariant, }) - err := iv.database.UpdateIssueVariant(issueVariant) + var err error + issueVariant.UpdatedBy, err = common.GetUserId(iv.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewIssueVariantHandlerError("Internal error while updating issueVariant (GetUserId).") + } + + err = iv.database.UpdateIssueVariant(issueVariant) if err != nil { l.Error(err) diff --git a/internal/app/service/service_handler.go b/internal/app/service/service_handler.go index 414b366e..bdfd56a9 100644 --- a/internal/app/service/service_handler.go +++ b/internal/app/service/service_handler.go @@ -125,7 +125,6 @@ func (s *serviceHandler) ListServices(filter *entity.ServiceFilter, options *ent } func (s *serviceHandler) CreateService(service *entity.Service) (*entity.Service, error) { - service.CreatedBy = "Creator" f := &entity.ServiceFilter{ Name: []*string{&service.Name}, } @@ -136,6 +135,13 @@ func (s *serviceHandler) CreateService(service *entity.Service) (*entity.Service "filter": f, }) + var err error + service.CreatedBy, err = common.GetUserId(s.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewServiceHandlerError("Internal error while creating service (GetUserId).") + } + services, err := s.ListServices(f, &entity.ListOptions{}) if err != nil { @@ -160,13 +166,19 @@ func (s *serviceHandler) CreateService(service *entity.Service) (*entity.Service } func (s *serviceHandler) UpdateService(service *entity.Service) (*entity.Service, error) { - service.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateServiceEventName, "object": service, }) - err := s.database.UpdateService(service) + var err error + service.UpdatedBy, err = common.GetUserId(s.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewServiceHandlerError("Internal error while updating service (GetUserId).") + } + + err = s.database.UpdateService(service) if err != nil { l.Error(err) diff --git a/internal/app/support_group/support_group_handler.go b/internal/app/support_group/support_group_handler.go index e07535c1..8fd867a6 100644 --- a/internal/app/support_group/support_group_handler.go +++ b/internal/app/support_group/support_group_handler.go @@ -133,7 +133,6 @@ func (sg *supportGroupHandler) ListSupportGroups(filter *entity.SupportGroupFilt } func (sg *supportGroupHandler) CreateSupportGroup(supportGroup *entity.SupportGroup) (*entity.SupportGroup, error) { - supportGroup.CreatedBy = "Creator" l := logrus.WithFields(logrus.Fields{ "event": CreateSupportGroupEventName, "object": supportGroup, @@ -143,6 +142,13 @@ func (sg *supportGroupHandler) CreateSupportGroup(supportGroup *entity.SupportGr Name: []*string{&supportGroup.Name}, } + var err error + supportGroup.CreatedBy, err = common.GetUserId(sg.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewSupportGroupHandlerError("Internal error while creating supportGroup (GetUserId).") + } + supportGroups, err := sg.ListSupportGroups(f, &entity.ListOptions{}) if err != nil { @@ -169,13 +175,19 @@ func (sg *supportGroupHandler) CreateSupportGroup(supportGroup *entity.SupportGr } func (sg *supportGroupHandler) UpdateSupportGroup(supportGroup *entity.SupportGroup) (*entity.SupportGroup, error) { - supportGroup.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateSupportGroupEventName, "object": supportGroup, }) - err := sg.database.UpdateSupportGroup(supportGroup) + var err error + supportGroup.UpdatedBy, err = common.GetUserId(sg.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewSupportGroupHandlerError("Internal error while updating supportGroup (GetUserId).") + } + + err = sg.database.UpdateSupportGroup(supportGroup) if err != nil { l.Error(err) diff --git a/internal/app/user/user_handler.go b/internal/app/user/user_handler.go index 71e474f4..db10b3a8 100644 --- a/internal/app/user/user_handler.go +++ b/internal/app/user/user_handler.go @@ -103,7 +103,6 @@ func (u *userHandler) ListUsers(filter *entity.UserFilter, options *entity.ListO } func (u *userHandler) CreateUser(user *entity.User) (*entity.User, error) { - user.CreatedBy = "Creator" f := &entity.UserFilter{ UniqueUserID: []*string{&user.UniqueUserID}, } @@ -113,6 +112,13 @@ func (u *userHandler) CreateUser(user *entity.User) (*entity.User, error) { "object": user, }) + var err error + user.CreatedBy, err = common.GetUserId(u.database, "C1234567") + if err != nil { + l.Error(err) + return nil, NewUserHandlerError("Internal error while creating user (GetUserId).") + } + users, err := u.ListUsers(f, &entity.ListOptions{}) if err != nil { @@ -137,13 +143,19 @@ func (u *userHandler) CreateUser(user *entity.User) (*entity.User, error) { } func (u *userHandler) UpdateUser(user *entity.User) (*entity.User, error) { - user.UpdatedBy = "Updater" l := logrus.WithFields(logrus.Fields{ "event": UpdateUserEventName, "object": user, }) - err := u.database.UpdateUser(user) + var err error + user.UpdatedBy, err = common.GetUserId(u.database, "C7654321") + if err != nil { + l.Error(err) + return nil, NewUserHandlerError("Internal error while updating user (GetUserId).") + } + + err = u.database.UpdateUser(user) if err != nil { l.Error(err) diff --git a/internal/database/mariadb/activity.go b/internal/database/mariadb/activity.go index e5bd8aee..8be420ca 100644 --- a/internal/database/mariadb/activity.go +++ b/internal/database/mariadb/activity.go @@ -68,7 +68,7 @@ func (s *SqlDatabase) getActivityUpdateFields(activity *entity.Activity) string if activity.Status != "" { fl = append(fl, "activity_status = :activity_status") } - if activity.UpdatedBy != "" { + if activity.UpdatedBy != 0 { fl = append(fl, "activity_updated_by = :activity_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/component.go b/internal/database/mariadb/component.go index 6c8ccd97..c511e2f5 100644 --- a/internal/database/mariadb/component.go +++ b/internal/database/mariadb/component.go @@ -64,7 +64,7 @@ func (s *SqlDatabase) getComponentUpdateFields(component *entity.Component) stri if component.Type != "" { fl = append(fl, "component_type = :component_type") } - if component.UpdatedBy != "" { + if component.UpdatedBy != 0 { fl = append(fl, "component_updated_by = :component_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/component_instance.go b/internal/database/mariadb/component_instance.go index 89535dc9..d8647188 100644 --- a/internal/database/mariadb/component_instance.go +++ b/internal/database/mariadb/component_instance.go @@ -69,7 +69,7 @@ func (s *SqlDatabase) getComponentInstanceUpdateFields(componentInstance *entity if componentInstance.ServiceId != 0 { fl = append(fl, "componentinstance_service_id = :componentinstance_service_id") } - if componentInstance.UpdatedBy != "" { + if componentInstance.UpdatedBy != 0 { fl = append(fl, "componentinstance_updated_by = :componentinstance_updated_by") } diff --git a/internal/database/mariadb/component_version.go b/internal/database/mariadb/component_version.go index f9d38d33..b50d576e 100644 --- a/internal/database/mariadb/component_version.go +++ b/internal/database/mariadb/component_version.go @@ -51,7 +51,7 @@ func (s *SqlDatabase) getComponentVersionUpdateFields(componentVersion *entity.C if componentVersion.ComponentId != 0 { fl = append(fl, "componentversion_component_id = :componentversion_component_id") } - if componentVersion.UpdatedBy != "" { + if componentVersion.UpdatedBy != 0 { fl = append(fl, "componentversion_updated_by = :componentversion_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index 411332af..0ef6c432 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -87,10 +87,10 @@ type IssueRow struct { PrimaryName sql.NullString `db:"issue_primary_name" json:"primary_name"` Description sql.NullString `db:"issue_description" json:"description"` CreatedAt sql.NullTime `db:"issue_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"issue_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"issue_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issue_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issue_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"issue_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"issue_updated_by" json:"updated_by"` } func (ir *IssueRow) AsIssue() entity.Issue { @@ -104,10 +104,10 @@ func (ir *IssueRow) AsIssue() entity.Issue { Activity: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ir.CreatedAt), - CreatedBy: GetStringValue(ir.CreatedBy), + CreatedBy: GetInt64Value(ir.CreatedBy), DeletedAt: GetTimeValue(ir.DeletedAt), UpdatedAt: GetTimeValue(ir.UpdatedAt), - UpdatedBy: GetStringValue(ir.UpdatedBy), + UpdatedBy: GetInt64Value(ir.UpdatedBy), }, } } @@ -148,10 +148,10 @@ func (ibr *GetIssuesByRow) AsIssueWithAggregations() entity.IssueWithAggregation Activity: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), - CreatedBy: GetStringValue(ibr.IssueRow.CreatedBy), + CreatedBy: GetInt64Value(ibr.IssueRow.CreatedBy), DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), - UpdatedBy: GetStringValue(ibr.IssueRow.UpdatedBy), + UpdatedBy: GetInt64Value(ibr.IssueRow.UpdatedBy), }, }, } @@ -168,10 +168,10 @@ func (ibr *GetIssuesByRow) AsIssue() entity.Issue { Activity: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ibr.IssueRow.CreatedAt), - CreatedBy: GetStringValue(ibr.IssueRow.CreatedBy), + CreatedBy: GetInt64Value(ibr.IssueRow.CreatedBy), DeletedAt: GetTimeValue(ibr.IssueRow.DeletedAt), UpdatedAt: GetTimeValue(ibr.IssueRow.UpdatedAt), - UpdatedBy: GetStringValue(ibr.IssueRow.UpdatedBy), + UpdatedBy: GetInt64Value(ibr.IssueRow.UpdatedBy), }, } } @@ -194,10 +194,10 @@ func (ir *IssueRow) FromIssue(i *entity.Issue) { ir.Type = sql.NullString{String: i.Type.String(), Valid: true} ir.Description = sql.NullString{String: i.Description, Valid: true} ir.CreatedAt = sql.NullTime{Time: i.CreatedAt, Valid: true} - ir.CreatedBy = sql.NullString{String: i.CreatedBy, Valid: true} + ir.CreatedBy = sql.NullInt64{Int64: i.CreatedBy, Valid: true} ir.DeletedAt = sql.NullTime{Time: i.DeletedAt, Valid: true} ir.UpdatedAt = sql.NullTime{Time: i.UpdatedAt, Valid: true} - ir.UpdatedBy = sql.NullString{String: i.UpdatedBy, Valid: true} + ir.UpdatedBy = sql.NullInt64{Int64: i.UpdatedBy, Valid: false} } type IssueMatchRow struct { @@ -211,10 +211,10 @@ type IssueMatchRow struct { RemediationDate sql.NullTime `db:"issuematch_remediation_date" json:"remediation_date"` TargetRemediationDate sql.NullTime `db:"issuematch_target_remediation_date" json:"target_remediation_date"` CreatedAt sql.NullTime `db:"issuematch_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"issuematch_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"issuematch_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuematch_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuematch_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"issuematch_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"issuematch_updated_by" json:"updated_by"` } func (imr IssueMatchRow) AsIssueMatch() entity.IssueMatch { @@ -232,10 +232,10 @@ func (imr IssueMatchRow) AsIssueMatch() entity.IssueMatch { Severity: entity.NewSeverity(GetStringValue(imr.Vector)), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(imr.CreatedAt), - CreatedBy: GetStringValue(imr.CreatedBy), + CreatedBy: GetInt64Value(imr.CreatedBy), DeletedAt: GetTimeValue(imr.DeletedAt), UpdatedAt: GetTimeValue(imr.UpdatedAt), - UpdatedBy: GetStringValue(imr.UpdatedBy), + UpdatedBy: GetInt64Value(imr.UpdatedBy), }, } } @@ -251,10 +251,10 @@ func (imr *IssueMatchRow) FromIssueMatch(im *entity.IssueMatch) { imr.RemediationDate = sql.NullTime{Time: im.RemediationDate, Valid: true} imr.TargetRemediationDate = sql.NullTime{Time: im.TargetRemediationDate, Valid: true} imr.CreatedAt = sql.NullTime{Time: im.CreatedAt, Valid: true} - imr.CreatedBy = sql.NullString{String: im.CreatedBy, Valid: true} + imr.CreatedBy = sql.NullInt64{Int64: im.CreatedBy, Valid: false} imr.DeletedAt = sql.NullTime{Time: im.DeletedAt, Valid: true} imr.UpdatedAt = sql.NullTime{Time: im.UpdatedAt, Valid: true} - imr.UpdatedBy = sql.NullString{String: im.UpdatedBy, Valid: true} + imr.UpdatedBy = sql.NullInt64{Int64: im.UpdatedBy, Valid: false} } type IssueRepositoryRow struct { @@ -267,10 +267,10 @@ type BaseIssueRepositoryRow struct { Name sql.NullString `db:"issuerepository_name"` Url sql.NullString `db:"issuerepository_url"` CreatedAt sql.NullTime `db:"issuerepository_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"issuerepository_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"issuerepository_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuerepository_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuerepository_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"issuerepository_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"issuerepository_updated_by" json:"updated_by"` } func (irr *IssueRepositoryRow) FromIssueRepository(ir *entity.IssueRepository) { @@ -281,10 +281,10 @@ func (irr *IssueRepositoryRow) FromIssueRepository(ir *entity.IssueRepository) { irr.ServiceId = sql.NullInt64{Int64: ir.ServiceId, Valid: true} irr.IssueRepositoryId = sql.NullInt64{Int64: ir.IssueRepositoryId, Valid: true} irr.BaseIssueRepositoryRow.CreatedAt = sql.NullTime{Time: ir.CreatedAt, Valid: true} - irr.BaseIssueRepositoryRow.CreatedBy = sql.NullString{String: ir.CreatedBy, Valid: true} + irr.BaseIssueRepositoryRow.CreatedBy = sql.NullInt64{Int64: ir.CreatedBy, Valid: false} irr.BaseIssueRepositoryRow.DeletedAt = sql.NullTime{Time: ir.DeletedAt, Valid: true} irr.BaseIssueRepositoryRow.UpdatedAt = sql.NullTime{Time: ir.UpdatedAt, Valid: true} - irr.BaseIssueRepositoryRow.UpdatedBy = sql.NullString{String: ir.UpdatedBy, Valid: true} + irr.BaseIssueRepositoryRow.UpdatedBy = sql.NullInt64{Int64: ir.UpdatedBy, Valid: false} } func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepository { @@ -296,10 +296,10 @@ func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepo Services: nil, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(birr.CreatedAt), - CreatedBy: GetStringValue(birr.CreatedBy), + CreatedBy: GetInt64Value(birr.CreatedBy), DeletedAt: GetTimeValue(birr.DeletedAt), UpdatedAt: GetTimeValue(birr.UpdatedAt), - UpdatedBy: GetStringValue(birr.UpdatedBy), + UpdatedBy: GetInt64Value(birr.UpdatedBy), }, } } @@ -314,10 +314,10 @@ func (barr *BaseIssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Services: nil, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(barr.CreatedAt), - CreatedBy: GetStringValue(barr.CreatedBy), + CreatedBy: GetInt64Value(barr.CreatedBy), DeletedAt: GetTimeValue(barr.DeletedAt), UpdatedAt: GetTimeValue(barr.UpdatedAt), - UpdatedBy: GetStringValue(barr.UpdatedBy), + UpdatedBy: GetInt64Value(barr.UpdatedBy), }, }, } @@ -333,10 +333,10 @@ func (irr *IssueRepositoryRow) AsIssueRepository() entity.IssueRepository { Services: nil, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.CreatedAt), - CreatedBy: GetStringValue(irr.BaseIssueRepositoryRow.CreatedBy), + CreatedBy: GetInt64Value(irr.BaseIssueRepositoryRow.CreatedBy), DeletedAt: GetTimeValue(irr.BaseIssueRepositoryRow.DeletedAt), UpdatedAt: GetTimeValue(irr.BaseIssueRepositoryRow.UpdatedAt), - UpdatedBy: GetStringValue(irr.BaseIssueRepositoryRow.UpdatedBy), + UpdatedBy: GetInt64Value(irr.BaseIssueRepositoryRow.UpdatedBy), }, }, IssueRepositoryService: entity.IssueRepositoryService{ @@ -355,10 +355,10 @@ type IssueVariantRow struct { Rating sql.NullString `db:"issuevariant_rating" json:"rating"` Description sql.NullString `db:"issuevariant_description" json:"description"` CreatedAt sql.NullTime `db:"issuevariant_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"issuevariant_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"issuevariant_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuevariant_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuevariant_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"issuevariant_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"issuevariant_updated_by" json:"updated_by"` } func (ivr *IssueVariantRow) AsIssueVariant(repository *entity.IssueRepository) entity.IssueVariant { @@ -373,10 +373,10 @@ func (ivr *IssueVariantRow) AsIssueVariant(repository *entity.IssueRepository) e Description: GetStringValue(ivr.Description), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ivr.CreatedAt), - CreatedBy: GetStringValue(ivr.CreatedBy), + CreatedBy: GetInt64Value(ivr.CreatedBy), DeletedAt: GetTimeValue(ivr.DeletedAt), UpdatedAt: GetTimeValue(ivr.UpdatedAt), - UpdatedBy: GetStringValue(ivr.UpdatedBy), + UpdatedBy: GetInt64Value(ivr.UpdatedBy), }, } } @@ -390,10 +390,10 @@ func (ivr *IssueVariantRow) FromIssueVariant(iv *entity.IssueVariant) { ivr.Rating = sql.NullString{String: iv.Severity.Value, Valid: true} ivr.Description = sql.NullString{String: iv.Description, Valid: true} ivr.CreatedAt = sql.NullTime{Time: iv.CreatedAt, Valid: true} - ivr.CreatedBy = sql.NullString{String: iv.CreatedBy, Valid: true} + ivr.CreatedBy = sql.NullInt64{Int64: iv.CreatedBy, Valid: false} ivr.DeletedAt = sql.NullTime{Time: iv.DeletedAt, Valid: true} ivr.UpdatedAt = sql.NullTime{Time: iv.UpdatedAt, Valid: true} - ivr.UpdatedBy = sql.NullString{String: iv.UpdatedBy, Valid: true} + ivr.UpdatedBy = sql.NullInt64{Int64: iv.UpdatedBy, Valid: false} } type IssueVariantWithRepository struct { @@ -425,10 +425,10 @@ type ComponentRow struct { Name sql.NullString `db:"component_name" json:"name"` Type sql.NullString `db:"component_type" json:"type"` CreatedAt sql.NullTime `db:"component_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"component_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"component_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"component_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"component_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"component_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"component_updated_by" json:"updated_by"` } func (cr *ComponentRow) AsComponent() entity.Component { @@ -438,10 +438,10 @@ func (cr *ComponentRow) AsComponent() entity.Component { Type: GetStringValue(cr.Type), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cr.CreatedAt), - CreatedBy: GetStringValue(cr.CreatedBy), + CreatedBy: GetInt64Value(cr.CreatedBy), DeletedAt: GetTimeValue(cr.DeletedAt), UpdatedAt: GetTimeValue(cr.UpdatedAt), - UpdatedBy: GetStringValue(cr.UpdatedBy), + UpdatedBy: GetInt64Value(cr.UpdatedBy), }, } } @@ -451,10 +451,10 @@ func (cr *ComponentRow) FromComponent(c *entity.Component) { cr.Name = sql.NullString{String: c.Name, Valid: true} cr.Type = sql.NullString{String: c.Type, Valid: true} cr.CreatedAt = sql.NullTime{Time: c.CreatedAt, Valid: true} - cr.CreatedBy = sql.NullString{String: c.CreatedBy, Valid: true} + cr.CreatedBy = sql.NullInt64{Int64: c.CreatedBy, Valid: false} cr.DeletedAt = sql.NullTime{Time: c.DeletedAt, Valid: true} cr.UpdatedAt = sql.NullTime{Time: c.UpdatedAt, Valid: true} - cr.UpdatedBy = sql.NullString{String: c.UpdatedBy, Valid: true} + cr.UpdatedBy = sql.NullInt64{Int64: c.UpdatedBy, Valid: false} } type ComponentVersionRow struct { @@ -462,10 +462,10 @@ type ComponentVersionRow struct { Version sql.NullString `db:"componentversion_version" json:"version"` ComponentId sql.NullInt64 `db:"componentversion_component_id"` CreatedAt sql.NullTime `db:"componentversion_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"componentversion_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"componentversion_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"componentversion_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"componentversion_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"componentversion_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"componentversion_updated_by" json:"updated_by"` } func (cvr *ComponentVersionRow) AsComponentVersion() entity.ComponentVersion { @@ -475,10 +475,10 @@ func (cvr *ComponentVersionRow) AsComponentVersion() entity.ComponentVersion { ComponentId: GetInt64Value(cvr.ComponentId), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cvr.CreatedAt), - CreatedBy: GetStringValue(cvr.CreatedBy), + CreatedBy: GetInt64Value(cvr.CreatedBy), DeletedAt: GetTimeValue(cvr.DeletedAt), UpdatedAt: GetTimeValue(cvr.UpdatedAt), - UpdatedBy: GetStringValue(cvr.UpdatedBy), + UpdatedBy: GetInt64Value(cvr.UpdatedBy), }, } } @@ -488,20 +488,20 @@ func (cvr *ComponentVersionRow) FromComponentVersion(cv *entity.ComponentVersion cvr.Version = sql.NullString{String: cv.Version, Valid: true} cvr.ComponentId = sql.NullInt64{Int64: cv.ComponentId, Valid: true} cvr.CreatedAt = sql.NullTime{Time: cv.CreatedAt, Valid: true} - cvr.CreatedBy = sql.NullString{String: cv.CreatedBy, Valid: true} + cvr.CreatedBy = sql.NullInt64{Int64: cv.CreatedBy, Valid: false} cvr.DeletedAt = sql.NullTime{Time: cv.DeletedAt, Valid: true} cvr.UpdatedAt = sql.NullTime{Time: cv.UpdatedAt, Valid: true} - cvr.UpdatedBy = sql.NullString{String: cv.UpdatedBy, Valid: true} + cvr.UpdatedBy = sql.NullInt64{Int64: cv.UpdatedBy, Valid: false} } type SupportGroupRow struct { Id sql.NullInt64 `db:"supportgroup_id" json:"id"` Name sql.NullString `db:"supportgroup_name" json:"name"` CreatedAt sql.NullTime `db:"supportgroup_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"supportgroup_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"supportgroup_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"supportgroup_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"supportgroup_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"supportgroup_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"supportgroup_updated_by" json:"updated_by"` } func (sgr *SupportGroupRow) AsSupportGroup() entity.SupportGroup { @@ -510,10 +510,10 @@ func (sgr *SupportGroupRow) AsSupportGroup() entity.SupportGroup { Name: GetStringValue(sgr.Name), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(sgr.CreatedAt), - CreatedBy: GetStringValue(sgr.CreatedBy), + CreatedBy: GetInt64Value(sgr.CreatedBy), DeletedAt: GetTimeValue(sgr.DeletedAt), UpdatedAt: GetTimeValue(sgr.UpdatedAt), - UpdatedBy: GetStringValue(sgr.UpdatedBy), + UpdatedBy: GetInt64Value(sgr.UpdatedBy), }, } } @@ -522,10 +522,10 @@ func (sgr *SupportGroupRow) FromSupportGroup(sg *entity.SupportGroup) { sgr.Id = sql.NullInt64{Int64: sg.Id, Valid: true} sgr.Name = sql.NullString{String: sg.Name, Valid: true} sgr.CreatedAt = sql.NullTime{Time: sg.CreatedAt, Valid: true} - sgr.CreatedBy = sql.NullString{String: sg.CreatedBy, Valid: true} + sgr.CreatedBy = sql.NullInt64{Int64: sg.CreatedBy, Valid: false} sgr.DeletedAt = sql.NullTime{Time: sg.DeletedAt, Valid: true} sgr.UpdatedAt = sql.NullTime{Time: sg.UpdatedAt, Valid: true} - sgr.UpdatedBy = sql.NullString{String: sg.UpdatedBy, Valid: true} + sgr.UpdatedBy = sql.NullInt64{Int64: sg.UpdatedBy, Valid: false} } type ServiceRow struct { @@ -537,10 +537,10 @@ type BaseServiceRow struct { Id sql.NullInt64 `db:"service_id" json:"id"` Name sql.NullString `db:"service_name" json:"name"` CreatedAt sql.NullTime `db:"service_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"service_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"service_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"service_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"service_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"service_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"service_updated_by" json:"updated_by"` } func (bsr *BaseServiceRow) AsBaseService() entity.BaseService { @@ -551,10 +551,10 @@ func (bsr *BaseServiceRow) AsBaseService() entity.BaseService { Activities: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(bsr.CreatedAt), - CreatedBy: GetStringValue(bsr.CreatedBy), + CreatedBy: GetInt64Value(bsr.CreatedBy), DeletedAt: GetTimeValue(bsr.DeletedAt), UpdatedAt: GetTimeValue(bsr.UpdatedAt), - UpdatedBy: GetStringValue(bsr.UpdatedBy), + UpdatedBy: GetInt64Value(bsr.UpdatedBy), }, } } @@ -575,10 +575,10 @@ func (sr *ServiceRow) AsService() entity.Service { Activities: []entity.Activity{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(sr.BaseServiceRow.CreatedAt), - CreatedBy: GetStringValue(sr.BaseServiceRow.CreatedBy), + CreatedBy: GetInt64Value(sr.BaseServiceRow.CreatedBy), DeletedAt: GetTimeValue(sr.BaseServiceRow.DeletedAt), UpdatedAt: GetTimeValue(sr.BaseServiceRow.UpdatedAt), - UpdatedBy: GetStringValue(sr.BaseServiceRow.UpdatedBy), + UpdatedBy: GetInt64Value(sr.BaseServiceRow.UpdatedBy), }, }, IssueRepositoryService: entity.IssueRepositoryService{ @@ -592,20 +592,20 @@ func (sr *ServiceRow) FromService(s *entity.Service) { sr.Id = sql.NullInt64{Int64: s.Id, Valid: true} sr.Name = sql.NullString{String: s.Name, Valid: true} sr.BaseServiceRow.CreatedAt = sql.NullTime{Time: s.BaseService.CreatedAt, Valid: true} - sr.BaseServiceRow.CreatedBy = sql.NullString{String: s.BaseService.CreatedBy, Valid: true} + sr.BaseServiceRow.CreatedBy = sql.NullInt64{Int64: s.BaseService.CreatedBy, Valid: false} sr.BaseServiceRow.DeletedAt = sql.NullTime{Time: s.BaseService.DeletedAt, Valid: true} sr.BaseServiceRow.UpdatedAt = sql.NullTime{Time: s.BaseService.UpdatedAt, Valid: true} - sr.BaseServiceRow.UpdatedBy = sql.NullString{String: s.BaseService.UpdatedBy, Valid: true} + sr.BaseServiceRow.UpdatedBy = sql.NullInt64{Int64: s.BaseService.UpdatedBy, Valid: false} } type ActivityRow struct { Id sql.NullInt64 `db:"activity_id" json:"id"` Status sql.NullString `db:"activity_status" json:"status"` CreatedAt sql.NullTime `db:"activity_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"activity_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"activity_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"activity_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"activity_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"activity_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"activity_updated_by" json:"updated_by"` } func (ar *ActivityRow) AsActivity() entity.Activity { @@ -616,10 +616,10 @@ func (ar *ActivityRow) AsActivity() entity.Activity { Evidences: []entity.Evidence{}, Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ar.CreatedAt), - CreatedBy: GetStringValue(ar.CreatedBy), + CreatedBy: GetInt64Value(ar.CreatedBy), DeletedAt: GetTimeValue(ar.DeletedAt), UpdatedAt: GetTimeValue(ar.UpdatedAt), - UpdatedBy: GetStringValue(ar.UpdatedBy), + UpdatedBy: GetInt64Value(ar.UpdatedBy), }, } } @@ -628,10 +628,10 @@ func (ar *ActivityRow) FromActivity(a *entity.Activity) { ar.Id = sql.NullInt64{Int64: a.Id, Valid: true} ar.Status = sql.NullString{String: a.Status.String(), Valid: true} ar.CreatedAt = sql.NullTime{Time: a.CreatedAt, Valid: true} - ar.CreatedBy = sql.NullString{String: a.CreatedBy, Valid: true} + ar.CreatedBy = sql.NullInt64{Int64: a.CreatedBy, Valid: false} ar.DeletedAt = sql.NullTime{Time: a.DeletedAt, Valid: true} ar.UpdatedAt = sql.NullTime{Time: a.UpdatedAt, Valid: true} - ar.UpdatedBy = sql.NullString{String: a.UpdatedBy, Valid: true} + ar.UpdatedBy = sql.NullInt64{Int64: a.UpdatedBy, Valid: false} } type ComponentInstanceRow struct { @@ -641,10 +641,10 @@ type ComponentInstanceRow struct { ComponentVersionId sql.NullInt64 `db:"componentinstance_component_version_id"` ServiceId sql.NullInt64 `db:"componentinstance_service_id"` CreatedAt sql.NullTime `db:"componentinstance_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"componentinstance_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"componentinstance_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"componentinstance_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"componentinstance_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"componentinstance_updated_by" json:"udpated_by"` + UpdatedBy sql.NullInt64 `db:"componentinstance_updated_by" json:"udpated_by"` } func (cir *ComponentInstanceRow) AsComponentInstance() entity.ComponentInstance { @@ -658,10 +658,10 @@ func (cir *ComponentInstanceRow) AsComponentInstance() entity.ComponentInstance ServiceId: GetInt64Value(cir.ServiceId), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(cir.CreatedAt), - CreatedBy: GetStringValue(cir.CreatedBy), + CreatedBy: GetInt64Value(cir.CreatedBy), DeletedAt: GetTimeValue(cir.DeletedAt), UpdatedAt: GetTimeValue(cir.UpdatedAt), - UpdatedBy: GetStringValue(cir.UpdatedBy), + UpdatedBy: GetInt64Value(cir.UpdatedBy), }, } } @@ -673,10 +673,10 @@ func (cir *ComponentInstanceRow) FromComponentInstance(ci *entity.ComponentInsta cir.ComponentVersionId = sql.NullInt64{Int64: ci.ComponentVersionId, Valid: true} cir.ServiceId = sql.NullInt64{Int64: ci.ServiceId, Valid: true} cir.CreatedAt = sql.NullTime{Time: ci.CreatedAt, Valid: true} - cir.CreatedBy = sql.NullString{String: ci.CreatedBy, Valid: true} + cir.CreatedBy = sql.NullInt64{Int64: ci.CreatedBy, Valid: false} cir.DeletedAt = sql.NullTime{Time: ci.DeletedAt, Valid: true} cir.UpdatedAt = sql.NullTime{Time: ci.UpdatedAt, Valid: true} - cir.UpdatedBy = sql.NullString{String: ci.UpdatedBy, Valid: true} + cir.UpdatedBy = sql.NullInt64{Int64: ci.UpdatedBy, Valid: false} } type UserRow struct { @@ -685,10 +685,10 @@ type UserRow struct { UniqueUserID sql.NullString `db:"user_unique_user_id" json:"unique_user_id"` Type sql.NullInt64 `db:"user_type" json:"type"` CreatedAt sql.NullTime `db:"user_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"user_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"user_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"user_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"user_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"user_updated_by" json:"Updated_by"` + UpdatedBy sql.NullInt64 `db:"user_updated_by" json:"Updated_by"` } func (ur *UserRow) AsUser() entity.User { @@ -699,10 +699,10 @@ func (ur *UserRow) AsUser() entity.User { Type: GetUserTypeValue(ur.Type), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(ur.CreatedAt), - CreatedBy: GetStringValue(ur.CreatedBy), + CreatedBy: GetInt64Value(ur.CreatedBy), DeletedAt: GetTimeValue(ur.DeletedAt), UpdatedAt: GetTimeValue(ur.UpdatedAt), - UpdatedBy: GetStringValue(ur.UpdatedBy), + UpdatedBy: GetInt64Value(ur.UpdatedBy), }, } } @@ -713,10 +713,10 @@ func (ur *UserRow) FromUser(u *entity.User) { ur.UniqueUserID = sql.NullString{String: u.UniqueUserID, Valid: true} ur.Type = sql.NullInt64{Int64: int64(u.Type), Valid: true} ur.CreatedAt = sql.NullTime{Time: u.CreatedAt, Valid: true} - ur.CreatedBy = sql.NullString{String: u.CreatedBy, Valid: true} + ur.CreatedBy = sql.NullInt64{Int64: u.CreatedBy, Valid: false} ur.DeletedAt = sql.NullTime{Time: u.DeletedAt, Valid: true} ur.UpdatedAt = sql.NullTime{Time: u.UpdatedAt, Valid: true} - ur.UpdatedBy = sql.NullString{String: u.UpdatedBy, Valid: true} + ur.UpdatedBy = sql.NullInt64{Int64: u.UpdatedBy, Valid: false} } type EvidenceRow struct { @@ -731,10 +731,10 @@ type EvidenceRow struct { Activity *ActivityRow `json:"activity,omitempty"` ActivityId sql.NullInt64 `db:"evidence_activity_id"` CreatedAt sql.NullTime `db:"evidence_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"evidence_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"evidence_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"evidence_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"evidence_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"evidence_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"evidence_updated_by" json:"updated_by"` } func (er *EvidenceRow) AsEvidence() entity.Evidence { @@ -750,10 +750,10 @@ func (er *EvidenceRow) AsEvidence() entity.Evidence { ActivityId: GetInt64Value(er.ActivityId), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(er.CreatedAt), - CreatedBy: GetStringValue(er.CreatedBy), + CreatedBy: GetInt64Value(er.CreatedBy), DeletedAt: GetTimeValue(er.DeletedAt), UpdatedAt: GetTimeValue(er.UpdatedAt), - UpdatedBy: GetStringValue(er.UpdatedBy), + UpdatedBy: GetInt64Value(er.UpdatedBy), }, } } @@ -768,10 +768,10 @@ func (er *EvidenceRow) FromEvidence(e *entity.Evidence) { er.UserId = sql.NullInt64{Int64: e.UserId, Valid: true} er.ActivityId = sql.NullInt64{Int64: e.ActivityId, Valid: true} er.CreatedAt = sql.NullTime{Time: e.CreatedAt, Valid: true} - er.CreatedBy = sql.NullString{String: e.CreatedBy, Valid: true} + er.CreatedBy = sql.NullInt64{Int64: e.CreatedBy, Valid: false} er.DeletedAt = sql.NullTime{Time: e.DeletedAt, Valid: true} er.UpdatedAt = sql.NullTime{Time: e.UpdatedAt, Valid: true} - er.UpdatedBy = sql.NullString{String: e.UpdatedBy, Valid: true} + er.UpdatedBy = sql.NullInt64{Int64: e.UpdatedBy, Valid: false} } type IssueMatchChangeRow struct { @@ -780,10 +780,10 @@ type IssueMatchChangeRow struct { ActivityId sql.NullInt64 `db:"issuematchchange_activity_id" json:"activity_id"` Action sql.NullString `db:"issuematchchange_action" json:"action"` CreatedAt sql.NullTime `db:"issuematchchange_created_at" json:"created_at"` - CreatedBy sql.NullString `db:"issuematchchange_created_by" json:"created_by"` + CreatedBy sql.NullInt64 `db:"issuematchchange_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuematchchange_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuematchchange_updated_at" json:"updated_at"` - UpdatedBy sql.NullString `db:"issuematchchange_updated_by" json:"updated_by"` + UpdatedBy sql.NullInt64 `db:"issuematchchange_updated_by" json:"updated_by"` } func (imcr *IssueMatchChangeRow) AsIssueMatchChange() entity.IssueMatchChange { @@ -794,10 +794,10 @@ func (imcr *IssueMatchChangeRow) AsIssueMatchChange() entity.IssueMatchChange { Action: GetStringValue(imcr.Action), Metadata: entity.Metadata{ CreatedAt: GetTimeValue(imcr.CreatedAt), - CreatedBy: GetStringValue(imcr.CreatedBy), + CreatedBy: GetInt64Value(imcr.CreatedBy), DeletedAt: GetTimeValue(imcr.DeletedAt), UpdatedAt: GetTimeValue(imcr.UpdatedAt), - UpdatedBy: GetStringValue(imcr.UpdatedBy), + UpdatedBy: GetInt64Value(imcr.UpdatedBy), }, } } @@ -808,10 +808,10 @@ func (imcr *IssueMatchChangeRow) FromIssueMatchChange(imc *entity.IssueMatchChan imcr.ActivityId = sql.NullInt64{Int64: imc.ActivityId, Valid: true} imcr.Action = sql.NullString{String: imc.Action, Valid: true} imcr.CreatedAt = sql.NullTime{Time: imc.CreatedAt, Valid: true} - imcr.CreatedBy = sql.NullString{String: imc.CreatedBy, Valid: true} + imcr.CreatedBy = sql.NullInt64{Int64: imc.CreatedBy, Valid: false} imcr.DeletedAt = sql.NullTime{Time: imc.DeletedAt, Valid: true} imcr.UpdatedAt = sql.NullTime{Time: imc.UpdatedAt, Valid: true} - imcr.UpdatedBy = sql.NullString{String: imc.UpdatedBy, Valid: true} + imcr.UpdatedBy = sql.NullInt64{Int64: imc.UpdatedBy, Valid: false} } type OwnerRow struct { diff --git a/internal/database/mariadb/evidence.go b/internal/database/mariadb/evidence.go index 41223899..8838826c 100644 --- a/internal/database/mariadb/evidence.go +++ b/internal/database/mariadb/evidence.go @@ -76,7 +76,7 @@ func (s *SqlDatabase) getEvidenceUpdateFields(evidence *entity.Evidence) string if !evidence.RaaEnd.IsZero() { fl = append(fl, "evidence_raa_end = :evidence_raa_end") } - if evidence.UpdatedBy != "" { + if evidence.UpdatedBy != 0 { fl = append(fl, "evidence_updated_by = :evidence_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index fb3f5a03..9e01d8bf 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -13,14 +13,18 @@ create table if not exists User user_unique_user_id varchar(64) not null, user_type int unsigned, user_created_at timestamp default current_timestamp() not null, - user_created_by varchar(256) null, + user_created_by int unsigned null, user_deleted_at timestamp null, user_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - user_updated_by varchar(256) null, + user_updated_by int unsigned null, constraint id_UNIQUE unique (user_id), constraint unique_user_id_UNIQUE - unique (user_unique_user_id) + unique (user_unique_user_id), + constraint fk_user_created_by + foreign key (user_created_by) references User (user_id), + constraint fk_user_updated_by + foreign key (user_updated_by) references User (user_id) ); create table if not exists Component @@ -30,20 +34,18 @@ create table if not exists Component component_name varchar(256) not null, component_type varchar(256) not null, component_created_at timestamp default current_timestamp() not null, - component_created_by varchar(256) null, + component_created_by int unsigned null, component_deleted_at timestamp null, component_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - component_updated_by varchar(256) null, + component_updated_by int unsigned null, constraint id_UNIQUE unique (component_id), constraint name_UNIQUE unique (component_name), constraint fk_component_created_by - foreign key (component_created_by) references User (user_unique_user_id) - on update cascade, + foreign key (component_created_by) references User (user_id), constraint fk_component_updated_by - foreign key (component_updated_by) references User (user_unique_user_id) - on update cascade + foreign key (component_updated_by) references User (user_id) ); create table if not exists ComponentVersion @@ -53,17 +55,21 @@ create table if not exists ComponentVersion componentversion_version varchar(256) not null, componentversion_component_id int unsigned not null, componentversion_created_at timestamp default current_timestamp() not null, - componentversion_created_by varchar(256) null, + componentversion_created_by int unsigned null, componentversion_deleted_at timestamp null, componentversion_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - componentversion_updated_by varchar(256) null, + componentversion_updated_by int unsigned null, constraint id_UNIQUE unique (componentversion_id), constraint version_component_unique unique (componentversion_version, componentversion_component_id), constraint fk_component_version_component foreign key (componentversion_component_id) references Component (component_id) - on update cascade + on update cascade, + constraint fk_componentversion_created_by + foreign key (componentversion_created_by) references User (user_id), + constraint fk_componentversion_updated_by + foreign key (componentversion_updated_by) references User (user_id) ); create table if not exists SupportGroup @@ -72,14 +78,18 @@ create table if not exists SupportGroup primary key, supportgroup_name varchar(256) not null, supportgroup_created_at timestamp default current_timestamp() not null, - supportgroup_created_by varchar(256) null, + supportgroup_created_by int unsigned null, supportgroup_deleted_at timestamp null, supportgroup_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - supportgroup_updated_by varchar(256) null, + supportgroup_updated_by int unsigned null, constraint id_UNIQUE unique (supportgroup_id), constraint name_UNIQUE - unique (supportgroup_name) + unique (supportgroup_name), + constraint fk_supportgroup_created_by + foreign key (supportgroup_created_by) references User (user_id), + constraint fk_supportgroup_updated_by + foreign key (supportgroup_updated_by) references User (user_id) ); create table if not exists Service @@ -88,14 +98,18 @@ create table if not exists Service primary key, service_name varchar(256) not null, service_created_at timestamp default current_timestamp() not null, - service_created_by varchar(256) null, + service_created_by int unsigned null, service_deleted_at timestamp null, service_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - service_updated_by varchar(256) null, + service_updated_by int unsigned null, constraint id_UNIQUE unique (service_id), constraint name_UNIQUE - unique (service_name) + unique (service_name), + constraint fk_service_created_by + foreign key (service_created_by) references User (user_id), + constraint fk_service_updated_by + foreign key (service_updated_by) references User (user_id) ); create table if not exists SupportGroupService @@ -120,15 +134,18 @@ create table if not exists Activity primary key, activity_status enum('open','closed','in_progress') not null, activity_created_at timestamp default current_timestamp() not null, - activity_created_by varchar(256) null, + activity_created_by int unsigned null, activity_deleted_at timestamp null, activity_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - activity_updated_by varchar(256) null, + activity_updated_by int unsigned null, constraint id_UNIQUE - unique (activity_id) + unique (activity_id), + constraint fk_activity_created_by + foreign key (activity_created_by) references User (user_id), + constraint fk_activity_updated_by + foreign key (activity_updated_by) references User (user_id) ); - create table if not exists ComponentInstance ( componentinstance_id int unsigned auto_increment @@ -138,10 +155,10 @@ create table if not exists ComponentInstance componentinstance_component_version_id int unsigned not null, componentinstance_service_id int unsigned not null, componentinstance_created_at timestamp default current_timestamp() not null, - componentinstance_created_by varchar(256) null, + componentinstance_created_by int unsigned null, componentinstance_deleted_at timestamp null, componentinstance_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - componentinstance_updated_by varchar(256) null, + componentinstance_updated_by int unsigned null, constraint id_UNIQUE unique (componentinstance_id), constraint name_service_unique @@ -151,7 +168,11 @@ create table if not exists ComponentInstance on update cascade, constraint fk_component_instance_service foreign key (componentinstance_service_id) references Service (service_id) - on update cascade + on update cascade, + constraint fk_componentinstance_created_by + foreign key (componentinstance_created_by) references User (user_id), + constraint fk_componentinstance_updated_by + foreign key (componentinstance_updated_by) references User (user_id) ); create table if not exists Evidence @@ -166,10 +187,10 @@ create table if not exists Evidence evidence_rating enum('None','Low','Medium','High','Critical') null, evidence_raa_end datetime null, evidence_created_at timestamp default current_timestamp() not null, - evidence_created_by varchar(256) null, + evidence_created_by int unsigned null, evidence_deleted_at timestamp null, evidence_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - evidence_updated_by varchar(256) null, + evidence_updated_by int unsigned null, constraint id_UNIQUE unique (evidence_id), constraint fk_evidence_user @@ -177,10 +198,13 @@ create table if not exists Evidence on update cascade, constraint fk_evidience_activity foreign key (evidence_activity_id) references Activity (activity_id) - on update cascade + on update cascade, + constraint fk_evidence_created_by + foreign key (evidence_created_by) references User (user_id), + constraint fk_evidence_updated_by + foreign key (evidence_updated_by) references User (user_id) ); - create table if not exists Owner ( owner_service_id int unsigned not null, @@ -197,8 +221,6 @@ create table if not exists Owner on update cascade ); - - create table if not exists SupportGroupUser ( supportgroupuser_user_id int unsigned not null, @@ -222,14 +244,18 @@ create table if not exists IssueRepository issuerepository_name varchar(2048) not null, issuerepository_url varchar(2048) not null, issuerepository_created_at timestamp default current_timestamp() not null, - issuerepository_created_by varchar(256) null, + issuerepository_created_by int unsigned null, issuerepository_deleted_at timestamp null, issuerepository_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - issuerepository_updated_by varchar(256) null, + issuerepository_updated_by int unsigned null, constraint id_UNIQUE unique (issuerepository_id), constraint name_UNIQUE - unique (issuerepository_name) + unique (issuerepository_name), + constraint fk_issuerepository_created_by + foreign key (issuerepository_created_by) references User (user_id), + constraint fk_issuerepository_updated_by + foreign key (issuerepository_updated_by) references User (user_id) ); create table if not exists Issue @@ -240,14 +266,18 @@ create table if not exists Issue issue_primary_name varchar(256) not null, issue_description longtext not null, issue_created_at timestamp default current_timestamp() not null, - issue_created_by varchar(256) null, + issue_created_by int unsigned null, issue_deleted_at timestamp null, issue_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - issue_updated_by varchar(256) null, + issue_updated_by int unsigned null, constraint id_UNIQUE unique (issue_id), constraint name_UNIQUE - unique (issue_primary_name) + unique (issue_primary_name), + constraint fk_issue_created_by + foreign key (issue_created_by) references User (user_id), + constraint fk_issue_updated_by + foreign key (issue_updated_by) references User (user_id) ); create table if not exists IssueVariant @@ -261,10 +291,10 @@ create table if not exists IssueVariant issuevariant_secondary_name varchar(256) not null, issuevariant_description longtext not null, issuevariant_created_at timestamp default current_timestamp() not null, - issuevariant_created_by varchar(256) null, + issuevariant_created_by int unsigned null, issuevariant_deleted_at timestamp null, issuevariant_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - issuevariant_updated_by varchar(256) null, + issuevariant_updated_by int unsigned null, constraint id_UNIQUE unique (issuevariant_id), constraint name_UNIQUE @@ -273,7 +303,11 @@ create table if not exists IssueVariant foreign key (issuevariant_issue_id) references Issue (issue_id), constraint fk_issuevariant_issuerepository foreign key (issuevariant_repository_id) references IssueRepository (issuerepository_id) - on update cascade + on update cascade, + constraint fk_issuevariant_created_by + foreign key (issuevariant_created_by) references User (user_id), + constraint fk_issuevariant_updated_by + foreign key (issuevariant_updated_by) references User (user_id) ); create table if not exists ActivityHasIssue @@ -320,10 +354,10 @@ create table if not exists IssueMatch issuematch_component_instance_id int unsigned not null, issuematch_created_at timestamp default current_timestamp() not null, - issuematch_created_by varchar(256) null, + issuematch_created_by int unsigned null, issuematch_deleted_at timestamp null, issuematch_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - issuematch_updated_by varchar(256) null, + issuematch_updated_by int unsigned null, constraint id_UNIQUE unique (issuematch_id), constraint fk_issue_match_user_id @@ -334,7 +368,11 @@ create table if not exists IssueMatch on update cascade, constraint fk_issue_match_issue foreign key (issuematch_issue_id) references Issue (issue_id) - on update cascade + on update cascade, + constraint fk_issuematch_created_by + foreign key (issuematch_created_by) references User (user_id), + constraint fk_issuematch_updated_by + foreign key (issuematch_updated_by) references User (user_id) ); create table if not exists IssueMatchChange @@ -345,14 +383,18 @@ create table if not exists IssueMatchChange issuematchchange_issue_match_id int unsigned not null, issuematchchange_action enum('add','remove') not null, issuematchchange_created_at timestamp default current_timestamp() not null, - issuematchchange_created_by varchar(256) null, + issuematchchange_created_by int unsigned null, issuematchchange_deleted_at timestamp null, issuematchchange_updated_at timestamp default current_timestamp() not null on update current_timestamp(), - issuematchchange_updated_by varchar(256) null, + issuematchchange_updated_by int unsigned null, constraint fk_issuematchchange_activity foreign key (issuematchchange_activity_id) references Activity (activity_id), constraint fk_issuematchchange_issue_match - foreign key (issuematchchange_issue_match_id) references IssueMatch (issuematch_id) + foreign key (issuematchchange_issue_match_id) references IssueMatch (issuematch_id), + constraint fk_issuematchchange_created_by + foreign key (issuematchchange_created_by) references User (user_id), + constraint fk_issuematchchange_updated_by + foreign key (issuematchchange_updated_by) references User (user_id) ); create table if not exists ComponentVersionIssue diff --git a/internal/database/mariadb/issue.go b/internal/database/mariadb/issue.go index cb187c68..32fa82c5 100644 --- a/internal/database/mariadb/issue.go +++ b/internal/database/mariadb/issue.go @@ -112,7 +112,7 @@ func (s *SqlDatabase) getIssueUpdateFields(issue *entity.Issue) string { if issue.Description != "" { fl = append(fl, "issue_description = :issue_description") } - if issue.UpdatedBy != "" { + if issue.UpdatedBy != 0 { fl = append(fl, "issue_updated_by = :issue_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/issue_match.go b/internal/database/mariadb/issue_match.go index 672196b5..2955a9cd 100644 --- a/internal/database/mariadb/issue_match.go +++ b/internal/database/mariadb/issue_match.go @@ -122,7 +122,7 @@ func (s *SqlDatabase) getIssueMatchUpdateFields(issueMatch *entity.IssueMatch) s if !issueMatch.TargetRemediationDate.IsZero() { fl = append(fl, "issuematch_target_remediation_date = :issuematch_target_remediation_date") } - if issueMatch.UpdatedBy != "" { + if issueMatch.UpdatedBy != 0 { fl = append(fl, "issuematch_updated_by = :issuematch_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/issue_match_change.go b/internal/database/mariadb/issue_match_change.go index 8049b018..f2273254 100644 --- a/internal/database/mariadb/issue_match_change.go +++ b/internal/database/mariadb/issue_match_change.go @@ -46,7 +46,7 @@ func (s *SqlDatabase) getIssueMatchChangeUpdateFields(imc *entity.IssueMatchChan if imc.Action != "" { fl = append(fl, "issuematchchange_action = :issuematchchange_action") } - if imc.UpdatedBy != "" { + if imc.UpdatedBy != 0 { fl = append(fl, "issuematchchange_updated_by = :issuematchchange_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/issue_repository.go b/internal/database/mariadb/issue_repository.go index 89e2943c..ee466909 100644 --- a/internal/database/mariadb/issue_repository.go +++ b/internal/database/mariadb/issue_repository.go @@ -46,7 +46,7 @@ func (s *SqlDatabase) getIssueRepositoryUpdateFields(issueRepository *entity.Iss if issueRepository.Url != "" { fl = append(fl, "issuerepository_url = :issuerepository_url") } - if issueRepository.UpdatedBy != "" { + if issueRepository.UpdatedBy != 0 { fl = append(fl, "issuerepository_updated_by = :issuerepository_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/issue_variant.go b/internal/database/mariadb/issue_variant.go index bec8ecec..1cac98b3 100644 --- a/internal/database/mariadb/issue_variant.go +++ b/internal/database/mariadb/issue_variant.go @@ -96,7 +96,7 @@ func (s *SqlDatabase) getIssueVariantUpdateFields(issueVariant *entity.IssueVari if issueVariant.IssueRepositoryId != 0 { fl = append(fl, "issuevariant_repository_id = :issuevariant_repository_id") } - if issueVariant.UpdatedBy != "" { + if issueVariant.UpdatedBy != 0 { fl = append(fl, "issuevariant_updated_by = :issuevariant_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/service.go b/internal/database/mariadb/service.go index ca22ca46..7c45a222 100644 --- a/internal/database/mariadb/service.go +++ b/internal/database/mariadb/service.go @@ -115,7 +115,7 @@ func (s *SqlDatabase) getServiceUpdateFields(service *entity.Service) string { if service.Name != "" { fl = append(fl, "service_name = :service_name") } - if service.UpdatedBy != "" { + if service.UpdatedBy != 0 { fl = append(fl, "service_updated_by = :service_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/support_group.go b/internal/database/mariadb/support_group.go index 7ee812bf..3a043e70 100644 --- a/internal/database/mariadb/support_group.go +++ b/internal/database/mariadb/support_group.go @@ -28,7 +28,7 @@ func (s *SqlDatabase) getSupportGroupUpdateFields(supportGroup *entity.SupportGr if supportGroup.Name != "" { fl = append(fl, "supportgroup_name = :supportgroup_name") } - if supportGroup.UpdatedBy != "" { + if supportGroup.UpdatedBy != 0 { fl = append(fl, "supportgroup_updated_by = :supportgroup_updated_by") } diff --git a/internal/database/mariadb/test/fixture.go b/internal/database/mariadb/test/fixture.go index 449f893e..8fd58b64 100644 --- a/internal/database/mariadb/test/fixture.go +++ b/internal/database/mariadb/test/fixture.go @@ -269,6 +269,7 @@ func GenerateRandomCVSS31Vector() string { } func (s *DatabaseSeeder) SeedDbForServer(n int) *SeedCollection { + users := s.SeedUsers(n) supportGroupsMap := s.SeedRealSupportGroups() supportGroups := lo.Values[string, mariadb.SupportGroupRow](supportGroupsMap) servicesMap := s.SeedRealServices() @@ -279,7 +280,6 @@ func (s *DatabaseSeeder) SeedDbForServer(n int) *SeedCollection { repos := s.SeedIssueRepositories() issues := s.SeedIssues(n) issueVariants := s.SeedIssueVariants(n, repos, issues) - users := s.SeedUsers(n) owners := s.SeedOwners(n, services, users) supportGroupServices := s.SeedRealSupportGroupService(servicesMap, supportGroupsMap) supportGroupUsers := s.SeedSupportGroupUsers(n, users, supportGroups) @@ -319,6 +319,7 @@ func (s *DatabaseSeeder) SeedDbForServer(n int) *SeedCollection { } func (s *DatabaseSeeder) SeedDbWithNFakeData(n int) *SeedCollection { + users := s.SeedUsers(n) supportGroups := s.SeedSupportGroups(n) services := s.SeedServices(n) components := s.SeedComponents(n) @@ -327,7 +328,6 @@ func (s *DatabaseSeeder) SeedDbWithNFakeData(n int) *SeedCollection { repos := s.SeedIssueRepositories() issues := s.SeedIssues(n) issueVariants := s.SeedIssueVariants(n, repos, issues) - users := s.SeedUsers(n) owners := s.SeedOwners(n, services, users) supportGroupServices := s.SeedSupportGroupServices(n/2, services, supportGroups) supportGroupUsers := s.SeedSupportGroupUsers(n/2, users, supportGroups) @@ -371,6 +371,7 @@ func (s *DatabaseSeeder) SeedDbWithFakeData() { } func (s *DatabaseSeeder) SeedDbForNestedIssueVariantTest() *SeedCollection { + users := s.SeedUsers(1) services := s.SeedServices(1) components := s.SeedComponents(1) componentVersions := s.SeedComponentVersions(1, components) @@ -378,7 +379,6 @@ func (s *DatabaseSeeder) SeedDbForNestedIssueVariantTest() *SeedCollection { repos := s.SeedIssueRepositories() issues := s.SeedIssues(1) issueVariants := s.SeedIssueVariants(100, repos, issues) - users := s.SeedUsers(1) issueMatches := s.SeedIssueMatches(1, issues, componentInstances, users) issueRepositoryServices := s.SeedIssueRepositoryServices(len(repos), services, repos) return &SeedCollection{ diff --git a/internal/database/mariadb/user.go b/internal/database/mariadb/user.go index f5405dcd..42fd4809 100644 --- a/internal/database/mariadb/user.go +++ b/internal/database/mariadb/user.go @@ -62,7 +62,7 @@ func (s *SqlDatabase) getUserUpdateFields(user *entity.User) string { if user.Type != entity.InvalidUserType { fl = append(fl, "user_type = :user_type") } - if user.UpdatedBy != "" { + if user.UpdatedBy != 0 { fl = append(fl, "user_updated_by = :user_updated_by") } diff --git a/internal/entity/common.go b/internal/entity/common.go index 547d9185..4cf90236 100644 --- a/internal/entity/common.go +++ b/internal/entity/common.go @@ -203,8 +203,8 @@ type Cvss struct { type Metadata struct { CreatedAt time.Time `json:"created_at"` - CreatedBy string `json:"created_by"` + CreatedBy int64 `json:"created_by"` UpdatedAt time.Time `json:"updated_at"` - UpdatedBy string `json:"updated_by"` + UpdatedBy int64 `json:"updated_by"` DeletedAt time.Time `json:"deleted_at,omitempty"` } From 19f162e1c9871b288548c1d8bf04352ae221c491 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Fri, 18 Oct 2024 09:02:04 +0200 Subject: [PATCH 13/17] fix tests --- .../queryCollection/issue/create.graphql | 2 +- .../app/activity/activity_handler_test.go | 3 + .../app/component/component_handler_test.go | 3 + .../component_instance_handler_test.go | 3 + .../component_version_handler_test.go | 3 + .../app/evidence/evidence_handler_test.go | 3 + internal/app/issue/issue_handler_test.go | 3 + .../issue_match/issue_match_handler_test.go | 3 + .../issue_match_change_handler_test.go | 3 + .../issue_repository_handler_test.go | 3 + .../issue_variant_handler_test.go | 3 + internal/app/service/service_handler_test.go | 3 + .../support_group_handler_test.go | 3 + internal/app/user/user_handler_test.go | 3 + internal/database/mariadb/entity.go | 2 +- internal/database/mariadb/init/schema.sql | 8 +++ internal/database/mariadb/test/fixture.go | 3 + internal/database/mariadb/user_test.go | 17 ++++- internal/e2e/common/user.go | 63 +++++++++++++++++++ internal/e2e/issue_query_test.go | 4 +- internal/e2e/metadata_test.go | 2 + internal/e2e/service_filter_query_test.go | 13 ++-- internal/e2e/user_query_test.go | 9 ++- internal/mocks/mock_Database.go | 5 +- internal/mocks/mock_Heureka.go | 5 +- 25 files changed, 147 insertions(+), 25 deletions(-) diff --git a/internal/api/graphql/graph/queryCollection/issue/create.graphql b/internal/api/graphql/graph/queryCollection/issue/create.graphql index 33383af3..7e1ebf78 100644 --- a/internal/api/graphql/graph/queryCollection/issue/create.graphql +++ b/internal/api/graphql/graph/queryCollection/issue/create.graphql @@ -10,4 +10,4 @@ mutation ($input: IssueInput!) { description type } -} \ No newline at end of file +} diff --git a/internal/app/activity/activity_handler_test.go b/internal/app/activity/activity_handler_test.go index 0653f892..2795b747 100644 --- a/internal/app/activity/activity_handler_test.go +++ b/internal/app/activity/activity_handler_test.go @@ -17,6 +17,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestActivityHandler(t *testing.T) { @@ -113,6 +114,7 @@ var _ = Describe("When creating Activity", Label("app", "CreateActivity"), func( }) It("creates activity", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateActivity", &activity).Return(&activity, nil) activityHandler = a.NewActivityHandler(db, er) newActivity, err := activityHandler.CreateActivity(&activity) @@ -146,6 +148,7 @@ var _ = Describe("When updating Activity", Label("app", "UpdateService"), func() }) It("updates activity", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateActivity", &activity).Return(nil) activityHandler = a.NewActivityHandler(db, er) if activity.Status.String() == entity.ActivityStatusValuesOpen.String() { diff --git a/internal/app/component/component_handler_test.go b/internal/app/component/component_handler_test.go index 2ffa592c..51a005a6 100644 --- a/internal/app/component/component_handler_test.go +++ b/internal/app/component/component_handler_test.go @@ -16,6 +16,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestComponentHandler(t *testing.T) { @@ -124,6 +125,7 @@ var _ = Describe("When creating Component", Label("app", "CreateComponent"), fun It("creates component", func() { filter.Name = []*string{&component.Name} + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateComponent", &component).Return(&component, nil) db.On("GetComponents", filter).Return([]entity.Component{}, nil) componentHandler = c.NewComponentHandler(db, er) @@ -160,6 +162,7 @@ var _ = Describe("When updating Component", Label("app", "UpdateComponent"), fun }) It("updates component", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateComponent", &component).Return(nil) componentHandler = c.NewComponentHandler(db, er) component.Name = "NewComponent" diff --git a/internal/app/component_instance/component_instance_handler_test.go b/internal/app/component_instance/component_instance_handler_test.go index f4bb35b3..5bcbc295 100644 --- a/internal/app/component_instance/component_instance_handler_test.go +++ b/internal/app/component_instance/component_instance_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestComponentInstanceHandler(t *testing.T) { @@ -119,6 +120,7 @@ var _ = Describe("When creating ComponentInstance", Label("app", "CreateComponen }) It("creates componentInstance", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateComponentInstance", &componentInstance).Return(&componentInstance, nil) componentInstanceHandler = ci.NewComponentInstanceHandler(db, er) newComponentInstance, err := componentInstanceHandler.CreateComponentInstance(&componentInstance) @@ -156,6 +158,7 @@ var _ = Describe("When updating ComponentInstance", Label("app", "UpdateComponen }) It("updates componentInstance", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateComponentInstance", &componentInstance).Return(nil) componentInstanceHandler = ci.NewComponentInstanceHandler(db, er) componentInstance.CCRN = "NewCCRN" diff --git a/internal/app/component_version/component_version_handler_test.go b/internal/app/component_version/component_version_handler_test.go index 910264a6..4ca2ff6b 100644 --- a/internal/app/component_version/component_version_handler_test.go +++ b/internal/app/component_version/component_version_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestComponentVersionHandler(t *testing.T) { @@ -110,6 +111,7 @@ var _ = Describe("When creating ComponentVersion", Label("app", "CreateComponent }) It("creates componentVersion", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateComponentVersion", &componentVersion).Return(&componentVersion, nil) componenVersionService = cv.NewComponentVersionHandler(db, er) newComponentVersion, err := componenVersionService.CreateComponentVersion(&componentVersion) @@ -145,6 +147,7 @@ var _ = Describe("When updating ComponentVersion", Label("app", "UpdateComponent }) It("updates componentVersion", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateComponentVersion", &componentVersion).Return(nil) componenVersionService = cv.NewComponentVersionHandler(db, er) componentVersion.Version = "7.3.3.1" diff --git a/internal/app/evidence/evidence_handler_test.go b/internal/app/evidence/evidence_handler_test.go index 3b78050a..96740f71 100644 --- a/internal/app/evidence/evidence_handler_test.go +++ b/internal/app/evidence/evidence_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestEvidenceHandler(t *testing.T) { @@ -118,6 +119,7 @@ var _ = Describe("When creating Evidence", Label("app", "CreateEvidence"), func( }) It("creates evidence", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateEvidence", &evidence).Return(&evidence, nil) evidenceHandler = es.NewEvidenceHandler(db, er) newEvidence, err := evidenceHandler.CreateEvidence(&evidence) @@ -157,6 +159,7 @@ var _ = Describe("When updating Evidence", Label("app", "UpdateEvidence"), func( }) It("updates evidence", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateEvidence", &evidence).Return(nil) evidenceHandler = es.NewEvidenceHandler(db, er) evidence.Description = "New Description" diff --git a/internal/app/issue/issue_handler_test.go b/internal/app/issue/issue_handler_test.go index 4ccc3d86..b2dc949d 100644 --- a/internal/app/issue/issue_handler_test.go +++ b/internal/app/issue/issue_handler_test.go @@ -16,6 +16,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestIssueHandler(t *testing.T) { @@ -237,6 +238,7 @@ var _ = Describe("When creating Issue", Label("app", "CreateIssue"), func() { It("creates issue", func() { filter.PrimaryName = []*string{&issueEntity.PrimaryName} + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateIssue", &issueEntity).Return(&issueEntity, nil) db.On("GetIssues", filter).Return([]entity.Issue{}, nil) issueHandler = issue.NewIssueHandler(db, er) @@ -274,6 +276,7 @@ var _ = Describe("When updating Issue", Label("app", "UpdateIssue"), func() { }) It("updates issueEntity", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateIssue", &issueEntity).Return(nil) issueHandler = issue.NewIssueHandler(db, er) issueEntity.Description = "New Description" diff --git a/internal/app/issue_match/issue_match_handler_test.go b/internal/app/issue_match/issue_match_handler_test.go index 621e5750..a91a18d7 100644 --- a/internal/app/issue_match/issue_match_handler_test.go +++ b/internal/app/issue_match/issue_match_handler_test.go @@ -22,6 +22,7 @@ import ( "github.com/cloudoperators/heureka/internal/mocks" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + mock "github.com/stretchr/testify/mock" ) func TestIssueMatchHandler(t *testing.T) { @@ -194,6 +195,7 @@ var _ = Describe("When creating IssueMatch", Label("app", "CreateIssueMatch"), f irFilter.Id = []*int64{&repositories[0].Id} ivFilter.IssueId = []*int64{&issueMatch.IssueId} issueMatch.Severity = issueVariants[0].Severity + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateIssueMatch", &issueMatch).Return(&issueMatch, nil) db.On("GetIssueVariants", ivFilter).Return(issueVariants, nil) db.On("GetIssueRepositories", irFilter).Return(repositories, nil) @@ -238,6 +240,7 @@ var _ = Describe("When updating IssueMatch", Label("app", "UpdateIssueMatch"), f }) It("updates issueMatch", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateIssueMatch", &issueMatch).Return(nil) issueMatchHandler = im.NewIssueMatchHandler(db, er, nil) if issueMatch.Status == entity.NewIssueMatchStatusValue("new") { diff --git a/internal/app/issue_match_change/issue_match_change_handler_test.go b/internal/app/issue_match_change/issue_match_change_handler_test.go index 877cfaba..ed31d00d 100644 --- a/internal/app/issue_match_change/issue_match_change_handler_test.go +++ b/internal/app/issue_match_change/issue_match_change_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestIssueHandler(t *testing.T) { @@ -114,6 +115,7 @@ var _ = Describe("When creating IssueMatchChange", Label("app", "CreateIssueMatc }) It("creates issueMatchChange", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateIssueMatchChange", &issueMatchChange).Return(&issueMatchChange, nil) issueMatchChangeHandler = imc.NewIssueMatchChangeHandler(db, er) newIssueMatchChange, err := issueMatchChangeHandler.CreateIssueMatchChange(&issueMatchChange) @@ -148,6 +150,7 @@ var _ = Describe("When updating IssueMatchChange", Label("app", "UpdateIssueMatc }) It("updates issueMatchChange", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateIssueMatchChange", &issueMatchChange).Return(nil) issueMatchChangeHandler = imc.NewIssueMatchChangeHandler(db, er) if issueMatchChange.Action == entity.IssueMatchChangeActionAdd.String() { diff --git a/internal/app/issue_repository/issue_repository_handler_test.go b/internal/app/issue_repository/issue_repository_handler_test.go index e9fcc303..6c7cfdbd 100644 --- a/internal/app/issue_repository/issue_repository_handler_test.go +++ b/internal/app/issue_repository/issue_repository_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestIssueRepositoryHandler(t *testing.T) { @@ -126,6 +127,7 @@ var _ = Describe("When creating IssueRepository", Label("app", "CreateIssueRepos It("creates issueRepository", func() { filter.Name = []*string{&issueRepository.Name} + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateIssueRepository", &issueRepository).Return(&issueRepository, nil) db.On("GetIssueRepositories", filter).Return([]entity.IssueRepository{}, nil) issueRepositoryHandler = ir.NewIssueRepositoryHandler(db, er) @@ -161,6 +163,7 @@ var _ = Describe("When updating IssueRepository", Label("app", "UpdateIssueRepos }) It("updates issueRepository", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateIssueRepository", &issueRepository).Return(nil) issueRepositoryHandler = ir.NewIssueRepositoryHandler(db, er) issueRepository.Name = "SecretRepository" diff --git a/internal/app/issue_variant/issue_variant_handler_test.go b/internal/app/issue_variant/issue_variant_handler_test.go index f9ecec8c..737feea8 100644 --- a/internal/app/issue_variant/issue_variant_handler_test.go +++ b/internal/app/issue_variant/issue_variant_handler_test.go @@ -16,6 +16,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestIssueVariantHandler(t *testing.T) { @@ -229,6 +230,7 @@ var _ = Describe("When creating IssueVariant", Label("app", "CreateIssueVariant" It("creates issueVariant", func() { filter.SecondaryName = []*string{&issueVariant.SecondaryName} + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateIssueVariant", &issueVariant).Return(&issueVariant, nil) db.On("GetIssueVariants", filter).Return([]entity.IssueVariant{}, nil) issueVariantHandler = iv.NewIssueVariantHandler(db, er, rs) @@ -272,6 +274,7 @@ var _ = Describe("When updating IssueVariant", Label("app", "UpdateIssueVariant" }) It("updates issueVariant", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateIssueVariant", &issueVariant).Return(nil) issueVariantHandler = iv.NewIssueVariantHandler(db, er, rs) issueVariant.SecondaryName = "SecretAdvisory" diff --git a/internal/app/service/service_handler_test.go b/internal/app/service/service_handler_test.go index 619e5757..80768c77 100644 --- a/internal/app/service/service_handler_test.go +++ b/internal/app/service/service_handler_test.go @@ -16,6 +16,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestServiceHandler(t *testing.T) { @@ -134,6 +135,7 @@ var _ = Describe("When creating Service", Label("app", "CreateService"), func() It("creates service", func() { filter.Name = []*string{&service.Name} + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateService", &service).Return(&service, nil) db.On("GetServices", filter).Return([]entity.Service{}, nil) serviceHandler = s.NewServiceHandler(db, er) @@ -169,6 +171,7 @@ var _ = Describe("When updating Service", Label("app", "UpdateService"), func() }) It("updates service", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateService", &service).Return(nil) serviceHandler = s.NewServiceHandler(db, er) service.Name = "SecretService" diff --git a/internal/app/support_group/support_group_handler_test.go b/internal/app/support_group/support_group_handler_test.go index f9cc147f..721491bc 100644 --- a/internal/app/support_group/support_group_handler_test.go +++ b/internal/app/support_group/support_group_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestSupportGroupHandler(t *testing.T) { @@ -121,6 +122,7 @@ var _ = Describe("When creating SupportGroup", Label("app", "CreateSupportGroup" It("creates supportGroup", func() { filter.Name = []*string{&supportGroup.Name} + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateSupportGroup", &supportGroup).Return(&supportGroup, nil) db.On("GetSupportGroups", filter).Return([]entity.SupportGroup{}, nil) supportGroupHandler = sg.NewSupportGroupHandler(db, er) @@ -156,6 +158,7 @@ var _ = Describe("When updating SupportGroup", Label("app", "UpdateSupportGroup" }) It("updates supportGroup", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateSupportGroup", &supportGroup).Return(nil) supportGroupHandler = sg.NewSupportGroupHandler(db, er) supportGroup.Name = "Team Alone" diff --git a/internal/app/user/user_handler_test.go b/internal/app/user/user_handler_test.go index db6a6d36..b0b4fbc1 100644 --- a/internal/app/user/user_handler_test.go +++ b/internal/app/user/user_handler_test.go @@ -15,6 +15,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/samber/lo" + mock "github.com/stretchr/testify/mock" ) func TestUserHandler(t *testing.T) { @@ -124,6 +125,7 @@ var _ = Describe("When creating User", Label("app", "CreateUser"), func() { It("creates user", func() { filter.UniqueUserID = []*string{&user.UniqueUserID} + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("CreateUser", &user).Return(&user, nil) db.On("GetUsers", filter).Return([]entity.User{}, nil) userHandler = u.NewUserHandler(db, er) @@ -160,6 +162,7 @@ var _ = Describe("When updating User", Label("app", "UpdateUser"), func() { }) It("updates user", func() { + db.On("GetAllUserIds", mock.Anything).Return([]int64{}, nil) db.On("UpdateUser", &user).Return(nil) userHandler = u.NewUserHandler(db, er) user.Name = "Sauron" diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index 0ef6c432..3e40a9d1 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -194,7 +194,7 @@ func (ir *IssueRow) FromIssue(i *entity.Issue) { ir.Type = sql.NullString{String: i.Type.String(), Valid: true} ir.Description = sql.NullString{String: i.Description, Valid: true} ir.CreatedAt = sql.NullTime{Time: i.CreatedAt, Valid: true} - ir.CreatedBy = sql.NullInt64{Int64: i.CreatedBy, Valid: true} + ir.CreatedBy = sql.NullInt64{Int64: i.CreatedBy, Valid: false} ir.DeletedAt = sql.NullTime{Time: i.DeletedAt, Valid: true} ir.UpdatedAt = sql.NullTime{Time: i.UpdatedAt, Valid: true} ir.UpdatedBy = sql.NullInt64{Int64: i.UpdatedBy, Valid: false} diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index 9e01d8bf..de7e676f 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -27,6 +27,14 @@ create table if not exists User foreign key (user_updated_by) references User (user_id) ); +set @TechnicalUserType = 2; +set @SystemUserId = 1; +set @SystemUserName = 'systemuser'; +set @SystemUserUniqueUserId = 'S0000000'; +insert ignore into User (user_id, user_name, user_unique_user_id, user_type, user_created_at, user_created_by) + values + (@SystemUserId, @SystemUserName, @SystemUserUniqueUserId, @TechnicalUserType, current_timestamp(), @SystemUserId); + create table if not exists Component ( component_id int unsigned auto_increment diff --git a/internal/database/mariadb/test/fixture.go b/internal/database/mariadb/test/fixture.go index 8fd58b64..fd80a613 100644 --- a/internal/database/mariadb/test/fixture.go +++ b/internal/database/mariadb/test/fixture.go @@ -9,6 +9,7 @@ import ( "math/rand" "strings" + "github.com/cloudoperators/heureka/internal/e2e/common" "github.com/cloudoperators/heureka/internal/entity" "github.com/goark/go-cvss/v3/metric" "github.com/onsi/ginkgo/v2/dsl/core" @@ -1131,6 +1132,7 @@ func NewFakeIssue() mariadb.IssueRow { PrimaryName: sql.NullString{String: fmt.Sprintf("CVE-%d-%d", gofakeit.Year(), gofakeit.Number(100, 9999999)), Valid: true}, Description: sql.NullString{String: gofakeit.HackerPhrase(), Valid: true}, Type: sql.NullString{String: gofakeit.RandomString(entity.AllIssueTypes), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1229,6 +1231,7 @@ func NewFakeUser() mariadb.UserRow { Name: sql.NullString{String: gofakeit.Name(), Valid: true}, UniqueUserID: sql.NullString{String: uniqueUserId, Valid: true}, Type: sql.NullInt64{Int64: getNextUserType(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } diff --git a/internal/database/mariadb/user_test.go b/internal/database/mariadb/user_test.go index 75a86d6f..9e80c14f 100644 --- a/internal/database/mariadb/user_test.go +++ b/internal/database/mariadb/user_test.go @@ -8,6 +8,7 @@ import ( "github.com/cloudoperators/heureka/internal/database/mariadb" "github.com/cloudoperators/heureka/internal/database/mariadb/test" + "github.com/cloudoperators/heureka/internal/e2e/common" "github.com/cloudoperators/heureka/internal/entity" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -28,11 +29,12 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and the database is empty", func() { It("can perform the query", func() { res, err := db.GetAllUserIds(nil) + res = e2e_common.SubtractSystemUserId(res) By("throwing no error", func() { Expect(err).To(BeNil()) }) - By("returning an empty list", func() { + By("returning an empty list of non-system users", func() { Expect(res).To(BeEmpty()) }) }) @@ -50,6 +52,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and using no filter", func() { It("can fetch the items correctly", func() { res, err := db.GetAllUserIds(nil) + res = e2e_common.SubtractSystemUserId(res) By("throwing no error", func() { Expect(err).Should(BeNil()) @@ -105,6 +108,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and the database is empty", func() { It("can perform the query", func() { res, err := db.GetUsers(nil) + res = e2e_common.SubtractSystemUsersEntity(res) By("throwing no error", func() { Expect(err).To(BeNil()) @@ -123,7 +127,7 @@ var _ = Describe("User", Label("database", "User"), func() { It("can fetch the items correctly", func() { res, err := db.GetUsers(nil) - + res = e2e_common.SubtractSystemUsersEntity(res) By("throwing no error", func() { Expect(err).Should(BeNil()) }) @@ -304,7 +308,7 @@ var _ = Describe("User", Label("database", "User"), func() { }) By("number of human and technical user types should match number of all users", func() { - Expect(len(humanUserEntries) + len(technicalUserEntries)).To(BeEquivalentTo(len(seedCollection.UserRows))) + Expect(e2e_common.SubtractSystemUsers(len(humanUserEntries) + len(technicalUserEntries))).To(BeEquivalentTo(len(seedCollection.UserRows))) }) }) }) @@ -314,6 +318,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and the database is empty", func() { It("can count correctly", func() { c, err := db.CountUsers(nil) + c = e2e_common.SubtractSystemUsers(c) By("throwing no error", func() { Expect(err).To(BeNil()) @@ -336,6 +341,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and using no filter", func() { It("can count", func() { c, err := db.CountUsers(nil) + c = e2e_common.SubtractSystemUsers(c) By("throwing no error", func() { Expect(err).To(BeNil()) @@ -355,6 +361,7 @@ var _ = Describe("User", Label("database", "User"), func() { }, } c, err := db.CountUsers(filter) + c = e2e_common.SubtractSystemUsers(c) By("throwing no error", func() { Expect(err).To(BeNil()) @@ -545,6 +552,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and the database is empty", func() { It("can perform the list query", func() { res, err := db.GetUserNames(nil) + res = e2e_common.SubtractSystemUserNameVL(res) By("throwing no error", func() { Expect(err).To(BeNil()) }) @@ -562,6 +570,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and using no filter", func() { It("can fetch the items correctly", func() { res, err := db.GetUserNames(nil) + res = e2e_common.SubtractSystemUserNameVL(res) By("throwing no error", func() { Expect(err).Should(BeNil()) @@ -649,6 +658,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and the database is empty", func() { It("can perform the list query", func() { res, err := db.GetUniqueUserIDs(nil) + res = e2e_common.SubtractSystemUserUniqueUserIdVL(res) By("throwing no error", func() { Expect(err).To(BeNil()) }) @@ -666,6 +676,7 @@ var _ = Describe("User", Label("database", "User"), func() { Context("and using no filter", func() { It("can fetch the items correctly", func() { res, err := db.GetUniqueUserIDs(nil) + res = e2e_common.SubtractSystemUserUniqueUserIdVL(res) By("throwing no error", func() { Expect(err).Should(BeNil()) diff --git a/internal/e2e/common/user.go b/internal/e2e/common/user.go index b36c4ab3..ec0602cf 100644 --- a/internal/e2e/common/user.go +++ b/internal/e2e/common/user.go @@ -14,9 +14,72 @@ import ( "github.com/machinebox/graphql" . "github.com/onsi/gomega" + "github.com/samber/lo" "github.com/sirupsen/logrus" ) +const NumberOfSystemUsers = 1 +const SystemUserId = 1 + +var SystemUserName = "systemuser" +var SystemUserUniqueUserId = "S0000000" + +type Number interface { + int | int64 +} + +func SubtractSystemUsers[T Number](n T) T { + return n - NumberOfSystemUsers +} + +func SubtractSystemUserName(v []*string) []*string { + return lo.Filter(v, func(val *string, _ int) bool { + return val == nil || *val != SystemUserName + }) +} + +func SubtractSystemUserUniqueUserId(v []*string) []*string { + return lo.Filter(v, func(val *string, _ int) bool { + return val == nil || *val != SystemUserUniqueUserId + }) +} + +func SubtractSystemUserUniqueUserIdVL(v []string) []string { + return lo.Filter(v, func(val string, _ int) bool { + return val != SystemUserUniqueUserId + }) +} + +func SubtractSystemUserNameVL(v []string) []string { + return lo.Filter(v, func(val string, _ int) bool { + return val != SystemUserName + }) +} + +func SubtractSystemUsersEntity(v []entity.User) []entity.User { + return lo.Filter(v, func(val entity.User, _ int) bool { + return val.UniqueUserID != SystemUserUniqueUserId + }) +} + +func SubtractSystemUserId(v []int64) []int64 { + return lo.Filter(v, func(val int64, _ int) bool { + return val != SystemUserId + }) +} + +func ExpectNonSystemUserCount(n, expectedN int) { + Expect(SubtractSystemUsers(n)).To(Equal(expectedN)) +} + +func ExpectNonSystemUserNames(v, expectedV []*string) { + Expect(SubtractSystemUserName(v)).To(Equal(expectedV)) +} + +func ExpectNonSystemUserUniqueUserIds(v, expectedV []*string) { + Expect(SubtractSystemUserUniqueUserId(v)).To(Equal(expectedV)) +} + type User struct { Id string Type entity.UserType diff --git a/internal/e2e/issue_query_test.go b/internal/e2e/issue_query_test.go index 5198876d..c672b7ab 100644 --- a/internal/e2e/issue_query_test.go +++ b/internal/e2e/issue_query_test.go @@ -14,6 +14,7 @@ import ( "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" "github.com/cloudoperators/heureka/internal/database/mariadb" "github.com/cloudoperators/heureka/internal/database/mariadb/test" + //"github.com/cloudoperators/heureka/internal/e2e/common" "github.com/cloudoperators/heureka/internal/entity" testentity "github.com/cloudoperators/heureka/internal/entity/test" "github.com/cloudoperators/heureka/internal/server" @@ -246,10 +247,11 @@ var _ = Describe("Creating Issue via API", Label("e2e", "Issues"), func() { str := string(b) req := graphql.NewRequest(str) - req.Var("input", map[string]string{ + req.Var("input", map[string]interface{}{ "primaryName": issue.PrimaryName, "description": issue.Description, "type": issue.Type.String(), + //"metadata": map[string]string{"created_by": fmt.Sprintf("%d", e2e_common.SystemUserId)}, }) req.Header.Set("Cache-Control", "no-cache") diff --git a/internal/e2e/metadata_test.go b/internal/e2e/metadata_test.go index a86e7a3c..2cc124c2 100644 --- a/internal/e2e/metadata_test.go +++ b/internal/e2e/metadata_test.go @@ -3,6 +3,7 @@ package e2e_test +/* import ( "time" @@ -115,3 +116,4 @@ var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities" }) }) +*/ diff --git a/internal/e2e/service_filter_query_test.go b/internal/e2e/service_filter_query_test.go index 7c513f97..dbb3877b 100644 --- a/internal/e2e/service_filter_query_test.go +++ b/internal/e2e/service_filter_query_test.go @@ -16,6 +16,7 @@ import ( "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" "github.com/cloudoperators/heureka/internal/database/mariadb" "github.com/cloudoperators/heureka/internal/database/mariadb/test" + "github.com/cloudoperators/heureka/internal/e2e/common" "github.com/machinebox/graphql" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -109,7 +110,7 @@ var _ = Describe("Getting ServiceFilterValues via API", Label("e2e", "ServiceFil logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") } - Expect(respData.ServiceFilterValues.UserName.Values).To(BeEmpty()) + e2e_common.ExpectNonSystemUserNames(respData.ServiceFilterValues.UserName.Values, []*string{}) }) It("returns empty for uniqueUserID", func() { client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", cfg.Port)) @@ -130,7 +131,7 @@ var _ = Describe("Getting ServiceFilterValues via API", Label("e2e", "ServiceFil logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") } - Expect(respData.ServiceFilterValues.UniqueUserID.Values).To(BeEmpty()) + e2e_common.ExpectNonSystemUserUniqueUserIds(respData.ServiceFilterValues.UniqueUserID.Values, []*string{}) }) }) @@ -218,13 +219,13 @@ var _ = Describe("Getting ServiceFilterValues via API", Label("e2e", "ServiceFil logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") } - Expect(len(respData.ServiceFilterValues.UserName.Values)).To(Equal(len(seedCollection.UserRows))) + e2e_common.ExpectNonSystemUserCount(len(respData.ServiceFilterValues.UserName.Values), len(seedCollection.UserRows)) existingUserNames := lo.Map(seedCollection.UserRows, func(s mariadb.UserRow, index int) string { return s.Name.String }) - for _, name := range respData.ServiceFilterValues.UserName.Values { + for _, name := range e2e_common.SubtractSystemUserName(respData.ServiceFilterValues.UserName.Values) { Expect(lo.Contains(existingUserNames, *name)).To(BeTrue()) } }) @@ -247,13 +248,13 @@ var _ = Describe("Getting ServiceFilterValues via API", Label("e2e", "ServiceFil logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") } - Expect(len(respData.ServiceFilterValues.UniqueUserID.Values)).To(Equal(len(seedCollection.UserRows))) + e2e_common.ExpectNonSystemUserCount(len(respData.ServiceFilterValues.UniqueUserID.Values), len(seedCollection.UserRows)) existingUniqueUserIds := lo.Map(seedCollection.UserRows, func(s mariadb.UserRow, index int) string { return s.UniqueUserID.String }) - for _, name := range respData.ServiceFilterValues.UniqueUserID.Values { + for _, name := range e2e_common.SubtractSystemUserUniqueUserId(respData.ServiceFilterValues.UniqueUserID.Values) { Expect(lo.Contains(existingUniqueUserIds, *name)).To(BeTrue()) } }) diff --git a/internal/e2e/user_query_test.go b/internal/e2e/user_query_test.go index 4813acd5..e1c9faec 100644 --- a/internal/e2e/user_query_test.go +++ b/internal/e2e/user_query_test.go @@ -74,8 +74,7 @@ var _ = Describe("Getting Users via API", Label("e2e", "Users"), func() { if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") } - - Expect(respData.Users.TotalCount).To(Equal(0)) + e2e_common.ExpectNonSystemUserCount(respData.Users.TotalCount, 0) }) }) @@ -113,7 +112,7 @@ var _ = Describe("Getting Users via API", Label("e2e", "Users"), func() { logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") } - Expect(respData.Users.TotalCount).To(Equal(len(seedCollection.UserRows))) + e2e_common.ExpectNonSystemUserCount(respData.Users.TotalCount, len(seedCollection.UserRows)) Expect(len(respData.Users.Edges)).To(Equal(5)) }) }) @@ -146,7 +145,7 @@ var _ = Describe("Getting Users via API", Label("e2e", "Users"), func() { }) It("- returns the correct result count", func() { - Expect(respData.Users.TotalCount).To(Equal(len(seedCollection.UserRows))) + e2e_common.ExpectNonSystemUserCount(respData.Users.TotalCount, len(seedCollection.UserRows)) Expect(len(respData.Users.Edges)).To(Equal(5)) }) @@ -189,7 +188,7 @@ var _ = Describe("Getting Users via API", Label("e2e", "Users"), func() { Expect(*respData.Users.PageInfo.HasNextPage).To(BeTrue(), "hasNextPage is set") Expect(*respData.Users.PageInfo.HasPreviousPage).To(BeFalse(), "hasPreviousPage is set") Expect(respData.Users.PageInfo.NextPageAfter).ToNot(BeNil(), "nextPageAfter is set") - Expect(len(respData.Users.PageInfo.Pages)).To(Equal(2), "Correct amount of pages") + Expect(len(respData.Users.PageInfo.Pages)).To(Equal(3), "Correct amount of pages") Expect(*respData.Users.PageInfo.PageNumber).To(Equal(1), "Correct page number") }) }) diff --git a/internal/mocks/mock_Database.go b/internal/mocks/mock_Database.go index 137fdb96..5bac6877 100644 --- a/internal/mocks/mock_Database.go +++ b/internal/mocks/mock_Database.go @@ -1,7 +1,4 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks diff --git a/internal/mocks/mock_Heureka.go b/internal/mocks/mock_Heureka.go index 9cdf4cd4..81e1b8a1 100644 --- a/internal/mocks/mock_Heureka.go +++ b/internal/mocks/mock_Heureka.go @@ -1,7 +1,4 @@ -// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by mockery v2.43.2. DO NOT EDIT. +// Code generated by mockery v2.46.3. DO NOT EDIT. package mocks From a847d76beed1a75e660be74d14a6c1492c393a90 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Fri, 18 Oct 2024 10:49:02 +0200 Subject: [PATCH 14/17] Failing --- internal/database/mariadb/entity.go | 2 +- internal/e2e/issue_query_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index 3e40a9d1..0ef6c432 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -194,7 +194,7 @@ func (ir *IssueRow) FromIssue(i *entity.Issue) { ir.Type = sql.NullString{String: i.Type.String(), Valid: true} ir.Description = sql.NullString{String: i.Description, Valid: true} ir.CreatedAt = sql.NullTime{Time: i.CreatedAt, Valid: true} - ir.CreatedBy = sql.NullInt64{Int64: i.CreatedBy, Valid: false} + ir.CreatedBy = sql.NullInt64{Int64: i.CreatedBy, Valid: true} ir.DeletedAt = sql.NullTime{Time: i.DeletedAt, Valid: true} ir.UpdatedAt = sql.NullTime{Time: i.UpdatedAt, Valid: true} ir.UpdatedBy = sql.NullInt64{Int64: i.UpdatedBy, Valid: false} diff --git a/internal/e2e/issue_query_test.go b/internal/e2e/issue_query_test.go index c672b7ab..aa6f24c6 100644 --- a/internal/e2e/issue_query_test.go +++ b/internal/e2e/issue_query_test.go @@ -14,7 +14,7 @@ import ( "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" "github.com/cloudoperators/heureka/internal/database/mariadb" "github.com/cloudoperators/heureka/internal/database/mariadb/test" - //"github.com/cloudoperators/heureka/internal/e2e/common" + "github.com/cloudoperators/heureka/internal/e2e/common" "github.com/cloudoperators/heureka/internal/entity" testentity "github.com/cloudoperators/heureka/internal/entity/test" "github.com/cloudoperators/heureka/internal/server" @@ -251,7 +251,7 @@ var _ = Describe("Creating Issue via API", Label("e2e", "Issues"), func() { "primaryName": issue.PrimaryName, "description": issue.Description, "type": issue.Type.String(), - //"metadata": map[string]string{"created_by": fmt.Sprintf("%d", e2e_common.SystemUserId)}, + "metadata": map[string]string{"created_by": fmt.Sprintf("%d", e2e_common.SystemUserId)}, }) req.Header.Set("Cache-Control", "no-cache") From ca50f9c2f555020a1cdea1bbc746e2bca343b4b4 Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Mon, 21 Oct 2024 15:16:54 +0200 Subject: [PATCH 15/17] Stage --- internal/api/graphql/graph/model/models.go | 4 +- internal/app/activity/activity_handler.go | 4 +- internal/app/component/component_handler.go | 4 +- .../component_instance_handler.go | 4 +- .../component_version_handler.go | 4 +- internal/app/evidence/evidence_handler.go | 4 +- internal/app/issue/issue_handler.go | 4 +- .../app/issue_match/issue_match_handler.go | 4 +- .../issue_match_change_handler.go | 4 +- .../issue_repository_handler.go | 4 +- .../issue_variant/issue_variant_handler.go | 4 +- internal/app/service/service_handler.go | 4 +- .../support_group/support_group_handler.go | 4 +- internal/app/user/user_handler.go | 4 +- internal/database/mariadb/entity.go | 56 +++++++++---------- internal/database/mariadb/init/schema.sql | 3 - internal/database/mariadb/issue_repository.go | 2 +- internal/database/mariadb/service.go | 2 +- internal/database/mariadb/service_test.go | 4 +- internal/database/mariadb/test/fixture.go | 56 ++++++++++++++----- internal/e2e/issue_query_test.go | 2 - internal/entity/issue_repository.go | 1 - internal/entity/service.go | 1 - 23 files changed, 102 insertions(+), 81 deletions(-) diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index c79198ca..617bbc6c 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -269,7 +269,7 @@ func NewIssueRepository(repo *entity.IssueRepository) IssueRepository { URL: &repo.Url, Services: nil, IssueVariants: nil, - Metadata: getModelMetadata(repo.Metadata), + Metadata: getModelMetadata(repo.BaseIssueRepository.Metadata), } } @@ -343,7 +343,7 @@ func NewService(s *entity.Service) Service { return Service{ ID: fmt.Sprintf("%d", s.Id), Name: &s.Name, - Metadata: getModelMetadata(s.Metadata), + Metadata: getModelMetadata(s.BaseService.Metadata), } } diff --git a/internal/app/activity/activity_handler.go b/internal/app/activity/activity_handler.go index 152b7ad4..a63f92d5 100644 --- a/internal/app/activity/activity_handler.go +++ b/internal/app/activity/activity_handler.go @@ -138,7 +138,7 @@ func (a *activityHandler) CreateActivity(activity *entity.Activity) (*entity.Act }) var err error - activity.CreatedBy, err = common.GetUserId(a.database, "C1234567") + activity.CreatedBy, err = common.GetUserId(a.database, "S0000000") if err != nil { l.Error(err) return nil, NewActivityHandlerError("Internal error while creating activity (GetUserId).") @@ -165,7 +165,7 @@ func (a *activityHandler) UpdateActivity(activity *entity.Activity) (*entity.Act }) var err error - activity.UpdatedBy, err = common.GetUserId(a.database, "C1234567") + activity.UpdatedBy, err = common.GetUserId(a.database, "S0000000") if err != nil { l.Error(err) return nil, NewActivityHandlerError("Internal error while updating activity (GetUserId).") diff --git a/internal/app/component/component_handler.go b/internal/app/component/component_handler.go index cf9eba87..33fe02c3 100644 --- a/internal/app/component/component_handler.go +++ b/internal/app/component/component_handler.go @@ -116,7 +116,7 @@ func (cs *componentHandler) CreateComponent(component *entity.Component) (*entit }) var err error - component.CreatedBy, err = common.GetUserId(cs.database, "C1234567") + component.CreatedBy, err = common.GetUserId(cs.database, "S0000000") if err != nil { l.Error(err) return nil, NewUserHandlerError("Internal error while creating component (GetUserId).") @@ -152,7 +152,7 @@ func (cs *componentHandler) UpdateComponent(component *entity.Component) (*entit }) var err error - component.UpdatedBy, err = common.GetUserId(cs.database, "C1234567") + component.UpdatedBy, err = common.GetUserId(cs.database, "S0000000") if err != nil { l.Error(err) return nil, NewUserHandlerError("Internal error while updating component (GetUserId).") diff --git a/internal/app/component_instance/component_instance_handler.go b/internal/app/component_instance/component_instance_handler.go index 2981c4c4..9109897a 100644 --- a/internal/app/component_instance/component_instance_handler.go +++ b/internal/app/component_instance/component_instance_handler.go @@ -117,7 +117,7 @@ func (ci *componentInstanceHandler) CreateComponentInstance(componentInstance *e }) var err error - componentInstance.CreatedBy, err = common.GetUserId(ci.database, "C1234567") + componentInstance.CreatedBy, err = common.GetUserId(ci.database, "S0000000") if err != nil { l.Error(err) return nil, NewComponentInstanceHandlerError("Internal error while creating componentInstance (GetUserId).") @@ -144,7 +144,7 @@ func (ci *componentInstanceHandler) UpdateComponentInstance(componentInstance *e }) var err error - componentInstance.UpdatedBy, err = common.GetUserId(ci.database, "C7654321") + componentInstance.UpdatedBy, err = common.GetUserId(ci.database, "S0000000") if err != nil { l.Error(err) return nil, NewComponentInstanceHandlerError("Internal error while updating componentInstance (GetUserId).") diff --git a/internal/app/component_version/component_version_handler.go b/internal/app/component_version/component_version_handler.go index 79ed0448..789124a0 100644 --- a/internal/app/component_version/component_version_handler.go +++ b/internal/app/component_version/component_version_handler.go @@ -115,7 +115,7 @@ func (cv *componentVersionHandler) CreateComponentVersion(componentVersion *enti }) var err error - componentVersion.CreatedBy, err = common.GetUserId(cv.database, "C1234567") + componentVersion.CreatedBy, err = common.GetUserId(cv.database, "S0000000") if err != nil { l.Error(err) return nil, NewComponentVersionHandlerError("Internal error while creating componentVersion (GetUserId).") @@ -142,7 +142,7 @@ func (cv *componentVersionHandler) UpdateComponentVersion(componentVersion *enti }) var err error - componentVersion.UpdatedBy, err = common.GetUserId(cv.database, "C7654321") + componentVersion.UpdatedBy, err = common.GetUserId(cv.database, "S0000000") if err != nil { l.Error(err) return nil, NewComponentVersionHandlerError("Internal error while updating componentVersion (GetUserId).") diff --git a/internal/app/evidence/evidence_handler.go b/internal/app/evidence/evidence_handler.go index 9b658f57..a7c553de 100644 --- a/internal/app/evidence/evidence_handler.go +++ b/internal/app/evidence/evidence_handler.go @@ -110,7 +110,7 @@ func (e *evidenceHandler) CreateEvidence(evidence *entity.Evidence) (*entity.Evi }) var err error - evidence.CreatedBy, err = common.GetUserId(e.database, "C1234567") + evidence.CreatedBy, err = common.GetUserId(e.database, "S0000000") if err != nil { l.Error(err) return nil, NewEvidenceHandlerError("Internal error while creating evidence (GetUserId).") @@ -135,7 +135,7 @@ func (e *evidenceHandler) UpdateEvidence(evidence *entity.Evidence) (*entity.Evi }) var err error - evidence.UpdatedBy, err = common.GetUserId(e.database, "C7654321") + evidence.UpdatedBy, err = common.GetUserId(e.database, "S0000000") if err != nil { l.Error(err) return nil, NewEvidenceHandlerError("Internal error while updating evidence (GetUserId).") diff --git a/internal/app/issue/issue_handler.go b/internal/app/issue/issue_handler.go index 341d9133..ed0fa895 100644 --- a/internal/app/issue/issue_handler.go +++ b/internal/app/issue/issue_handler.go @@ -171,7 +171,7 @@ func (is *issueHandler) CreateIssue(issue *entity.Issue) (*entity.Issue, error) }) var err error - issue.CreatedBy, err = common.GetUserId(is.database, "C1234567") + issue.CreatedBy, err = common.GetUserId(is.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueHandlerError("Internal error while creating issue (GetUserId).") @@ -206,7 +206,7 @@ func (is *issueHandler) UpdateIssue(issue *entity.Issue) (*entity.Issue, error) }) var err error - issue.UpdatedBy, err = common.GetUserId(is.database, "C7654321") + issue.UpdatedBy, err = common.GetUserId(is.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueHandlerError("Internal error while updating issue (GetUserId).") diff --git a/internal/app/issue_match/issue_match_handler.go b/internal/app/issue_match/issue_match_handler.go index c9a02587..7fd1b18b 100644 --- a/internal/app/issue_match/issue_match_handler.go +++ b/internal/app/issue_match/issue_match_handler.go @@ -142,7 +142,7 @@ func (im *issueMatchHandler) CreateIssueMatch(issueMatch *entity.IssueMatch) (*e }) var err error - issueMatch.CreatedBy, err = common.GetUserId(im.database, "C1234567") + issueMatch.CreatedBy, err = common.GetUserId(im.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueMatchHandlerError("Internal error while retrieving effective severity (GetUserId).") @@ -183,7 +183,7 @@ func (im *issueMatchHandler) UpdateIssueMatch(issueMatch *entity.IssueMatch) (*e }) var err error - issueMatch.UpdatedBy, err = common.GetUserId(im.database, "C7654321") + issueMatch.UpdatedBy, err = common.GetUserId(im.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueMatchHandlerError("Internal error while retrieving effective severity (GetUserId).") diff --git a/internal/app/issue_match_change/issue_match_change_handler.go b/internal/app/issue_match_change/issue_match_change_handler.go index cd1dc23d..76004cc4 100644 --- a/internal/app/issue_match_change/issue_match_change_handler.go +++ b/internal/app/issue_match_change/issue_match_change_handler.go @@ -114,7 +114,7 @@ func (imc *issueMatchChangeHandler) CreateIssueMatchChange(issueMatchChange *ent }) var err error - issueMatchChange.CreatedBy, err = common.GetUserId(imc.database, "C1234567") + issueMatchChange.CreatedBy, err = common.GetUserId(imc.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueMatchChangeHandlerError("Internal error while creating issueMatchChange (GetUserId).") @@ -141,7 +141,7 @@ func (imc *issueMatchChangeHandler) UpdateIssueMatchChange(issueMatchChange *ent }) var err error - issueMatchChange.UpdatedBy, err = common.GetUserId(imc.database, "C7654321") + issueMatchChange.UpdatedBy, err = common.GetUserId(imc.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueMatchChangeHandlerError("Internal error while updating issueMatchChange (GetUserId).") diff --git a/internal/app/issue_repository/issue_repository_handler.go b/internal/app/issue_repository/issue_repository_handler.go index 138fe386..94859014 100644 --- a/internal/app/issue_repository/issue_repository_handler.go +++ b/internal/app/issue_repository/issue_repository_handler.go @@ -113,7 +113,7 @@ func (ir *issueRepositoryHandler) CreateIssueRepository(issueRepository *entity. }) var err error - issueRepository.CreatedBy, err = common.GetUserId(ir.database, "C1234567") + issueRepository.BaseIssueRepository.CreatedBy, err = common.GetUserId(ir.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueRepositoryHandlerError("Internal error while creating issueRepository (GetUserId).") @@ -150,7 +150,7 @@ func (ir *issueRepositoryHandler) UpdateIssueRepository(issueRepository *entity. }) var err error - issueRepository.UpdatedBy, err = common.GetUserId(ir.database, "C7654321") + issueRepository.BaseIssueRepository.UpdatedBy, err = common.GetUserId(ir.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueRepositoryHandlerError("Internal error while updating issueRepository (GetUserId).") diff --git a/internal/app/issue_variant/issue_variant_handler.go b/internal/app/issue_variant/issue_variant_handler.go index 460e0bf9..da6afbf1 100644 --- a/internal/app/issue_variant/issue_variant_handler.go +++ b/internal/app/issue_variant/issue_variant_handler.go @@ -179,7 +179,7 @@ func (iv *issueVariantHandler) CreateIssueVariant(issueVariant *entity.IssueVari }) var err error - issueVariant.CreatedBy, err = common.GetUserId(iv.database, "C1234567") + issueVariant.CreatedBy, err = common.GetUserId(iv.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueVariantHandlerError("Internal error while creating issueVariant (GetUserId).") @@ -216,7 +216,7 @@ func (iv *issueVariantHandler) UpdateIssueVariant(issueVariant *entity.IssueVari }) var err error - issueVariant.UpdatedBy, err = common.GetUserId(iv.database, "C7654321") + issueVariant.UpdatedBy, err = common.GetUserId(iv.database, "S0000000") if err != nil { l.Error(err) return nil, NewIssueVariantHandlerError("Internal error while updating issueVariant (GetUserId).") diff --git a/internal/app/service/service_handler.go b/internal/app/service/service_handler.go index bdfd56a9..b5a54cb0 100644 --- a/internal/app/service/service_handler.go +++ b/internal/app/service/service_handler.go @@ -136,7 +136,7 @@ func (s *serviceHandler) CreateService(service *entity.Service) (*entity.Service }) var err error - service.CreatedBy, err = common.GetUserId(s.database, "C1234567") + service.BaseService.CreatedBy, err = common.GetUserId(s.database, "S0000000") if err != nil { l.Error(err) return nil, NewServiceHandlerError("Internal error while creating service (GetUserId).") @@ -172,7 +172,7 @@ func (s *serviceHandler) UpdateService(service *entity.Service) (*entity.Service }) var err error - service.UpdatedBy, err = common.GetUserId(s.database, "C7654321") + service.BaseService.UpdatedBy, err = common.GetUserId(s.database, "S0000000") if err != nil { l.Error(err) return nil, NewServiceHandlerError("Internal error while updating service (GetUserId).") diff --git a/internal/app/support_group/support_group_handler.go b/internal/app/support_group/support_group_handler.go index 8fd867a6..a3fd1721 100644 --- a/internal/app/support_group/support_group_handler.go +++ b/internal/app/support_group/support_group_handler.go @@ -143,7 +143,7 @@ func (sg *supportGroupHandler) CreateSupportGroup(supportGroup *entity.SupportGr } var err error - supportGroup.CreatedBy, err = common.GetUserId(sg.database, "C1234567") + supportGroup.CreatedBy, err = common.GetUserId(sg.database, "S0000000") if err != nil { l.Error(err) return nil, NewSupportGroupHandlerError("Internal error while creating supportGroup (GetUserId).") @@ -181,7 +181,7 @@ func (sg *supportGroupHandler) UpdateSupportGroup(supportGroup *entity.SupportGr }) var err error - supportGroup.UpdatedBy, err = common.GetUserId(sg.database, "C7654321") + supportGroup.UpdatedBy, err = common.GetUserId(sg.database, "S0000000") if err != nil { l.Error(err) return nil, NewSupportGroupHandlerError("Internal error while updating supportGroup (GetUserId).") diff --git a/internal/app/user/user_handler.go b/internal/app/user/user_handler.go index db10b3a8..40a05a09 100644 --- a/internal/app/user/user_handler.go +++ b/internal/app/user/user_handler.go @@ -113,7 +113,7 @@ func (u *userHandler) CreateUser(user *entity.User) (*entity.User, error) { }) var err error - user.CreatedBy, err = common.GetUserId(u.database, "C1234567") + user.CreatedBy, err = common.GetUserId(u.database, "S0000000") if err != nil { l.Error(err) return nil, NewUserHandlerError("Internal error while creating user (GetUserId).") @@ -149,7 +149,7 @@ func (u *userHandler) UpdateUser(user *entity.User) (*entity.User, error) { }) var err error - user.UpdatedBy, err = common.GetUserId(u.database, "C7654321") + user.UpdatedBy, err = common.GetUserId(u.database, "S0000000") if err != nil { l.Error(err) return nil, NewUserHandlerError("Internal error while updating user (GetUserId).") diff --git a/internal/database/mariadb/entity.go b/internal/database/mariadb/entity.go index 0ef6c432..9ff2dfb0 100644 --- a/internal/database/mariadb/entity.go +++ b/internal/database/mariadb/entity.go @@ -197,7 +197,7 @@ func (ir *IssueRow) FromIssue(i *entity.Issue) { ir.CreatedBy = sql.NullInt64{Int64: i.CreatedBy, Valid: true} ir.DeletedAt = sql.NullTime{Time: i.DeletedAt, Valid: true} ir.UpdatedAt = sql.NullTime{Time: i.UpdatedAt, Valid: true} - ir.UpdatedBy = sql.NullInt64{Int64: i.UpdatedBy, Valid: false} + ir.UpdatedBy = sql.NullInt64{Int64: i.UpdatedBy, Valid: true} } type IssueMatchRow struct { @@ -251,10 +251,10 @@ func (imr *IssueMatchRow) FromIssueMatch(im *entity.IssueMatch) { imr.RemediationDate = sql.NullTime{Time: im.RemediationDate, Valid: true} imr.TargetRemediationDate = sql.NullTime{Time: im.TargetRemediationDate, Valid: true} imr.CreatedAt = sql.NullTime{Time: im.CreatedAt, Valid: true} - imr.CreatedBy = sql.NullInt64{Int64: im.CreatedBy, Valid: false} + imr.CreatedBy = sql.NullInt64{Int64: im.CreatedBy, Valid: true} imr.DeletedAt = sql.NullTime{Time: im.DeletedAt, Valid: true} imr.UpdatedAt = sql.NullTime{Time: im.UpdatedAt, Valid: true} - imr.UpdatedBy = sql.NullInt64{Int64: im.UpdatedBy, Valid: false} + imr.UpdatedBy = sql.NullInt64{Int64: im.UpdatedBy, Valid: true} } type IssueRepositoryRow struct { @@ -280,11 +280,11 @@ func (irr *IssueRepositoryRow) FromIssueRepository(ir *entity.IssueRepository) { irr.Priority = sql.NullInt64{Int64: ir.Priority, Valid: true} irr.ServiceId = sql.NullInt64{Int64: ir.ServiceId, Valid: true} irr.IssueRepositoryId = sql.NullInt64{Int64: ir.IssueRepositoryId, Valid: true} - irr.BaseIssueRepositoryRow.CreatedAt = sql.NullTime{Time: ir.CreatedAt, Valid: true} - irr.BaseIssueRepositoryRow.CreatedBy = sql.NullInt64{Int64: ir.CreatedBy, Valid: false} - irr.BaseIssueRepositoryRow.DeletedAt = sql.NullTime{Time: ir.DeletedAt, Valid: true} - irr.BaseIssueRepositoryRow.UpdatedAt = sql.NullTime{Time: ir.UpdatedAt, Valid: true} - irr.BaseIssueRepositoryRow.UpdatedBy = sql.NullInt64{Int64: ir.UpdatedBy, Valid: false} + irr.BaseIssueRepositoryRow.CreatedAt = sql.NullTime{Time: ir.BaseIssueRepository.CreatedAt, Valid: true} + irr.BaseIssueRepositoryRow.CreatedBy = sql.NullInt64{Int64: ir.BaseIssueRepository.CreatedBy, Valid: true} + irr.BaseIssueRepositoryRow.DeletedAt = sql.NullTime{Time: ir.BaseIssueRepository.DeletedAt, Valid: true} + irr.BaseIssueRepositoryRow.UpdatedAt = sql.NullTime{Time: ir.BaseIssueRepository.UpdatedAt, Valid: true} + irr.BaseIssueRepositoryRow.UpdatedBy = sql.NullInt64{Int64: ir.BaseIssueRepository.UpdatedBy, Valid: true} } func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepository { @@ -390,10 +390,10 @@ func (ivr *IssueVariantRow) FromIssueVariant(iv *entity.IssueVariant) { ivr.Rating = sql.NullString{String: iv.Severity.Value, Valid: true} ivr.Description = sql.NullString{String: iv.Description, Valid: true} ivr.CreatedAt = sql.NullTime{Time: iv.CreatedAt, Valid: true} - ivr.CreatedBy = sql.NullInt64{Int64: iv.CreatedBy, Valid: false} + ivr.CreatedBy = sql.NullInt64{Int64: iv.CreatedBy, Valid: true} ivr.DeletedAt = sql.NullTime{Time: iv.DeletedAt, Valid: true} ivr.UpdatedAt = sql.NullTime{Time: iv.UpdatedAt, Valid: true} - ivr.UpdatedBy = sql.NullInt64{Int64: iv.UpdatedBy, Valid: false} + ivr.UpdatedBy = sql.NullInt64{Int64: iv.UpdatedBy, Valid: true} } type IssueVariantWithRepository struct { @@ -451,10 +451,10 @@ func (cr *ComponentRow) FromComponent(c *entity.Component) { cr.Name = sql.NullString{String: c.Name, Valid: true} cr.Type = sql.NullString{String: c.Type, Valid: true} cr.CreatedAt = sql.NullTime{Time: c.CreatedAt, Valid: true} - cr.CreatedBy = sql.NullInt64{Int64: c.CreatedBy, Valid: false} + cr.CreatedBy = sql.NullInt64{Int64: c.CreatedBy, Valid: true} cr.DeletedAt = sql.NullTime{Time: c.DeletedAt, Valid: true} cr.UpdatedAt = sql.NullTime{Time: c.UpdatedAt, Valid: true} - cr.UpdatedBy = sql.NullInt64{Int64: c.UpdatedBy, Valid: false} + cr.UpdatedBy = sql.NullInt64{Int64: c.UpdatedBy, Valid: true} } type ComponentVersionRow struct { @@ -488,10 +488,10 @@ func (cvr *ComponentVersionRow) FromComponentVersion(cv *entity.ComponentVersion cvr.Version = sql.NullString{String: cv.Version, Valid: true} cvr.ComponentId = sql.NullInt64{Int64: cv.ComponentId, Valid: true} cvr.CreatedAt = sql.NullTime{Time: cv.CreatedAt, Valid: true} - cvr.CreatedBy = sql.NullInt64{Int64: cv.CreatedBy, Valid: false} + cvr.CreatedBy = sql.NullInt64{Int64: cv.CreatedBy, Valid: true} cvr.DeletedAt = sql.NullTime{Time: cv.DeletedAt, Valid: true} cvr.UpdatedAt = sql.NullTime{Time: cv.UpdatedAt, Valid: true} - cvr.UpdatedBy = sql.NullInt64{Int64: cv.UpdatedBy, Valid: false} + cvr.UpdatedBy = sql.NullInt64{Int64: cv.UpdatedBy, Valid: true} } type SupportGroupRow struct { @@ -522,10 +522,10 @@ func (sgr *SupportGroupRow) FromSupportGroup(sg *entity.SupportGroup) { sgr.Id = sql.NullInt64{Int64: sg.Id, Valid: true} sgr.Name = sql.NullString{String: sg.Name, Valid: true} sgr.CreatedAt = sql.NullTime{Time: sg.CreatedAt, Valid: true} - sgr.CreatedBy = sql.NullInt64{Int64: sg.CreatedBy, Valid: false} + sgr.CreatedBy = sql.NullInt64{Int64: sg.CreatedBy, Valid: true} sgr.DeletedAt = sql.NullTime{Time: sg.DeletedAt, Valid: true} sgr.UpdatedAt = sql.NullTime{Time: sg.UpdatedAt, Valid: true} - sgr.UpdatedBy = sql.NullInt64{Int64: sg.UpdatedBy, Valid: false} + sgr.UpdatedBy = sql.NullInt64{Int64: sg.UpdatedBy, Valid: true} } type ServiceRow struct { @@ -592,10 +592,10 @@ func (sr *ServiceRow) FromService(s *entity.Service) { sr.Id = sql.NullInt64{Int64: s.Id, Valid: true} sr.Name = sql.NullString{String: s.Name, Valid: true} sr.BaseServiceRow.CreatedAt = sql.NullTime{Time: s.BaseService.CreatedAt, Valid: true} - sr.BaseServiceRow.CreatedBy = sql.NullInt64{Int64: s.BaseService.CreatedBy, Valid: false} + sr.BaseServiceRow.CreatedBy = sql.NullInt64{Int64: s.BaseService.CreatedBy, Valid: true} sr.BaseServiceRow.DeletedAt = sql.NullTime{Time: s.BaseService.DeletedAt, Valid: true} sr.BaseServiceRow.UpdatedAt = sql.NullTime{Time: s.BaseService.UpdatedAt, Valid: true} - sr.BaseServiceRow.UpdatedBy = sql.NullInt64{Int64: s.BaseService.UpdatedBy, Valid: false} + sr.BaseServiceRow.UpdatedBy = sql.NullInt64{Int64: s.BaseService.UpdatedBy, Valid: true} } type ActivityRow struct { @@ -628,10 +628,10 @@ func (ar *ActivityRow) FromActivity(a *entity.Activity) { ar.Id = sql.NullInt64{Int64: a.Id, Valid: true} ar.Status = sql.NullString{String: a.Status.String(), Valid: true} ar.CreatedAt = sql.NullTime{Time: a.CreatedAt, Valid: true} - ar.CreatedBy = sql.NullInt64{Int64: a.CreatedBy, Valid: false} + ar.CreatedBy = sql.NullInt64{Int64: a.CreatedBy, Valid: true} ar.DeletedAt = sql.NullTime{Time: a.DeletedAt, Valid: true} ar.UpdatedAt = sql.NullTime{Time: a.UpdatedAt, Valid: true} - ar.UpdatedBy = sql.NullInt64{Int64: a.UpdatedBy, Valid: false} + ar.UpdatedBy = sql.NullInt64{Int64: a.UpdatedBy, Valid: true} } type ComponentInstanceRow struct { @@ -673,10 +673,10 @@ func (cir *ComponentInstanceRow) FromComponentInstance(ci *entity.ComponentInsta cir.ComponentVersionId = sql.NullInt64{Int64: ci.ComponentVersionId, Valid: true} cir.ServiceId = sql.NullInt64{Int64: ci.ServiceId, Valid: true} cir.CreatedAt = sql.NullTime{Time: ci.CreatedAt, Valid: true} - cir.CreatedBy = sql.NullInt64{Int64: ci.CreatedBy, Valid: false} + cir.CreatedBy = sql.NullInt64{Int64: ci.CreatedBy, Valid: true} cir.DeletedAt = sql.NullTime{Time: ci.DeletedAt, Valid: true} cir.UpdatedAt = sql.NullTime{Time: ci.UpdatedAt, Valid: true} - cir.UpdatedBy = sql.NullInt64{Int64: ci.UpdatedBy, Valid: false} + cir.UpdatedBy = sql.NullInt64{Int64: ci.UpdatedBy, Valid: true} } type UserRow struct { @@ -713,10 +713,10 @@ func (ur *UserRow) FromUser(u *entity.User) { ur.UniqueUserID = sql.NullString{String: u.UniqueUserID, Valid: true} ur.Type = sql.NullInt64{Int64: int64(u.Type), Valid: true} ur.CreatedAt = sql.NullTime{Time: u.CreatedAt, Valid: true} - ur.CreatedBy = sql.NullInt64{Int64: u.CreatedBy, Valid: false} + ur.CreatedBy = sql.NullInt64{Int64: u.CreatedBy, Valid: true} ur.DeletedAt = sql.NullTime{Time: u.DeletedAt, Valid: true} ur.UpdatedAt = sql.NullTime{Time: u.UpdatedAt, Valid: true} - ur.UpdatedBy = sql.NullInt64{Int64: u.UpdatedBy, Valid: false} + ur.UpdatedBy = sql.NullInt64{Int64: u.UpdatedBy, Valid: true} } type EvidenceRow struct { @@ -768,10 +768,10 @@ func (er *EvidenceRow) FromEvidence(e *entity.Evidence) { er.UserId = sql.NullInt64{Int64: e.UserId, Valid: true} er.ActivityId = sql.NullInt64{Int64: e.ActivityId, Valid: true} er.CreatedAt = sql.NullTime{Time: e.CreatedAt, Valid: true} - er.CreatedBy = sql.NullInt64{Int64: e.CreatedBy, Valid: false} + er.CreatedBy = sql.NullInt64{Int64: e.CreatedBy, Valid: true} er.DeletedAt = sql.NullTime{Time: e.DeletedAt, Valid: true} er.UpdatedAt = sql.NullTime{Time: e.UpdatedAt, Valid: true} - er.UpdatedBy = sql.NullInt64{Int64: e.UpdatedBy, Valid: false} + er.UpdatedBy = sql.NullInt64{Int64: e.UpdatedBy, Valid: true} } type IssueMatchChangeRow struct { @@ -808,10 +808,10 @@ func (imcr *IssueMatchChangeRow) FromIssueMatchChange(imc *entity.IssueMatchChan imcr.ActivityId = sql.NullInt64{Int64: imc.ActivityId, Valid: true} imcr.Action = sql.NullString{String: imc.Action, Valid: true} imcr.CreatedAt = sql.NullTime{Time: imc.CreatedAt, Valid: true} - imcr.CreatedBy = sql.NullInt64{Int64: imc.CreatedBy, Valid: false} + imcr.CreatedBy = sql.NullInt64{Int64: imc.CreatedBy, Valid: true} imcr.DeletedAt = sql.NullTime{Time: imc.DeletedAt, Valid: true} imcr.UpdatedAt = sql.NullTime{Time: imc.UpdatedAt, Valid: true} - imcr.UpdatedBy = sql.NullInt64{Int64: imc.UpdatedBy, Valid: false} + imcr.UpdatedBy = sql.NullInt64{Int64: imc.UpdatedBy, Valid: true} } type OwnerRow struct { diff --git a/internal/database/mariadb/init/schema.sql b/internal/database/mariadb/init/schema.sql index de7e676f..da7259b3 100644 --- a/internal/database/mariadb/init/schema.sql +++ b/internal/database/mariadb/init/schema.sql @@ -439,9 +439,6 @@ create table if not exists IssueRepositoryService issuerepositoryservice_service_id int unsigned not null, issuerepositoryservice_issue_repository_id int unsigned not null, issuerepositoryservice_priority int unsigned not null, - issuerepositoryservice_created_at timestamp default current_timestamp() not null, - issuerepositoryservice_deleted_at timestamp null, - issuerepositoryservice_updated_at timestamp default current_timestamp() not null on update current_timestamp(), primary key (issuerepositoryservice_service_id, issuerepositoryservice_issue_repository_id), constraint fk_issue_repository_service foreign key (issuerepositoryservice_issue_repository_id) references IssueRepository (issuerepository_id) diff --git a/internal/database/mariadb/issue_repository.go b/internal/database/mariadb/issue_repository.go index ee466909..34ee34b1 100644 --- a/internal/database/mariadb/issue_repository.go +++ b/internal/database/mariadb/issue_repository.go @@ -46,7 +46,7 @@ func (s *SqlDatabase) getIssueRepositoryUpdateFields(issueRepository *entity.Iss if issueRepository.Url != "" { fl = append(fl, "issuerepository_url = :issuerepository_url") } - if issueRepository.UpdatedBy != 0 { + if issueRepository.BaseIssueRepository.UpdatedBy != 0 { fl = append(fl, "issuerepository_updated_by = :issuerepository_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/service.go b/internal/database/mariadb/service.go index 7c45a222..458d970a 100644 --- a/internal/database/mariadb/service.go +++ b/internal/database/mariadb/service.go @@ -115,7 +115,7 @@ func (s *SqlDatabase) getServiceUpdateFields(service *entity.Service) string { if service.Name != "" { fl = append(fl, "service_name = :service_name") } - if service.UpdatedBy != 0 { + if service.BaseService.UpdatedBy != 0 { fl = append(fl, "service_updated_by = :service_updated_by") } return strings.Join(fl, ", ") diff --git a/internal/database/mariadb/service_test.go b/internal/database/mariadb/service_test.go index 3dee040b..d4a8df2e 100644 --- a/internal/database/mariadb/service_test.go +++ b/internal/database/mariadb/service_test.go @@ -716,7 +716,9 @@ var _ = Describe("Service", Label("database", "Service"), func() { seedCollection = seeder.SeedDbWithNFakeData(10) newIssueRepositoryRow = test.NewFakeIssueRepository() newIssueRepository = newIssueRepositoryRow.AsIssueRepository() - issueRepository, _ = db.CreateIssueRepository(&newIssueRepository) + var err error + issueRepository, err = db.CreateIssueRepository(&newIssueRepository) + Expect(err).To(BeNil()) }) It("can add issue repository correctly", func() { service := seedCollection.ServiceRows[0].AsService() diff --git a/internal/database/mariadb/test/fixture.go b/internal/database/mariadb/test/fixture.go index fd80a613..85724d82 100644 --- a/internal/database/mariadb/test/fixture.go +++ b/internal/database/mariadb/test/fixture.go @@ -418,8 +418,10 @@ func (s *DatabaseSeeder) SeedIssueRepositories() []mariadb.BaseIssueRepositoryRo i := 0 for _, name := range variants { row := mariadb.BaseIssueRepositoryRow{ - Name: sql.NullString{String: name, Valid: true}, - Url: sql.NullString{String: gofakeit.URL(), Valid: true}, + Name: sql.NullString{String: name, Valid: true}, + Url: sql.NullString{String: gofakeit.URL(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } id, err := s.InsertFakeBaseIssueRepository(row) if err != nil { @@ -1124,6 +1126,8 @@ func NewFakeIssueMatch() mariadb.IssueMatchRow { Rating: sql.NullString{String: rating, Valid: true}, RemediationDate: sql.NullTime{Time: gofakeit.Date(), Valid: true}, TargetRemediationDate: sql.NullTime{Time: gofakeit.Date(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1133,6 +1137,7 @@ func NewFakeIssue() mariadb.IssueRow { Description: sql.NullString{String: gofakeit.HackerPhrase(), Valid: true}, Type: sql.NullString{String: gofakeit.RandomString(entity.AllIssueTypes), Valid: true}, CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1154,21 +1159,27 @@ func NewFakeIssueVariant(repos []mariadb.BaseIssueRepositoryRow, disc []mariadb. Int64: disc[rand.Intn(len(disc))].Id.Int64, Valid: true, }, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } func NewFakeIssueRepository() mariadb.IssueRepositoryRow { return mariadb.IssueRepositoryRow{ BaseIssueRepositoryRow: mariadb.BaseIssueRepositoryRow{ - Name: sql.NullString{String: gofakeit.AppName(), Valid: true}, - Url: sql.NullString{String: gofakeit.URL(), Valid: true}, + Name: sql.NullString{String: gofakeit.AppName(), Valid: true}, + Url: sql.NullString{String: gofakeit.URL(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, }, } } func NewFakeBaseService() mariadb.BaseServiceRow { return mariadb.BaseServiceRow{ - Name: sql.NullString{String: gofakeit.AppName(), Valid: true}, + Name: sql.NullString{String: gofakeit.AppName(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1183,7 +1194,9 @@ func NewFakeService() mariadb.ServiceRow { func NewFakeSupportGroup() mariadb.SupportGroupRow { return mariadb.SupportGroupRow{ - Name: sql.NullString{String: gofakeit.AppName(), Valid: true}, + Name: sql.NullString{String: gofakeit.AppName(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1191,14 +1204,18 @@ func NewFakeComponent() mariadb.ComponentRow { types := []string{"containerImage", "virtualMachineImage", "repository"} name := fmt.Sprintf("%s-%d", gofakeit.AppName(), gofakeit.Number(0, 99999)) return mariadb.ComponentRow{ - Name: sql.NullString{String: name, Valid: true}, - Type: sql.NullString{String: gofakeit.RandomString(types), Valid: true}, + Name: sql.NullString{String: name, Valid: true}, + Type: sql.NullString{String: gofakeit.RandomString(types), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } func NewFakeComponentVersion() mariadb.ComponentVersionRow { return mariadb.ComponentVersionRow{ - Version: sql.NullString{String: gofakeit.AppVersion(), Valid: true}, + Version: sql.NullString{String: gofakeit.AppVersion(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1208,8 +1225,10 @@ func NewFakeComponentInstance() mariadb.ComponentInstanceRow { n = n * -1 } return mariadb.ComponentInstanceRow{ - CCRN: sql.NullString{String: gofakeit.UUID(), Valid: true}, - Count: sql.NullInt16{Int16: n, Valid: true}, + CCRN: sql.NullString{String: gofakeit.UUID(), Valid: true}, + Count: sql.NullInt16{Int16: n, Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1232,6 +1251,7 @@ func NewFakeUser() mariadb.UserRow { UniqueUserID: sql.NullString{String: uniqueUserId, Valid: true}, Type: sql.NullInt64{Int64: getNextUserType(), Valid: true}, CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1250,7 +1270,9 @@ func NewFakeSupportGroupUser() mariadb.SupportGroupUserRow { func NewFakeActivity() mariadb.ActivityRow { status := []string{"open", "closed", "in_progress"} return mariadb.ActivityRow{ - Status: sql.NullString{String: gofakeit.RandomString(status), Valid: true}, + Status: sql.NullString{String: gofakeit.RandomString(status), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1277,9 +1299,11 @@ func NewFakeEvidence() mariadb.EvidenceRow { String: gofakeit.RandomString(types), Valid: true, }, - Vector: sql.NullString{String: v, Valid: true}, - Rating: sql.NullString{String: rating, Valid: true}, - RAAEnd: sql.NullTime{Time: gofakeit.Date(), Valid: true}, + Vector: sql.NullString{String: v, Valid: true}, + Rating: sql.NullString{String: rating, Valid: true}, + RAAEnd: sql.NullTime{Time: gofakeit.Date(), Valid: true}, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } @@ -1297,6 +1321,8 @@ func NewFakeIssueMatchChange() mariadb.IssueMatchChangeRow { String: gofakeit.RandomString(entity.AllIssueMatchChangeActions), Valid: true, }, + CreatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, + UpdatedBy: sql.NullInt64{Int64: e2e_common.SystemUserId, Valid: true}, } } diff --git a/internal/e2e/issue_query_test.go b/internal/e2e/issue_query_test.go index aa6f24c6..c905542f 100644 --- a/internal/e2e/issue_query_test.go +++ b/internal/e2e/issue_query_test.go @@ -14,7 +14,6 @@ import ( "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" "github.com/cloudoperators/heureka/internal/database/mariadb" "github.com/cloudoperators/heureka/internal/database/mariadb/test" - "github.com/cloudoperators/heureka/internal/e2e/common" "github.com/cloudoperators/heureka/internal/entity" testentity "github.com/cloudoperators/heureka/internal/entity/test" "github.com/cloudoperators/heureka/internal/server" @@ -251,7 +250,6 @@ var _ = Describe("Creating Issue via API", Label("e2e", "Issues"), func() { "primaryName": issue.PrimaryName, "description": issue.Description, "type": issue.Type.String(), - "metadata": map[string]string{"created_by": fmt.Sprintf("%d", e2e_common.SystemUserId)}, }) req.Header.Set("Cache-Control", "no-cache") diff --git a/internal/entity/issue_repository.go b/internal/entity/issue_repository.go index 3d259e3e..cef0b830 100644 --- a/internal/entity/issue_repository.go +++ b/internal/entity/issue_repository.go @@ -39,7 +39,6 @@ type IssueRepositoryAggregations struct { } type IssueRepository struct { - Metadata BaseIssueRepository IssueRepositoryService } diff --git a/internal/entity/service.go b/internal/entity/service.go index 5735bfa3..865d6804 100644 --- a/internal/entity/service.go +++ b/internal/entity/service.go @@ -34,7 +34,6 @@ type ServiceFilter struct { } type Service struct { - Metadata BaseService IssueRepositoryService } From f4ab5345abae3c88787bacc3bb864583aa3e523e Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 23 Oct 2024 13:57:59 +0200 Subject: [PATCH 16/17] Trying to get issue in e2e --- .../queryCollection/issue/listIssues.graphql | 29 +++++ internal/e2e/common/issue.go | 104 ++++++++++++++++++ internal/e2e/common/user.go | 16 +-- internal/e2e/metadata_test.go | 98 +++++++++-------- internal/e2e/user_query_test.go | 4 +- 5 files changed, 195 insertions(+), 56 deletions(-) create mode 100644 internal/api/graphql/graph/queryCollection/issue/listIssues.graphql create mode 100644 internal/e2e/common/issue.go diff --git a/internal/api/graphql/graph/queryCollection/issue/listIssues.graphql b/internal/api/graphql/graph/queryCollection/issue/listIssues.graphql new file mode 100644 index 00000000..734dd459 --- /dev/null +++ b/internal/api/graphql/graph/queryCollection/issue/listIssues.graphql @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +# SPDX-License-Identifier: Apache-2.0 + +query ($filter: IssueFilter, $first: Int, $after: String) { + Issues ( + filter: $filter, + first: $first, + after: $after + ) { + totalCount + edges { + node { + id + type + primaryName + description + lastModified + metadata { + created_at + created_by + deleted_at + updated_at + updated_by + } + } + cursor + } + } +} diff --git a/internal/e2e/common/issue.go b/internal/e2e/common/issue.go new file mode 100644 index 00000000..d5f7ff9f --- /dev/null +++ b/internal/e2e/common/issue.go @@ -0,0 +1,104 @@ +// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors +// SPDX-License-Identifier: Apache-2.0 + +package e2e_common + +import ( + "context" + "fmt" + "os" + + "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" + util2 "github.com/cloudoperators/heureka/pkg/util" + + "github.com/machinebox/graphql" + . "github.com/onsi/gomega" + "github.com/sirupsen/logrus" +) + +type Issue struct { + PrimaryName string + Description string + Type string +} + +func QueryCreateIssue(port string, issue Issue) *model.Issue { + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/issue/create.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("input", map[string]interface{}{ + "primaryName": issue.PrimaryName, + "description": issue.Description, + "type": issue.Type, + }) + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + Issue model.Issue `json:"createIssue"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + return &respData.Issue +} + +func QueryUpdateIssue(port string, issue Issue, iid string) *model.Issue { + // create a queryCollection (safe to share across requests) + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/issue/update.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("id", iid) + req.Var("input", map[string]string{ + "description": issue.Description, + "type": issue.Type, + }) + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + Issue model.Issue `json:"updateIssue"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + return &respData.Issue +} + +func QueryGetIssue(port string, issuePrimaryName string) *model.IssueConnection { + // create a queryCollection (safe to share across requests) + client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) + + //@todo may need to make this more fault proof?! What if the test is executed from the root dir? does it still work? + b, err := os.ReadFile("../api/graphql/graph/queryCollection/issue/listIssues.graphql") + Expect(err).To(BeNil()) + str := string(b) + req := graphql.NewRequest(str) + + req.Var("filter", map[string]string{"primaryName": issuePrimaryName}) + req.Var("first", 1) + req.Var("after", "0") + + req.Header.Set("Cache-Control", "no-cache") + ctx := context.Background() + + var respData struct { + Issues model.IssueConnection `json:"Issues"` + } + if err := util2.RequestWithBackoff(func() error { return client.Run(ctx, req, &respData) }); err != nil { + logrus.WithError(err).WithField("request", req).Fatalln("Error while unmarshaling") + } + return &respData.Issues +} diff --git a/internal/e2e/common/user.go b/internal/e2e/common/user.go index ec0602cf..c5b8db6d 100644 --- a/internal/e2e/common/user.go +++ b/internal/e2e/common/user.go @@ -81,9 +81,9 @@ func ExpectNonSystemUserUniqueUserIds(v, expectedV []*string) { } type User struct { - Id string - Type entity.UserType - Name string + UniqueUserID string + Type entity.UserType + Name string } func QueryCreateUser(port string, user User) *model.User { @@ -96,7 +96,7 @@ func QueryCreateUser(port string, user User) *model.User { req := graphql.NewRequest(str) req.Var("input", map[string]string{ - "uniqueUserId": user.Id, + "uniqueUserId": user.UniqueUserID, "type": entity.GetUserTypeString(user.Type), "name": user.Name, }) @@ -113,7 +113,7 @@ func QueryCreateUser(port string, user User) *model.User { return &respData.User } -func QueryUpdateUser(port string, user User) *model.User { +func QueryUpdateUser(port string, user User, uid string) *model.User { // create a queryCollection (safe to share across requests) client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) @@ -123,7 +123,7 @@ func QueryUpdateUser(port string, user User) *model.User { str := string(b) req := graphql.NewRequest(str) - req.Var("id", user.Id) + req.Var("id", uid) req.Var("input", map[string]string{ "name": user.Name, "type": entity.GetUserTypeString(user.Type), @@ -141,7 +141,7 @@ func QueryUpdateUser(port string, user User) *model.User { return &respData.User } -func QueryGetUser(port string, userId string) *model.UserConnection { +func QueryGetUser(port string, uniqueUserId string) *model.UserConnection { // create a queryCollection (safe to share across requests) client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", port)) @@ -151,7 +151,7 @@ func QueryGetUser(port string, userId string) *model.UserConnection { str := string(b) req := graphql.NewRequest(str) - req.Var("filter", map[string]string{"uniqueUserId": userId}) + req.Var("filter", map[string]string{"uniqueUserId": uniqueUserId}) req.Var("first", 1) req.Var("after", "0") diff --git a/internal/e2e/metadata_test.go b/internal/e2e/metadata_test.go index 2cc124c2..ebd4ec4f 100644 --- a/internal/e2e/metadata_test.go +++ b/internal/e2e/metadata_test.go @@ -3,8 +3,8 @@ package e2e_test -/* import ( + "fmt" "time" "github.com/cloudoperators/heureka/internal/api/graphql/graph/model" @@ -19,34 +19,37 @@ import ( ) const ( - testUniqueUserId = "1" - testUserType = entity.HumanUserType - testUpdatedUserType = entity.TechnicalUserType - testUserName = "Joe" - testUpdatedUserName = "Donald" - testCreatedBy = "Creator" - testUpdatedBy = "Updater" - dbDateLayout = "2006-01-02 15:04:05 -0700 MST" + testIssuePrimaryName = "PN-001" + testCreatedIssueDescription = "Created Issue" + testUpdatedIssueDescription = "Updated Issue" + dbDateLayout = "2006-01-02 15:04:05 -0700 MST" ) -func createTestUser(port string) { - user := e2e_common.QueryCreateUser(port, e2e_common.User{Id: testUniqueUserId, Type: testUserType, Name: testUserName}) - Expect(*user.Name).To(Equal(testUserName)) - Expect(*user.UniqueUserID).To(Equal(testUniqueUserId)) - Expect(entity.UserType(user.Type)).To(Equal(testUserType)) -} +var ( + testCreatedIssueType = entity.IssueTypeVulnerability.String() + testUpdatedIssueType = entity.IssueTypePolicyViolation.String() +) -func updateTestUser(port string) { - user := e2e_common.QueryUpdateUser(port, e2e_common.User{Id: testUniqueUserId, Type: testUpdatedUserType, Name: testUpdatedUserName}) - Expect(*user.Name).To(Equal(testUpdatedUserName)) - Expect(*user.UniqueUserID).To(Equal(testUniqueUserId)) - Expect(entity.UserType(user.Type)).To(Equal(testUpdatedUserType)) +func createTestIssue(port string) string { + issue := e2e_common.QueryCreateIssue(port, e2e_common.Issue{PrimaryName: testIssuePrimaryName, Description: testCreatedIssueDescription, Type: testCreatedIssueType}) + Expect(*issue.PrimaryName).To(Equal(testIssuePrimaryName)) + Expect(*issue.Description).To(Equal(testCreatedIssueDescription)) + Expect(issue.Type.String()).To(Equal(testCreatedIssueType)) + fmt.Println("AAAAAAAAAAAAAAAAAA ", *issue) + return issue.ID +} +func updateTestIssue(port string, iid string) { + issue := e2e_common.QueryUpdateIssue(port, e2e_common.Issue{PrimaryName: testIssuePrimaryName, Description: testUpdatedIssueDescription, Type: testUpdatedIssueType}, iid) + Expect(*issue.PrimaryName).To(Equal(testIssuePrimaryName)) + Expect(*issue.Description).To(Equal(testUpdatedIssueDescription)) + Expect(issue.Type.String()).To(Equal(testUpdatedIssueType)) } -func getTestUser(port string) model.User { - users := e2e_common.QueryGetUser(port, testUniqueUserId) - Expect(users.TotalCount).To(Equal(1)) - return *users.Edges[0].Node +func getTestIssue(port string) model.Issue { + issues := e2e_common.QueryGetIssue(port, testIssuePrimaryName) + Expect(issues.TotalCount).To(Equal(1)) + fmt.Println("AAAAAAAAAAAAAAAAAA ", *issues.Edges[0].Node) + return *issues.Edges[0].Node } var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities"), func() { @@ -67,48 +70,52 @@ var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities" s.BlockingStop() }) - When("New user is created via API", func() { - var user model.User + When("New issue is created via API", func() { + var issue model.Issue BeforeEach(func() { - createTestUser(cfg.Port) - user = getTestUser(cfg.Port) + createTestIssue(cfg.Port) + issue = getTestIssue(cfg.Port) }) It("shall assign CreatedBy and CreatedAt metadata fields and shall keep nil in UpdatedBy, UpdatedAt and DeltedAt metadata fields", func() { - Expect(entity.UserType(user.Type)).To(Equal(testUserType)) - Expect(user.Metadata).To(Not(BeNil())) - Expect(*user.Metadata.CreatedBy).To(Equal(testCreatedBy)) + Expect(*issue.Description).To(Equal(testCreatedIssueDescription)) + Expect(issue.Type.String()).To(Equal(testCreatedIssueType)) - createdAt, err := time.Parse(dbDateLayout, *user.Metadata.CreatedAt) + Expect(issue.Metadata).To(Not(BeNil())) + Expect(*issue.Metadata.CreatedBy).To(Equal(e2e_common.SystemUserId)) + + createdAt, err := time.Parse(dbDateLayout, *issue.Metadata.CreatedAt) Expect(err).Should(BeNil()) Expect(createdAt).Should(BeTemporally("~", time.Now().UTC(), 3*time.Second)) - Expect(*user.Metadata.UpdatedBy).To(BeEmpty()) + Expect(*issue.Metadata.UpdatedBy).To(BeEmpty()) - updatedAt, err := time.Parse(dbDateLayout, *user.Metadata.UpdatedAt) + updatedAt, err := time.Parse(dbDateLayout, *issue.Metadata.UpdatedAt) Expect(err).Should(BeNil()) Expect(updatedAt).To(Equal(createdAt)) }) }) - When("User is updated via API", func() { - var user model.User + When("Issue is updated via API", func() { + var issue model.Issue BeforeEach(func() { - createTestUser(cfg.Port) + iid := createTestIssue(cfg.Port) time.Sleep(1100 * time.Millisecond) - updateTestUser(cfg.Port) - user = getTestUser(cfg.Port) + updateTestIssue(cfg.Port, iid) + issue = getTestIssue(cfg.Port) }) It("shall assign UpdatedBy and UpdatedAt metadata fields and shall keep nil in DeletedAt metadata field", func() { - Expect(entity.UserType(user.Type)).To(Equal(testUpdatedUserType)) - Expect(user.Metadata).To(Not(BeNil())) - Expect(*user.Metadata.CreatedBy).To(Equal(testCreatedBy)) + Expect(*issue.Description).To(Equal(testUpdatedIssueDescription)) + Expect(issue.Type.String()).To(Equal(testUpdatedIssueType)) + + Expect(issue.Metadata).To(Not(BeNil())) + Expect(*issue.Metadata.CreatedBy).To(Equal(e2e_common.SystemUserId)) - createdAt, err := time.Parse(dbDateLayout, *user.Metadata.CreatedAt) + createdAt, err := time.Parse(dbDateLayout, *issue.Metadata.CreatedAt) Expect(err).Should(BeNil()) Expect(createdAt).Should(BeTemporally("~", time.Now().UTC(), 3*time.Second)) - Expect(*user.Metadata.UpdatedBy).To(Equal(testUpdatedBy)) + Expect(*issue.Metadata.UpdatedBy).To(Equal(e2e_common.SystemUserId)) - updatedAt, err := time.Parse(dbDateLayout, *user.Metadata.UpdatedAt) + updatedAt, err := time.Parse(dbDateLayout, *issue.Metadata.UpdatedAt) Expect(err).Should(BeNil()) Expect(updatedAt).Should(BeTemporally("~", time.Now().UTC(), 2*time.Second)) Expect(updatedAt).Should(BeTemporally(">", createdAt)) @@ -116,4 +123,3 @@ var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities" }) }) -*/ diff --git a/internal/e2e/user_query_test.go b/internal/e2e/user_query_test.go index e1c9faec..e5535569 100644 --- a/internal/e2e/user_query_test.go +++ b/internal/e2e/user_query_test.go @@ -229,7 +229,7 @@ var _ = Describe("Creating User via API", Label("e2e", "Users"), func() { Context("and a mutation query is performed", Label("create.graphql"), func() { It("creates new user", func() { - respUser := e2e_common.QueryCreateUser(cfg.Port, e2e_common.User{Id: user.UniqueUserID, Type: user.Type, Name: user.Name}) + respUser := e2e_common.QueryCreateUser(cfg.Port, e2e_common.User{UniqueUserID: user.UniqueUserID, Type: user.Type, Name: user.Name}) Expect(*respUser.Name).To(Equal(user.Name)) Expect(*respUser.UniqueUserID).To(Equal(user.UniqueUserID)) Expect(entity.UserType(respUser.Type)).To(Equal(user.Type)) @@ -272,7 +272,7 @@ var _ = Describe("Updating User via API", Label("e2e", "Users"), func() { It("updates user", func() { user := seedCollection.UserRows[0].AsUser() user.Name = "Sauron" - respUser := e2e_common.QueryUpdateUser(cfg.Port, e2e_common.User{Id: fmt.Sprintf("%d", user.Id), Name: user.Name, Type: user.Type}) + respUser := e2e_common.QueryUpdateUser(cfg.Port, e2e_common.User{UniqueUserID: user.UniqueUserID, Name: user.Name, Type: user.Type}, fmt.Sprintf("%d", user.Id)) Expect(*respUser.Name).To(Equal(user.Name)) Expect(*respUser.UniqueUserID).To(Equal(user.UniqueUserID)) Expect(entity.UserType(respUser.Type)).To(Equal(user.Type)) From f4ce3e7062925185ba5c22b1e5353e188f44c8db Mon Sep 17 00:00:00 2001 From: Michal Krzyz Date: Wed, 23 Oct 2024 15:01:36 +0200 Subject: [PATCH 17/17] Final --- internal/api/graphql/graph/baseResolver/common.go | 2 +- internal/api/graphql/graph/model/models.go | 1 + .../graph/queryCollection/issue/listIssues.graphql | 3 +-- internal/database/mariadb/test/database_manager.go | 1 + internal/e2e/common/issue.go | 2 +- internal/e2e/common/user.go | 1 + internal/e2e/metadata_test.go | 14 ++++++-------- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/api/graphql/graph/baseResolver/common.go b/internal/api/graphql/graph/baseResolver/common.go index dddee8c9..ffb93495 100644 --- a/internal/api/graphql/graph/baseResolver/common.go +++ b/internal/api/graphql/graph/baseResolver/common.go @@ -98,6 +98,6 @@ func GetListOptions(requestedFields []string) *entity.ListOptions { return &entity.ListOptions{ ShowTotalCount: lo.Contains(requestedFields, "totalCount"), ShowPageInfo: lo.Contains(requestedFields, "pageInfo"), - IncludeAggregations: lo.Contains(requestedFields, "edges.node.metadata"), + IncludeAggregations: lo.Contains(requestedFields, "edges.node.issueMetadata"), } } diff --git a/internal/api/graphql/graph/model/models.go b/internal/api/graphql/graph/model/models.go index 617bbc6c..54691b59 100644 --- a/internal/api/graphql/graph/model/models.go +++ b/internal/api/graphql/graph/model/models.go @@ -177,6 +177,7 @@ func NewIssueWithAggregations(issue *entity.IssueResult) Issue { ID: fmt.Sprintf("%d", issue.Issue.Id), PrimaryName: &issue.Issue.PrimaryName, Type: &issueType, + Description: &issue.Issue.Description, LastModified: &lastModified, IssueMetadata: &issueMetadata, Metadata: getModelMetadata(issue.Issue.Metadata), diff --git a/internal/api/graphql/graph/queryCollection/issue/listIssues.graphql b/internal/api/graphql/graph/queryCollection/issue/listIssues.graphql index 734dd459..9ace4ac1 100644 --- a/internal/api/graphql/graph/queryCollection/issue/listIssues.graphql +++ b/internal/api/graphql/graph/queryCollection/issue/listIssues.graphql @@ -11,10 +11,9 @@ query ($filter: IssueFilter, $first: Int, $after: String) { edges { node { id - type primaryName + type description - lastModified metadata { created_at created_by diff --git a/internal/database/mariadb/test/database_manager.go b/internal/database/mariadb/test/database_manager.go index 830eab4f..585dcbad 100644 --- a/internal/database/mariadb/test/database_manager.go +++ b/internal/database/mariadb/test/database_manager.go @@ -149,6 +149,7 @@ func (dbm *LocalTestDataBaseManager) NewTestSchema() *mariadb.SqlDatabase { dbm.Schemas = append(dbm.Schemas, schemaName) dbm.CurrentSchema = schemaName dbm.Config.DBName = schemaName + dbm.Config.AuthType = "none" //TODO: move config stuff to e2e/common err := dbm.dbClient.SetupSchema(dbm.Config.Config) if err != nil { diff --git a/internal/e2e/common/issue.go b/internal/e2e/common/issue.go index d5f7ff9f..8fc26276 100644 --- a/internal/e2e/common/issue.go +++ b/internal/e2e/common/issue.go @@ -31,7 +31,7 @@ func QueryCreateIssue(port string, issue Issue) *model.Issue { str := string(b) req := graphql.NewRequest(str) - req.Var("input", map[string]interface{}{ + req.Var("input", map[string]string{ "primaryName": issue.PrimaryName, "description": issue.Description, "type": issue.Type, diff --git a/internal/e2e/common/user.go b/internal/e2e/common/user.go index c5b8db6d..9c697476 100644 --- a/internal/e2e/common/user.go +++ b/internal/e2e/common/user.go @@ -20,6 +20,7 @@ import ( const NumberOfSystemUsers = 1 const SystemUserId = 1 +const EmptyUserId = -1 var SystemUserName = "systemuser" var SystemUserUniqueUserId = "S0000000" diff --git a/internal/e2e/metadata_test.go b/internal/e2e/metadata_test.go index ebd4ec4f..bb0d82a9 100644 --- a/internal/e2e/metadata_test.go +++ b/internal/e2e/metadata_test.go @@ -26,8 +26,8 @@ const ( ) var ( - testCreatedIssueType = entity.IssueTypeVulnerability.String() - testUpdatedIssueType = entity.IssueTypePolicyViolation.String() + testCreatedIssueType = entity.IssueTypeVulnerability.String() + testUpdatedIssueType = entity.IssueTypePolicyViolation.String() ) func createTestIssue(port string) string { @@ -35,7 +35,6 @@ func createTestIssue(port string) string { Expect(*issue.PrimaryName).To(Equal(testIssuePrimaryName)) Expect(*issue.Description).To(Equal(testCreatedIssueDescription)) Expect(issue.Type.String()).To(Equal(testCreatedIssueType)) - fmt.Println("AAAAAAAAAAAAAAAAAA ", *issue) return issue.ID } func updateTestIssue(port string, iid string) { @@ -48,7 +47,6 @@ func updateTestIssue(port string, iid string) { func getTestIssue(port string) model.Issue { issues := e2e_common.QueryGetIssue(port, testIssuePrimaryName) Expect(issues.TotalCount).To(Equal(1)) - fmt.Println("AAAAAAAAAAAAAAAAAA ", *issues.Edges[0].Node) return *issues.Edges[0].Node } @@ -81,13 +79,13 @@ var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities" Expect(issue.Type.String()).To(Equal(testCreatedIssueType)) Expect(issue.Metadata).To(Not(BeNil())) - Expect(*issue.Metadata.CreatedBy).To(Equal(e2e_common.SystemUserId)) + Expect(*issue.Metadata.CreatedBy).To(Equal(fmt.Sprintf("%d", e2e_common.SystemUserId))) createdAt, err := time.Parse(dbDateLayout, *issue.Metadata.CreatedAt) Expect(err).Should(BeNil()) Expect(createdAt).Should(BeTemporally("~", time.Now().UTC(), 3*time.Second)) - Expect(*issue.Metadata.UpdatedBy).To(BeEmpty()) + Expect(*issue.Metadata.UpdatedBy).To(Equal(fmt.Sprintf("%d", e2e_common.EmptyUserId))) updatedAt, err := time.Parse(dbDateLayout, *issue.Metadata.UpdatedAt) Expect(err).Should(BeNil()) @@ -107,13 +105,13 @@ var _ = Describe("Creating and updating entity via API", Label("e2e", "Entities" Expect(issue.Type.String()).To(Equal(testUpdatedIssueType)) Expect(issue.Metadata).To(Not(BeNil())) - Expect(*issue.Metadata.CreatedBy).To(Equal(e2e_common.SystemUserId)) + Expect(*issue.Metadata.CreatedBy).To(Equal(fmt.Sprintf("%d", e2e_common.SystemUserId))) createdAt, err := time.Parse(dbDateLayout, *issue.Metadata.CreatedAt) Expect(err).Should(BeNil()) Expect(createdAt).Should(BeTemporally("~", time.Now().UTC(), 3*time.Second)) - Expect(*issue.Metadata.UpdatedBy).To(Equal(e2e_common.SystemUserId)) + Expect(*issue.Metadata.UpdatedBy).To(Equal(fmt.Sprintf("%d", e2e_common.SystemUserId))) updatedAt, err := time.Parse(dbDateLayout, *issue.Metadata.UpdatedAt) Expect(err).Should(BeNil())