diff --git a/gitlab/report.go b/gitlab/report.go index 9f49313..2fdd337 100644 --- a/gitlab/report.go +++ b/gitlab/report.go @@ -11,6 +11,13 @@ import ( r "github.com/obcode/glabs/v3/gitlab/report" ) +// ReportData returns the structured report for an assignment without rendering it +// to text/HTML. It is the data-returning entry point the web server uses; the +// CLI's Report/ReportHTML render this same data. +func (c *Client) ReportData(assignmentCfg *config.AssignmentConfig) (*r.Reports, error) { + return c.report(assignmentCfg) +} + func (c *Client) Report(assignmentCfg *config.AssignmentConfig, templateFile *string, output *string) error { report, err := c.report(assignmentCfg) if err != nil { diff --git a/web/app/report.go b/web/app/report.go new file mode 100644 index 0000000..19591ee --- /dev/null +++ b/web/app/report.go @@ -0,0 +1,60 @@ +package app + +import ( + "context" + "fmt" + + "github.com/obcode/glabs/v3/gitlab" + "github.com/obcode/glabs/v3/gitlab/report" + "github.com/obcode/glabs/v3/reporter" +) + +// gitlabClientFor builds a GitLab client from the caller's stored PAT. This is the +// single place in the web server where the plaintext token exists: it is +// decrypted here, handed straight to the client, and never logged or returned. A +// discard reporter keeps the client from writing progress to the server's stdout. +func (a *App) gitlabClientFor(ctx context.Context, owner string) (*gitlab.Client, error) { + if a.sealer == nil { + return nil, fmt.Errorf("secret storage is unavailable: set secrets.key in the server config") + } + sec, err := a.db.GetUserSecret(ctx, owner) + if err != nil { + return nil, err + } + if sec == nil || sec.GitLab == nil { + return nil, fmt.Errorf("no GitLab token stored — add one under GitLab-Token first") + } + token, err := a.sealer.Open(*sec.GitLab) + if err != nil { + return nil, err + } + return gitlab.NewClient( + gitlab.WithHost(a.gitlabHost), + gitlab.WithToken(token), + gitlab.WithReporter(reporter.NewDiscardReporter()), + ) +} + +// AssignmentReport fetches a live report over the repositories of one assignment +// of one of the caller's courses, using the caller's stored GitLab token. It +// returns nil (no error) when there is no such assignment or it cannot be +// resolved (e.g. an abstract base); it errors when no token is stored or GitLab +// is unreachable. +func (a *App) AssignmentReport(ctx context.Context, course, name string) (*report.Reports, error) { + o, err := owner(ctx) + if err != nil { + return nil, err + } + cfg, err := a.resolveAssignmentConfig(ctx, course, name) + if err != nil { + return nil, err + } + if cfg == nil { + return nil, nil + } + client, err := a.gitlabClientFor(ctx, o) + if err != nil { + return nil, err + } + return client.ReportData(cfg) +} diff --git a/web/app/report_test.go b/web/app/report_test.go new file mode 100644 index 0000000..b47bc39 --- /dev/null +++ b/web/app/report_test.go @@ -0,0 +1,69 @@ +package app + +import ( + "strings" + "testing" +) + +func TestAssignmentReport_noTokenStoredReturnsError(t *testing.T) { + const owner = "prof@hm.edu" + fs := newFakeStore() + fs.courses[owner+"/uc"] = storedCourse(t, owner, urlsCourse) + a := &App{db: fs, gitlabHost: "https://gitlab.example", sealer: testSealer(t)} + + // The assignment resolves, but no GitLab token is stored → a clear error. + _, err := a.AssignmentReport(ctxAs(owner), "uc", "blatt1") + if err == nil { + t.Fatal("expected an error when no token is stored") + } + if !strings.Contains(err.Error(), "no GitLab token") { + t.Errorf("error = %q, want it to mention the missing token", err) + } +} + +func TestAssignmentReport_noSealerReturnsError(t *testing.T) { + const owner = "prof@hm.edu" + fs := newFakeStore() + fs.courses[owner+"/uc"] = storedCourse(t, owner, urlsCourse) + a := &App{db: fs, gitlabHost: "https://gitlab.example", sealer: nil} + + _, err := a.AssignmentReport(ctxAs(owner), "uc", "blatt1") + if err == nil { + t.Fatal("expected an error when secret storage is unavailable") + } + if !strings.Contains(err.Error(), "secret storage is unavailable") { + t.Errorf("error = %q, want it to mention unavailable secret storage", err) + } +} + +func TestAssignmentReport_missingAssignmentReturnsNil(t *testing.T) { + const owner = "prof@hm.edu" + fs := newFakeStore() + fs.courses[owner+"/uc"] = storedCourse(t, owner, urlsCourse) + a := &App{db: fs, gitlabHost: "https://gitlab.example", sealer: testSealer(t)} + + // No such assignment → nil, no error (and no token needed). + rep, err := a.AssignmentReport(ctxAs(owner), "uc", "nope") + if err != nil { + t.Fatalf("AssignmentReport: %v", err) + } + if rep != nil { + t.Errorf("expected nil for a missing assignment, got %+v", rep) + } +} + +func TestAssignmentReport_abstractBaseReturnsNil(t *testing.T) { + const owner = "prof@hm.edu" + fs := newFakeStore() + fs.courses[owner+"/tc"] = storedCourse(t, owner, tcCourse) + a := &App{db: fs, gitlabHost: "https://gl", sealer: testSealer(t)} + + // An abstract base does not resolve → nil, no error (token never consulted). + rep, err := a.AssignmentReport(ctxAs(owner), "tc", "base") + if err != nil { + t.Fatalf("AssignmentReport: %v", err) + } + if rep != nil { + t.Errorf("expected nil for an abstract base, got %+v", rep) + } +} diff --git a/web/app/urls.go b/web/app/urls.go index 83c0b0f..dc658f5 100644 --- a/web/app/urls.go +++ b/web/app/urls.go @@ -24,6 +24,26 @@ type AssignmentURLs struct { // in both cases there simply are no URLs. ErrCourseNotFound propagates when the // course itself is not the caller's. func (a *App) AssignmentURLs(ctx context.Context, course, name string) (*AssignmentURLs, error) { + cfg, err := a.resolveAssignmentConfig(ctx, course, name) + if err != nil { + return nil, err + } + if cfg == nil { + return nil, nil + } + return &AssignmentURLs{ + Per: string(cfg.Per), + GroupURL: cfg.URL, + Repos: cfg.RepoURLs(), + }, nil +} + +// resolveAssignmentConfig resolves one assignment of one of the caller's courses +// to a full AssignmentConfig (URL, roster, everything), from the stored bytes so +// the result matches the CLI exactly. It returns nil (no error) when the course +// has no such assignment or the assignment cannot be resolved (e.g. an abstract +// base). ErrCourseNotFound propagates when the course is not the caller's. +func (a *App) resolveAssignmentConfig(ctx context.Context, course, name string) (*config.AssignmentConfig, error) { stored, err := a.Course(ctx, course) if err != nil { return nil, err @@ -34,9 +54,6 @@ func (a *App) AssignmentURLs(ctx context.Context, course, name string) (*Assignm return nil, nil } - // Resolve from the stored bytes so the URLs match the CLI exactly (the same - // inheritance, roster resolution and path normalization). Fall back to - // re-encoding the source if the raw bytes are absent. bytes := stored.RawYAML if len(bytes) == 0 { if encoded, err := config.EncodeCourse(stored.Source); err == nil { @@ -45,13 +62,8 @@ func (a *App) AssignmentURLs(ctx context.Context, course, name string) (*Assignm } cfg, err := config.ResolveAssignmentFromBytes(bytes, course, name, config.Globals{GitlabHost: a.gitlabHost}) if err != nil { - // Not resolvable (abstract base, missing parent, cycle) → no URLs. + // Not resolvable (abstract base, missing parent, cycle). return nil, nil } - - return &AssignmentURLs{ - Per: string(cfg.Per), - GroupURL: cfg.URL, - Repos: cfg.RepoURLs(), - }, nil + return cfg, nil } diff --git a/web/graph/generated/generated.go b/web/graph/generated/generated.go index 8b70b0a..4e123d7 100644 --- a/web/graph/generated/generated.go +++ b/web/graph/generated/generated.go @@ -37,6 +37,17 @@ type DirectiveRoot struct { } type ComplexityRoot struct { + AssignmentReport struct { + Assignment func(childComplexity int) int + Course func(childComplexity int) int + Description func(childComplexity int) int + Generated func(childComplexity int) int + HasReleaseDockerImages func(childComplexity int) int + HasReleaseMergeRequest func(childComplexity int) int + Projects func(childComplexity int) int + URL func(childComplexity int) int + } + AssignmentUrls struct { GroupURL func(childComplexity int) int Per func(childComplexity int) int @@ -53,6 +64,13 @@ type ComplexityRoot struct { Resolved func(childComplexity int) int } + CommitReport struct { + CommittedDate func(childComplexity int) int + CommitterName func(childComplexity int) int + Title func(childComplexity int) int + WebURL func(childComplexity int) int + } + Course struct { AssignmentNames func(childComplexity int) int CoursePath func(childComplexity int) int @@ -68,6 +86,16 @@ type ComplexityRoot struct { UseEmailDomainAsSuffix func(childComplexity int) int } + DockerImageReport struct { + Image func(childComplexity int) int + Wanted func(childComplexity int) int + } + + DockerImagesReport struct { + Images func(childComplexity int) int + Status func(childComplexity int) int + } + FieldMeta struct { Deprecated func(childComplexity int) int Description func(childComplexity int) int @@ -120,10 +148,32 @@ type ComplexityRoot struct { SetGitlabToken func(childComplexity int, token string) int } + ProjectMemberReport struct { + Name func(childComplexity int) int + Username func(childComplexity int) int + WebURL func(childComplexity int) int + } + + ProjectReport struct { + Active func(childComplexity int) int + Commits func(childComplexity int) int + CreatedAt func(childComplexity int) int + EmptyRepo func(childComplexity int) int + LastActivity func(childComplexity int) int + LastCommit func(childComplexity int) int + Members func(childComplexity int) int + Name func(childComplexity int) int + OpenIssuesCount func(childComplexity int) int + OpenMergeRequestsCount func(childComplexity int) int + Release func(childComplexity int) int + WebURL func(childComplexity int) int + } + Query struct { ApprovalRuleSchema func(childComplexity int) int ApprovalSettingsSchema func(childComplexity int) int Assignment func(childComplexity int, course string, name string) int + AssignmentReport func(childComplexity int, course string, name string) int AssignmentSchema func(childComplexity int) int AssignmentUrls func(childComplexity int, course string, name string) int BranchRuleSchema func(childComplexity int) int @@ -137,6 +187,17 @@ type ComplexityRoot struct { ValidateAssignmentDraft func(childComplexity int, course string, name string, draft []*model.FieldValueInput) int } + ReleaseMergeRequestReport struct { + Found func(childComplexity int) int + PipelineStatus func(childComplexity int) int + WebURL func(childComplexity int) int + } + + ReleaseReport struct { + DockerImages func(childComplexity int) int + MergeRequest func(childComplexity int) int + } + RepoUrl struct { For func(childComplexity int) int URL func(childComplexity int) int @@ -192,6 +253,7 @@ type QueryResolver interface { CourseYaml(ctx context.Context, name string) (string, error) CourseLint(ctx context.Context, name string) ([]*model.Finding, error) GitlabToken(ctx context.Context) (*model.GitLabTokenStatus, error) + AssignmentReport(ctx context.Context, course string, name string) (*model.AssignmentReport, error) } // endregion ************************** generated!.gotpl ************************** @@ -212,6 +274,55 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin _ = ec switch typeName + "." + field { + case "AssignmentReport.assignment": + if e.ComplexityRoot.AssignmentReport.Assignment == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.Assignment(childComplexity), true + case "AssignmentReport.course": + if e.ComplexityRoot.AssignmentReport.Course == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.Course(childComplexity), true + case "AssignmentReport.description": + if e.ComplexityRoot.AssignmentReport.Description == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.Description(childComplexity), true + case "AssignmentReport.generated": + if e.ComplexityRoot.AssignmentReport.Generated == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.Generated(childComplexity), true + case "AssignmentReport.hasReleaseDockerImages": + if e.ComplexityRoot.AssignmentReport.HasReleaseDockerImages == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.HasReleaseDockerImages(childComplexity), true + case "AssignmentReport.hasReleaseMergeRequest": + if e.ComplexityRoot.AssignmentReport.HasReleaseMergeRequest == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.HasReleaseMergeRequest(childComplexity), true + case "AssignmentReport.projects": + if e.ComplexityRoot.AssignmentReport.Projects == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.Projects(childComplexity), true + case "AssignmentReport.url": + if e.ComplexityRoot.AssignmentReport.URL == nil { + break + } + + return e.ComplexityRoot.AssignmentReport.URL(childComplexity), true + case "AssignmentUrls.groupUrl": if e.ComplexityRoot.AssignmentUrls.GroupURL == nil { break @@ -274,6 +385,31 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.ComplexityRoot.AssignmentView.Resolved(childComplexity), true + case "CommitReport.committedDate": + if e.ComplexityRoot.CommitReport.CommittedDate == nil { + break + } + + return e.ComplexityRoot.CommitReport.CommittedDate(childComplexity), true + case "CommitReport.committerName": + if e.ComplexityRoot.CommitReport.CommitterName == nil { + break + } + + return e.ComplexityRoot.CommitReport.CommitterName(childComplexity), true + case "CommitReport.title": + if e.ComplexityRoot.CommitReport.Title == nil { + break + } + + return e.ComplexityRoot.CommitReport.Title(childComplexity), true + case "CommitReport.webUrl": + if e.ComplexityRoot.CommitReport.WebURL == nil { + break + } + + return e.ComplexityRoot.CommitReport.WebURL(childComplexity), true + case "Course.assignmentNames": if e.ComplexityRoot.Course.AssignmentNames == nil { break @@ -347,6 +483,32 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.ComplexityRoot.Course.UseEmailDomainAsSuffix(childComplexity), true + case "DockerImageReport.image": + if e.ComplexityRoot.DockerImageReport.Image == nil { + break + } + + return e.ComplexityRoot.DockerImageReport.Image(childComplexity), true + case "DockerImageReport.wanted": + if e.ComplexityRoot.DockerImageReport.Wanted == nil { + break + } + + return e.ComplexityRoot.DockerImageReport.Wanted(childComplexity), true + + case "DockerImagesReport.images": + if e.ComplexityRoot.DockerImagesReport.Images == nil { + break + } + + return e.ComplexityRoot.DockerImagesReport.Images(childComplexity), true + case "DockerImagesReport.status": + if e.ComplexityRoot.DockerImagesReport.Status == nil { + break + } + + return e.ComplexityRoot.DockerImagesReport.Status(childComplexity), true + case "FieldMeta.deprecated": if e.ComplexityRoot.FieldMeta.Deprecated == nil { break @@ -585,6 +747,98 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.ComplexityRoot.Mutation.SetGitlabToken(childComplexity, args["token"].(string)), true + case "ProjectMemberReport.name": + if e.ComplexityRoot.ProjectMemberReport.Name == nil { + break + } + + return e.ComplexityRoot.ProjectMemberReport.Name(childComplexity), true + case "ProjectMemberReport.username": + if e.ComplexityRoot.ProjectMemberReport.Username == nil { + break + } + + return e.ComplexityRoot.ProjectMemberReport.Username(childComplexity), true + case "ProjectMemberReport.webUrl": + if e.ComplexityRoot.ProjectMemberReport.WebURL == nil { + break + } + + return e.ComplexityRoot.ProjectMemberReport.WebURL(childComplexity), true + + case "ProjectReport.active": + if e.ComplexityRoot.ProjectReport.Active == nil { + break + } + + return e.ComplexityRoot.ProjectReport.Active(childComplexity), true + case "ProjectReport.commits": + if e.ComplexityRoot.ProjectReport.Commits == nil { + break + } + + return e.ComplexityRoot.ProjectReport.Commits(childComplexity), true + case "ProjectReport.createdAt": + if e.ComplexityRoot.ProjectReport.CreatedAt == nil { + break + } + + return e.ComplexityRoot.ProjectReport.CreatedAt(childComplexity), true + case "ProjectReport.emptyRepo": + if e.ComplexityRoot.ProjectReport.EmptyRepo == nil { + break + } + + return e.ComplexityRoot.ProjectReport.EmptyRepo(childComplexity), true + case "ProjectReport.lastActivity": + if e.ComplexityRoot.ProjectReport.LastActivity == nil { + break + } + + return e.ComplexityRoot.ProjectReport.LastActivity(childComplexity), true + case "ProjectReport.lastCommit": + if e.ComplexityRoot.ProjectReport.LastCommit == nil { + break + } + + return e.ComplexityRoot.ProjectReport.LastCommit(childComplexity), true + case "ProjectReport.members": + if e.ComplexityRoot.ProjectReport.Members == nil { + break + } + + return e.ComplexityRoot.ProjectReport.Members(childComplexity), true + case "ProjectReport.name": + if e.ComplexityRoot.ProjectReport.Name == nil { + break + } + + return e.ComplexityRoot.ProjectReport.Name(childComplexity), true + case "ProjectReport.openIssuesCount": + if e.ComplexityRoot.ProjectReport.OpenIssuesCount == nil { + break + } + + return e.ComplexityRoot.ProjectReport.OpenIssuesCount(childComplexity), true + case "ProjectReport.openMergeRequestsCount": + if e.ComplexityRoot.ProjectReport.OpenMergeRequestsCount == nil { + break + } + + return e.ComplexityRoot.ProjectReport.OpenMergeRequestsCount(childComplexity), true + case "ProjectReport.release": + if e.ComplexityRoot.ProjectReport.Release == nil { + break + } + + return e.ComplexityRoot.ProjectReport.Release(childComplexity), true + case "ProjectReport.webUrl": + if e.ComplexityRoot.ProjectReport.WebURL == nil { + break + } + + return e.ComplexityRoot.ProjectReport.WebURL(childComplexity), true + case "Query.approvalRuleSchema": if e.ComplexityRoot.Query.ApprovalRuleSchema == nil { break @@ -608,6 +862,17 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.ComplexityRoot.Query.Assignment(childComplexity, args["course"].(string), args["name"].(string)), true + case "Query.assignmentReport": + if e.ComplexityRoot.Query.AssignmentReport == nil { + break + } + + args, err := ec.field_Query_assignmentReport_args(ctx, rawArgs) + if err != nil { + return 0, false + } + + return e.ComplexityRoot.Query.AssignmentReport(childComplexity, args["course"].(string), args["name"].(string)), true case "Query.assignmentSchema": if e.ComplexityRoot.Query.AssignmentSchema == nil { break @@ -701,6 +966,38 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.ComplexityRoot.Query.ValidateAssignmentDraft(childComplexity, args["course"].(string), args["name"].(string), args["draft"].([]*model.FieldValueInput)), true + case "ReleaseMergeRequestReport.found": + if e.ComplexityRoot.ReleaseMergeRequestReport.Found == nil { + break + } + + return e.ComplexityRoot.ReleaseMergeRequestReport.Found(childComplexity), true + case "ReleaseMergeRequestReport.pipelineStatus": + if e.ComplexityRoot.ReleaseMergeRequestReport.PipelineStatus == nil { + break + } + + return e.ComplexityRoot.ReleaseMergeRequestReport.PipelineStatus(childComplexity), true + case "ReleaseMergeRequestReport.webUrl": + if e.ComplexityRoot.ReleaseMergeRequestReport.WebURL == nil { + break + } + + return e.ComplexityRoot.ReleaseMergeRequestReport.WebURL(childComplexity), true + + case "ReleaseReport.dockerImages": + if e.ComplexityRoot.ReleaseReport.DockerImages == nil { + break + } + + return e.ComplexityRoot.ReleaseReport.DockerImages(childComplexity), true + case "ReleaseReport.mergeRequest": + if e.ComplexityRoot.ReleaseReport.MergeRequest == nil { + break + } + + return e.ComplexityRoot.ReleaseReport.MergeRequest(childComplexity), true + case "RepoUrl.for": if e.ComplexityRoot.RepoUrl.For == nil { break @@ -1111,6 +1408,91 @@ extend type Mutation { "Remove the current user's stored GitLab token." removeGitlabToken: GitLabTokenStatus! } +`, BuiltIn: false}, + {Name: "../report.graphqls", Input: `""" +A live report over the repositories of one assignment — one row per project +(repo) with activity, last commit, open issues/merge requests, members and an +optional release status. Fetched from GitLab using the caller's stored token. +""" +type AssignmentReport { + course: String! + assignment: String! + "The assignment-level group URL." + url: String! + description: String! + "When the report was generated." + generated: Time + "Whether the assignment configures a release merge request (adds that column)." + hasReleaseMergeRequest: Boolean! + "Whether the assignment configures release docker images (adds that column)." + hasReleaseDockerImages: Boolean! + "One entry per repository in the assignment's group, sorted by name." + projects: [ProjectReport!]! +} + +"The report for one repository." +type ProjectReport { + name: String! + "Whether there was any activity beyond creation (or any commits)." + active: Boolean! + emptyRepo: Boolean! + commits: Int! + createdAt: Time + lastActivity: Time + lastCommit: CommitReport + openIssuesCount: Int! + openMergeRequestsCount: Int! + webUrl: String! + members: [ProjectMemberReport!]! + release: ReleaseReport +} + +"The most recent commit across a repository's branches." +type CommitReport { + title: String! + committerName: String! + committedDate: Time + webUrl: String! +} + +"A member of a repository (only the display fields, never GitLab-internal ids)." +type ProjectMemberReport { + name: String! + username: String! + webUrl: String! +} + +"The release status of a repository, when the assignment configures a release." +type ReleaseReport { + mergeRequest: ReleaseMergeRequestReport + dockerImages: DockerImagesReport +} + +type ReleaseMergeRequestReport { + found: Boolean! + webUrl: String! + pipelineStatus: String! +} + +type DockerImagesReport { + status: String! + images: [DockerImageReport!]! +} + +type DockerImageReport { + wanted: String! + image: String +} + +extend type Query { + """ + A live report over the repositories of one assignment, fetched from GitLab with + the caller's stored token. Null when there is no such assignment or it cannot be + resolved (e.g. an abstract base). Errors when no token is stored or GitLab is + unreachable. + """ + assignmentReport(course: String!, name: String!): AssignmentReport +} `, BuiltIn: false}, {Name: "../schema.graphqls", Input: `""" An authenticated user of glabs-web. Identity comes from the auth proxy; there @@ -1142,6 +1524,28 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // Each function is generated once per unique object type, deduplicating the // switch statements that were previously inlined in every fieldContext_* function. +func (ec *executionContext) childFields_AssignmentReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "course": + return ec.fieldContext_AssignmentReport_course(ctx, field) + case "assignment": + return ec.fieldContext_AssignmentReport_assignment(ctx, field) + case "url": + return ec.fieldContext_AssignmentReport_url(ctx, field) + case "description": + return ec.fieldContext_AssignmentReport_description(ctx, field) + case "generated": + return ec.fieldContext_AssignmentReport_generated(ctx, field) + case "hasReleaseMergeRequest": + return ec.fieldContext_AssignmentReport_hasReleaseMergeRequest(ctx, field) + case "hasReleaseDockerImages": + return ec.fieldContext_AssignmentReport_hasReleaseDockerImages(ctx, field) + case "projects": + return ec.fieldContext_AssignmentReport_projects(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AssignmentReport", field.Name) +} + func (ec *executionContext) childFields_AssignmentUrls(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "per": @@ -1174,6 +1578,20 @@ func (ec *executionContext) childFields_AssignmentView(ctx context.Context, fiel return nil, fmt.Errorf("no field named %q was found under type AssignmentView", field.Name) } +func (ec *executionContext) childFields_CommitReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "title": + return ec.fieldContext_CommitReport_title(ctx, field) + case "committerName": + return ec.fieldContext_CommitReport_committerName(ctx, field) + case "committedDate": + return ec.fieldContext_CommitReport_committedDate(ctx, field) + case "webUrl": + return ec.fieldContext_CommitReport_webUrl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type CommitReport", field.Name) +} + func (ec *executionContext) childFields_Course(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "name": @@ -1204,6 +1622,26 @@ func (ec *executionContext) childFields_Course(ctx context.Context, field graphq return nil, fmt.Errorf("no field named %q was found under type Course", field.Name) } +func (ec *executionContext) childFields_DockerImageReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "wanted": + return ec.fieldContext_DockerImageReport_wanted(ctx, field) + case "image": + return ec.fieldContext_DockerImageReport_image(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DockerImageReport", field.Name) +} + +func (ec *executionContext) childFields_DockerImagesReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "status": + return ec.fieldContext_DockerImagesReport_status(ctx, field) + case "images": + return ec.fieldContext_DockerImagesReport_images(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DockerImagesReport", field.Name) +} + func (ec *executionContext) childFields_FieldMeta(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "key": @@ -1282,6 +1720,70 @@ func (ec *executionContext) childFields_Group(ctx context.Context, field graphql return nil, fmt.Errorf("no field named %q was found under type Group", field.Name) } +func (ec *executionContext) childFields_ProjectMemberReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_ProjectMemberReport_name(ctx, field) + case "username": + return ec.fieldContext_ProjectMemberReport_username(ctx, field) + case "webUrl": + return ec.fieldContext_ProjectMemberReport_webUrl(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectMemberReport", field.Name) +} + +func (ec *executionContext) childFields_ProjectReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext_ProjectReport_name(ctx, field) + case "active": + return ec.fieldContext_ProjectReport_active(ctx, field) + case "emptyRepo": + return ec.fieldContext_ProjectReport_emptyRepo(ctx, field) + case "commits": + return ec.fieldContext_ProjectReport_commits(ctx, field) + case "createdAt": + return ec.fieldContext_ProjectReport_createdAt(ctx, field) + case "lastActivity": + return ec.fieldContext_ProjectReport_lastActivity(ctx, field) + case "lastCommit": + return ec.fieldContext_ProjectReport_lastCommit(ctx, field) + case "openIssuesCount": + return ec.fieldContext_ProjectReport_openIssuesCount(ctx, field) + case "openMergeRequestsCount": + return ec.fieldContext_ProjectReport_openMergeRequestsCount(ctx, field) + case "webUrl": + return ec.fieldContext_ProjectReport_webUrl(ctx, field) + case "members": + return ec.fieldContext_ProjectReport_members(ctx, field) + case "release": + return ec.fieldContext_ProjectReport_release(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ProjectReport", field.Name) +} + +func (ec *executionContext) childFields_ReleaseMergeRequestReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "found": + return ec.fieldContext_ReleaseMergeRequestReport_found(ctx, field) + case "webUrl": + return ec.fieldContext_ReleaseMergeRequestReport_webUrl(ctx, field) + case "pipelineStatus": + return ec.fieldContext_ReleaseMergeRequestReport_pipelineStatus(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ReleaseMergeRequestReport", field.Name) +} + +func (ec *executionContext) childFields_ReleaseReport(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "mergeRequest": + return ec.fieldContext_ReleaseReport_mergeRequest(ctx, field) + case "dockerImages": + return ec.fieldContext_ReleaseReport_dockerImages(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ReleaseReport", field.Name) +} + func (ec *executionContext) childFields_RepoUrl(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "for": @@ -1688,6 +2190,28 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs return args, nil } +func (ec *executionContext) field_Query_assignmentReport_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "course", + func(ctx context.Context, v any) (string, error) { + return ec.unmarshalNString2string(ctx, v) + }) + if err != nil { + return nil, err + } + args["course"] = arg0 + arg1, err := graphql.ProcessArgField(ctx, rawArgs, "name", + func(ctx context.Context, v any) (string, error) { + return ec.unmarshalNString2string(ctx, v) + }) + if err != nil { + return nil, err + } + args["name"] = arg1 + return args, nil +} + func (ec *executionContext) field_Query_assignmentUrls_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -1864,16 +2388,16 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg // region **************************** field.gotpl ***************************** -func (ec *executionContext) _AssignmentUrls_per(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentUrls) (ret graphql.Marshaler) { +func (ec *executionContext) _AssignmentReport_course(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_AssignmentUrls_per(ctx, field) + return ec.fieldContext_AssignmentReport_course(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.Per, nil + return obj.Course, nil }, nil, func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { @@ -1883,20 +2407,20 @@ func (ec *executionContext) _AssignmentUrls_per(ctx context.Context, field graph true, ) } -func (ec *executionContext) fieldContext_AssignmentUrls_per(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - return graphql.NewScalarFieldContext("AssignmentUrls", field, false, false, errors.New("field of type String does not have child fields")) +func (ec *executionContext) fieldContext_AssignmentReport_course(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentReport", field, false, false, errors.New("field of type String does not have child fields")) } -func (ec *executionContext) _AssignmentUrls_groupUrl(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentUrls) (ret graphql.Marshaler) { +func (ec *executionContext) _AssignmentReport_assignment(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_AssignmentUrls_groupUrl(ctx, field) + return ec.fieldContext_AssignmentReport_assignment(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.GroupURL, nil + return obj.Assignment, nil }, nil, func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { @@ -1906,52 +2430,43 @@ func (ec *executionContext) _AssignmentUrls_groupUrl(ctx context.Context, field true, ) } -func (ec *executionContext) fieldContext_AssignmentUrls_groupUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - return graphql.NewScalarFieldContext("AssignmentUrls", field, false, false, errors.New("field of type String does not have child fields")) +func (ec *executionContext) fieldContext_AssignmentReport_assignment(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentReport", field, false, false, errors.New("field of type String does not have child fields")) } -func (ec *executionContext) _AssignmentUrls_repos(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentUrls) (ret graphql.Marshaler) { +func (ec *executionContext) _AssignmentReport_url(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_AssignmentUrls_repos(ctx, field) + return ec.fieldContext_AssignmentReport_url(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.Repos, nil + return obj.URL, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v []*model.RepoURL) graphql.Marshaler { - return ec.marshalNRepoUrl2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐRepoURLᚄ(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) }, true, true, ) } -func (ec *executionContext) fieldContext_AssignmentUrls_repos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AssignmentUrls", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_RepoUrl(ctx, field) - }, - } - return fc, nil +func (ec *executionContext) fieldContext_AssignmentReport_url(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentReport", field, false, false, errors.New("field of type String does not have child fields")) } -func (ec *executionContext) _AssignmentView_course(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentView) (ret graphql.Marshaler) { +func (ec *executionContext) _AssignmentReport_description(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_AssignmentView_course(ctx, field) + return ec.fieldContext_AssignmentReport_description(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.Course, nil + return obj.Description, nil }, nil, func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { @@ -1961,8 +2476,210 @@ func (ec *executionContext) _AssignmentView_course(ctx context.Context, field gr true, ) } -func (ec *executionContext) fieldContext_AssignmentView_course(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - return graphql.NewScalarFieldContext("AssignmentView", field, false, false, errors.New("field of type String does not have child fields")) +func (ec *executionContext) fieldContext_AssignmentReport_description(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _AssignmentReport_generated(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentReport_generated(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Generated, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *time.Time) graphql.Marshaler { + return ec.marshalOTime2ᚖtimeᚐTime(ctx, selections, v) + }, + true, + false, + ) +} +func (ec *executionContext) fieldContext_AssignmentReport_generated(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentReport", field, false, false, errors.New("field of type Time does not have child fields")) +} + +func (ec *executionContext) _AssignmentReport_hasReleaseMergeRequest(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentReport_hasReleaseMergeRequest(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.HasReleaseMergeRequest, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v bool) graphql.Marshaler { + return ec.marshalNBoolean2bool(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_AssignmentReport_hasReleaseMergeRequest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentReport", field, false, false, errors.New("field of type Boolean does not have child fields")) +} + +func (ec *executionContext) _AssignmentReport_hasReleaseDockerImages(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentReport_hasReleaseDockerImages(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.HasReleaseDockerImages, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v bool) graphql.Marshaler { + return ec.marshalNBoolean2bool(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_AssignmentReport_hasReleaseDockerImages(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentReport", field, false, false, errors.New("field of type Boolean does not have child fields")) +} + +func (ec *executionContext) _AssignmentReport_projects(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentReport_projects(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Projects, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.ProjectReport) graphql.Marshaler { + return ec.marshalNProjectReport2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectReportᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_AssignmentReport_projects(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AssignmentReport", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_ProjectReport(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _AssignmentUrls_per(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentUrls) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentUrls_per(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Per, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_AssignmentUrls_per(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentUrls", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _AssignmentUrls_groupUrl(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentUrls) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentUrls_groupUrl(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.GroupURL, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_AssignmentUrls_groupUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentUrls", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _AssignmentUrls_repos(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentUrls) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentUrls_repos(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Repos, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.RepoURL) graphql.Marshaler { + return ec.marshalNRepoUrl2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐRepoURLᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_AssignmentUrls_repos(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AssignmentUrls", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_RepoUrl(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _AssignmentView_course(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentView) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_AssignmentView_course(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Course, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_AssignmentView_course(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("AssignmentView", field, false, false, errors.New("field of type String does not have child fields")) } func (ec *executionContext) _AssignmentView_name(ctx context.Context, field graphql.CollectedField, obj *model.AssignmentView) (ret graphql.Marshaler) { @@ -2112,6 +2829,98 @@ func (ec *executionContext) fieldContext_AssignmentView_resolveError(_ context.C return graphql.NewScalarFieldContext("AssignmentView", field, false, false, errors.New("field of type String does not have child fields")) } +func (ec *executionContext) _CommitReport_title(ctx context.Context, field graphql.CollectedField, obj *model.CommitReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_CommitReport_title(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Title, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_CommitReport_title(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("CommitReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _CommitReport_committerName(ctx context.Context, field graphql.CollectedField, obj *model.CommitReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_CommitReport_committerName(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.CommitterName, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_CommitReport_committerName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("CommitReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _CommitReport_committedDate(ctx context.Context, field graphql.CollectedField, obj *model.CommitReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_CommitReport_committedDate(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.CommittedDate, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *time.Time) graphql.Marshaler { + return ec.marshalOTime2ᚖtimeᚐTime(ctx, selections, v) + }, + true, + false, + ) +} +func (ec *executionContext) fieldContext_CommitReport_committedDate(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("CommitReport", field, false, false, errors.New("field of type Time does not have child fields")) +} + +func (ec *executionContext) _CommitReport_webUrl(ctx context.Context, field graphql.CollectedField, obj *model.CommitReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_CommitReport_webUrl(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.WebURL, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_CommitReport_webUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("CommitReport", field, false, false, errors.New("field of type String does not have child fields")) +} + func (ec *executionContext) _Course_name(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, @@ -2397,16 +3206,16 @@ func (ec *executionContext) fieldContext_Course_updatedAt(_ context.Context, fie return graphql.NewScalarFieldContext("Course", field, false, false, errors.New("field of type Time does not have child fields")) } -func (ec *executionContext) _FieldMeta_key(ctx context.Context, field graphql.CollectedField, obj *model.FieldMeta) (ret graphql.Marshaler) { +func (ec *executionContext) _DockerImageReport_wanted(ctx context.Context, field graphql.CollectedField, obj *model.DockerImageReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_FieldMeta_key(ctx, field) + return ec.fieldContext_DockerImageReport_wanted(ctx, field) }, func(ctx context.Context) (any, error) { - return obj.Key, nil + return obj.Wanted, nil }, nil, func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { @@ -2416,8 +3225,109 @@ func (ec *executionContext) _FieldMeta_key(ctx context.Context, field graphql.Co true, ) } -func (ec *executionContext) fieldContext_FieldMeta_key(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - return graphql.NewScalarFieldContext("FieldMeta", field, false, false, errors.New("field of type String does not have child fields")) +func (ec *executionContext) fieldContext_DockerImageReport_wanted(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("DockerImageReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _DockerImageReport_image(ctx context.Context, field graphql.CollectedField, obj *model.DockerImageReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_DockerImageReport_image(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Image, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *string) graphql.Marshaler { + return ec.marshalOString2ᚖstring(ctx, selections, v) + }, + true, + false, + ) +} +func (ec *executionContext) fieldContext_DockerImageReport_image(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("DockerImageReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _DockerImagesReport_status(ctx context.Context, field graphql.CollectedField, obj *model.DockerImagesReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_DockerImagesReport_status(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Status, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_DockerImagesReport_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("DockerImagesReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _DockerImagesReport_images(ctx context.Context, field graphql.CollectedField, obj *model.DockerImagesReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_DockerImagesReport_images(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Images, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.DockerImageReport) graphql.Marshaler { + return ec.marshalNDockerImageReport2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐDockerImageReportᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_DockerImagesReport_images(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DockerImagesReport", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_DockerImageReport(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _FieldMeta_key(ctx context.Context, field graphql.CollectedField, obj *model.FieldMeta) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_FieldMeta_key(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Key, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_FieldMeta_key(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("FieldMeta", field, false, false, errors.New("field of type String does not have child fields")) } func (ec *executionContext) _FieldMeta_label(ctx context.Context, field graphql.CollectedField, obj *model.FieldMeta) (ret graphql.Marshaler) { @@ -3317,269 +4227,641 @@ func (ec *executionContext) fieldContext_Mutation_removeGitlabToken(_ context.Co return fc, nil } -func (ec *executionContext) _Query_me(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectMemberReport_name(ctx context.Context, field graphql.CollectedField, obj *model.ProjectMemberReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_me(ctx, field) + return ec.fieldContext_ProjectMemberReport_name(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.Resolvers.Query().Me(ctx) + return obj.Name, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v *model.User) graphql.Marshaler { - return ec.marshalNUser2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐUser(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) }, true, true, ) } -func (ec *executionContext) fieldContext_Query_me(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_User(ctx, field) - }, - } - return fc, nil +func (ec *executionContext) fieldContext_ProjectMemberReport_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectMemberReport", field, false, false, errors.New("field of type String does not have child fields")) } -func (ec *executionContext) _Query_serverInfo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectMemberReport_username(ctx context.Context, field graphql.CollectedField, obj *model.ProjectMemberReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_serverInfo(ctx, field) + return ec.fieldContext_ProjectMemberReport_username(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.Resolvers.Query().ServerInfo(ctx) + return obj.Username, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v *model.ServerInfo) graphql.Marshaler { - return ec.marshalNServerInfo2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐServerInfo(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) }, true, true, ) } -func (ec *executionContext) fieldContext_Query_serverInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_ServerInfo(ctx, field) - }, - } - return fc, nil +func (ec *executionContext) fieldContext_ProjectMemberReport_username(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectMemberReport", field, false, false, errors.New("field of type String does not have child fields")) } -func (ec *executionContext) _Query_assignmentSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectMemberReport_webUrl(ctx context.Context, field graphql.CollectedField, obj *model.ProjectMemberReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_assignmentSchema(ctx, field) + return ec.fieldContext_ProjectMemberReport_webUrl(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.Resolvers.Query().AssignmentSchema(ctx) + return obj.WebURL, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { - return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) }, true, true, ) } -func (ec *executionContext) fieldContext_Query_assignmentSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_FieldMeta(ctx, field) - }, - } - return fc, nil +func (ec *executionContext) fieldContext_ProjectMemberReport_webUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectMemberReport", field, false, false, errors.New("field of type String does not have child fields")) } -func (ec *executionContext) _Query_branchRuleSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectReport_name(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_branchRuleSchema(ctx, field) + return ec.fieldContext_ProjectReport_name(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.Resolvers.Query().BranchRuleSchema(ctx) + return obj.Name, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { - return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) }, true, true, ) } -func (ec *executionContext) fieldContext_Query_branchRuleSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_FieldMeta(ctx, field) - }, - } - return fc, nil +func (ec *executionContext) fieldContext_ProjectReport_name(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type String does not have child fields")) } -func (ec *executionContext) _Query_approvalSettingsSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectReport_active(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_approvalSettingsSchema(ctx, field) + return ec.fieldContext_ProjectReport_active(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.Resolvers.Query().ApprovalSettingsSchema(ctx) + return obj.Active, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { - return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v bool) graphql.Marshaler { + return ec.marshalNBoolean2bool(ctx, selections, v) }, true, true, ) } -func (ec *executionContext) fieldContext_Query_approvalSettingsSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_FieldMeta(ctx, field) - }, - } - return fc, nil +func (ec *executionContext) fieldContext_ProjectReport_active(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type Boolean does not have child fields")) } -func (ec *executionContext) _Query_approvalRuleSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectReport_emptyRepo(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_approvalRuleSchema(ctx, field) + return ec.fieldContext_ProjectReport_emptyRepo(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.Resolvers.Query().ApprovalRuleSchema(ctx) + return obj.EmptyRepo, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { - return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v bool) graphql.Marshaler { + return ec.marshalNBoolean2bool(ctx, selections, v) }, true, true, ) } -func (ec *executionContext) fieldContext_Query_approvalRuleSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_FieldMeta(ctx, field) +func (ec *executionContext) fieldContext_ProjectReport_emptyRepo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type Boolean does not have child fields")) +} + +func (ec *executionContext) _ProjectReport_commits(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ProjectReport_commits(ctx, field) }, - } - return fc, nil + func(ctx context.Context) (any, error) { + return obj.Commits, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v int) graphql.Marshaler { + return ec.marshalNInt2int(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ProjectReport_commits(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type Int does not have child fields")) } -func (ec *executionContext) _Query_assignment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectReport_createdAt(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_assignment(ctx, field) + return ec.fieldContext_ProjectReport_createdAt(ctx, field) }, func(ctx context.Context) (any, error) { - fc := graphql.GetFieldContext(ctx) - return ec.Resolvers.Query().Assignment(ctx, fc.Args["course"].(string), fc.Args["name"].(string)) + return obj.CreatedAt, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v *model.AssignmentView) graphql.Marshaler { - return ec.marshalOAssignmentView2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐAssignmentView(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v *time.Time) graphql.Marshaler { + return ec.marshalOTime2ᚖtimeᚐTime(ctx, selections, v) }, true, false, ) } -func (ec *executionContext) fieldContext_Query_assignment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_AssignmentView(ctx, field) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_assignment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } - return fc, nil +func (ec *executionContext) fieldContext_ProjectReport_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type Time does not have child fields")) } -func (ec *executionContext) _Query_validateAssignmentDraft(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectReport_lastActivity(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_validateAssignmentDraft(ctx, field) + return ec.fieldContext_ProjectReport_lastActivity(ctx, field) }, func(ctx context.Context) (any, error) { - fc := graphql.GetFieldContext(ctx) - return ec.Resolvers.Query().ValidateAssignmentDraft(ctx, fc.Args["course"].(string), fc.Args["name"].(string), fc.Args["draft"].([]*model.FieldValueInput)) + return obj.LastActivity, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v *model.ValidationResult) graphql.Marshaler { - return ec.marshalNValidationResult2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐValidationResult(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v *time.Time) graphql.Marshaler { + return ec.marshalOTime2ᚖtimeᚐTime(ctx, selections, v) }, true, - true, + false, ) } -func (ec *executionContext) fieldContext_Query_validateAssignmentDraft(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { +func (ec *executionContext) fieldContext_ProjectReport_lastActivity(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type Time does not have child fields")) +} + +func (ec *executionContext) _ProjectReport_lastCommit(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ProjectReport_lastCommit(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.LastCommit, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.CommitReport) graphql.Marshaler { + return ec.marshalOCommitReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐCommitReport(ctx, selections, v) + }, + true, + false, + ) +} +func (ec *executionContext) fieldContext_ProjectReport_lastCommit(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectReport", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_CommitReport(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectReport_openIssuesCount(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ProjectReport_openIssuesCount(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.OpenIssuesCount, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v int) graphql.Marshaler { + return ec.marshalNInt2int(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ProjectReport_openIssuesCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type Int does not have child fields")) +} + +func (ec *executionContext) _ProjectReport_openMergeRequestsCount(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ProjectReport_openMergeRequestsCount(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.OpenMergeRequestsCount, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v int) graphql.Marshaler { + return ec.marshalNInt2int(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ProjectReport_openMergeRequestsCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type Int does not have child fields")) +} + +func (ec *executionContext) _ProjectReport_webUrl(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ProjectReport_webUrl(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.WebURL, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ProjectReport_webUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ProjectReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _ProjectReport_members(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ProjectReport_members(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Members, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.ProjectMemberReport) graphql.Marshaler { + return ec.marshalNProjectMemberReport2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectMemberReportᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ProjectReport_members(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectReport", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_ProjectMemberReport(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _ProjectReport_release(ctx context.Context, field graphql.CollectedField, obj *model.ProjectReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ProjectReport_release(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.Release, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.ReleaseReport) graphql.Marshaler { + return ec.marshalOReleaseReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐReleaseReport(ctx, selections, v) + }, + true, + false, + ) +} +func (ec *executionContext) fieldContext_ProjectReport_release(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ProjectReport", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_ReleaseReport(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_me(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_me(ctx, field) + }, + func(ctx context.Context) (any, error) { + return ec.Resolvers.Query().Me(ctx) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.User) graphql.Marshaler { + return ec.marshalNUser2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐUser(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_me(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_User(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_serverInfo(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_serverInfo(ctx, field) + }, + func(ctx context.Context) (any, error) { + return ec.Resolvers.Query().ServerInfo(ctx) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.ServerInfo) graphql.Marshaler { + return ec.marshalNServerInfo2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐServerInfo(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_serverInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_ServerInfo(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_assignmentSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_assignmentSchema(ctx, field) + }, + func(ctx context.Context) (any, error) { + return ec.Resolvers.Query().AssignmentSchema(ctx) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { + return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_assignmentSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_FieldMeta(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_branchRuleSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_branchRuleSchema(ctx, field) + }, + func(ctx context.Context) (any, error) { + return ec.Resolvers.Query().BranchRuleSchema(ctx) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { + return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_branchRuleSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_FieldMeta(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_approvalSettingsSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_approvalSettingsSchema(ctx, field) + }, + func(ctx context.Context) (any, error) { + return ec.Resolvers.Query().ApprovalSettingsSchema(ctx) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { + return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_approvalSettingsSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_FieldMeta(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_approvalRuleSchema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_approvalRuleSchema(ctx, field) + }, + func(ctx context.Context) (any, error) { + return ec.Resolvers.Query().ApprovalRuleSchema(ctx) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.FieldMeta) graphql.Marshaler { + return ec.marshalNFieldMeta2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldMetaᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_approvalRuleSchema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_FieldMeta(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_assignment(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_assignment(ctx, field) + }, + func(ctx context.Context) (any, error) { + fc := graphql.GetFieldContext(ctx) + return ec.Resolvers.Query().Assignment(ctx, fc.Args["course"].(string), fc.Args["name"].(string)) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.AssignmentView) graphql.Marshaler { + return ec.marshalOAssignmentView2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐAssignmentView(ctx, selections, v) + }, + true, + false, + ) +} +func (ec *executionContext) fieldContext_Query_assignment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_AssignmentView(ctx, field) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_assignment_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_validateAssignmentDraft(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_validateAssignmentDraft(ctx, field) + }, + func(ctx context.Context) (any, error) { + fc := graphql.GetFieldContext(ctx) + return ec.Resolvers.Query().ValidateAssignmentDraft(ctx, fc.Args["course"].(string), fc.Args["name"].(string), fc.Args["draft"].([]*model.FieldValueInput)) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.ValidationResult) graphql.Marshaler { + return ec.marshalNValidationResult2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐValidationResult(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_validateAssignmentDraft(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return ec.childFields_ValidationResult(ctx, field) }, } @@ -3717,34 +4999,154 @@ func (ec *executionContext) fieldContext_Query_course(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Query_courseYAML(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Query_courseYAML(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_courseYAML(ctx, field) + }, + func(ctx context.Context) (any, error) { + fc := graphql.GetFieldContext(ctx) + return ec.Resolvers.Query().CourseYaml(ctx, fc.Args["name"].(string)) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_courseYAML(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + 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_Query_courseYAML_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_courseLint(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_courseLint(ctx, field) + }, + func(ctx context.Context) (any, error) { + fc := graphql.GetFieldContext(ctx) + return ec.Resolvers.Query().CourseLint(ctx, fc.Args["name"].(string)) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v []*model.Finding) graphql.Marshaler { + return ec.marshalNFinding2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFindingᚄ(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_courseLint(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_Finding(ctx, field) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_courseLint_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_gitlabToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_Query_gitlabToken(ctx, field) + }, + func(ctx context.Context) (any, error) { + return ec.Resolvers.Query().GitlabToken(ctx) + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.GitLabTokenStatus) graphql.Marshaler { + return ec.marshalNGitLabTokenStatus2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐGitLabTokenStatus(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_Query_gitlabToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.childFields_GitLabTokenStatus(ctx, field) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_assignmentReport(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_courseYAML(ctx, field) + return ec.fieldContext_Query_assignmentReport(ctx, field) }, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.Resolvers.Query().CourseYaml(ctx, fc.Args["name"].(string)) + return ec.Resolvers.Query().AssignmentReport(ctx, fc.Args["course"].(string), fc.Args["name"].(string)) }, nil, - func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { - return ec.marshalNString2string(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v *model.AssignmentReport) graphql.Marshaler { + return ec.marshalOAssignmentReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐAssignmentReport(ctx, selections, v) }, true, - true, + false, ) } -func (ec *executionContext) fieldContext_Query_courseYAML(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_assignmentReport(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return ec.childFields_AssignmentReport(ctx, field) }, } defer func() { @@ -3754,41 +5156,41 @@ func (ec *executionContext) fieldContext_Query_courseYAML(ctx context.Context, f } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_courseYAML_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query_assignmentReport_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_courseLint(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_courseLint(ctx, field) + return ec.fieldContext_Query___type(ctx, field) }, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.Resolvers.Query().CourseLint(ctx, fc.Args["name"].(string)) + return ec.IntrospectType(fc.Args["name"].(string)) }, nil, - func(ctx context.Context, selections ast.SelectionSet, v []*model.Finding) graphql.Marshaler { - return ec.marshalNFinding2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFindingᚄ(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, selections, v) }, true, - true, + false, ) } -func (ec *executionContext) fieldContext_Query_courseLint(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_Finding(ctx, field) + return ec.childFields___Type(ctx, field) }, } defer func() { @@ -3798,116 +5200,173 @@ func (ec *executionContext) fieldContext_Query_courseLint(ctx context.Context, f } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_courseLint_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Query_gitlabToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query_gitlabToken(ctx, field) + return ec.fieldContext_Query___schema(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.Resolvers.Query().GitlabToken(ctx) + return ec.IntrospectSchema() }, nil, - func(ctx context.Context, selections ast.SelectionSet, v *model.GitLabTokenStatus) graphql.Marshaler { - return ec.marshalNGitLabTokenStatus2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐGitLabTokenStatus(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, selections, v) }, true, - true, + false, ) } -func (ec *executionContext) fieldContext_Query_gitlabToken(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, - IsResolver: true, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields_GitLabTokenStatus(ctx, field) + return ec.childFields___Schema(ctx, field) }, } return fc, nil } -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ReleaseMergeRequestReport_found(ctx context.Context, field graphql.CollectedField, obj *model.ReleaseMergeRequestReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query___type(ctx, field) + return ec.fieldContext_ReleaseMergeRequestReport_found(ctx, field) }, func(ctx context.Context) (any, error) { - fc := graphql.GetFieldContext(ctx) - return ec.IntrospectType(fc.Args["name"].(string)) + return obj.Found, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v bool) graphql.Marshaler { + return ec.marshalNBoolean2bool(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ReleaseMergeRequestReport_found(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ReleaseMergeRequestReport", field, false, false, errors.New("field of type Boolean does not have child fields")) +} + +func (ec *executionContext) _ReleaseMergeRequestReport_webUrl(ctx context.Context, field graphql.CollectedField, obj *model.ReleaseMergeRequestReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ReleaseMergeRequestReport_webUrl(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.WebURL, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ReleaseMergeRequestReport_webUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ReleaseMergeRequestReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _ReleaseMergeRequestReport_pipelineStatus(ctx context.Context, field graphql.CollectedField, obj *model.ReleaseMergeRequestReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ReleaseMergeRequestReport_pipelineStatus(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.PipelineStatus, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v string) graphql.Marshaler { + return ec.marshalNString2string(ctx, selections, v) + }, + true, + true, + ) +} +func (ec *executionContext) fieldContext_ReleaseMergeRequestReport_pipelineStatus(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + return graphql.NewScalarFieldContext("ReleaseMergeRequestReport", field, false, false, errors.New("field of type String does not have child fields")) +} + +func (ec *executionContext) _ReleaseReport_mergeRequest(ctx context.Context, field graphql.CollectedField, obj *model.ReleaseReport) (ret graphql.Marshaler) { + return graphql.ResolveField( + ctx, + ec.OperationContext, + field, + func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return ec.fieldContext_ReleaseReport_mergeRequest(ctx, field) + }, + func(ctx context.Context) (any, error) { + return obj.MergeRequest, nil + }, + nil, + func(ctx context.Context, selections ast.SelectionSet, v *model.ReleaseMergeRequestReport) graphql.Marshaler { + return ec.marshalOReleaseMergeRequestReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐReleaseMergeRequestReport(ctx, selections, v) }, true, false, ) } -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ReleaseReport_mergeRequest(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ReleaseReport", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields___Type(ctx, field) + return ec.childFields_ReleaseMergeRequestReport(ctx, field) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _ReleaseReport_dockerImages(ctx context.Context, field graphql.CollectedField, obj *model.ReleaseReport) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.fieldContext_Query___schema(ctx, field) + return ec.fieldContext_ReleaseReport_dockerImages(ctx, field) }, func(ctx context.Context) (any, error) { - return ec.IntrospectSchema() + return obj.DockerImages, nil }, nil, - func(ctx context.Context, selections ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, selections, v) + func(ctx context.Context, selections ast.SelectionSet, v *model.DockerImagesReport) graphql.Marshaler { + return ec.marshalODockerImagesReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐDockerImagesReport(ctx, selections, v) }, true, false, ) } -func (ec *executionContext) fieldContext_Query___schema(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_ReleaseReport_dockerImages(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Query", + Object: "ReleaseReport", Field: field, - IsMethod: true, + IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return ec.childFields___Schema(ctx, field) + return ec.childFields_DockerImagesReport(ctx, field) }, } return fc, nil @@ -5307,6 +6766,79 @@ func (ec *executionContext) unmarshalInputGroupInput(ctx context.Context, obj an // region **************************** object.gotpl **************************** +var assignmentReportImplementors = []string{"AssignmentReport"} + +func (ec *executionContext) _AssignmentReport(ctx context.Context, sel ast.SelectionSet, obj *model.AssignmentReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, assignmentReportImplementors) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AssignmentReport") + case "course": + out.Values[i] = ec._AssignmentReport_course(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "assignment": + out.Values[i] = ec._AssignmentReport_assignment(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "url": + out.Values[i] = ec._AssignmentReport_url(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._AssignmentReport_description(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "generated": + out.Values[i] = ec._AssignmentReport_generated(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } + case "hasReleaseMergeRequest": + out.Values[i] = ec._AssignmentReport_hasReleaseMergeRequest(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "hasReleaseDockerImages": + out.Values[i] = ec._AssignmentReport_hasReleaseDockerImages(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "projects": + out.Values[i] = ec._AssignmentReport_projects(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + var assignmentUrlsImplementors = []string{"AssignmentUrls"} func (ec *executionContext) _AssignmentUrls(ctx context.Context, sel ast.SelectionSet, obj *model.AssignmentUrls) graphql.Marshaler { @@ -5329,11 +6861,79 @@ func (ec *executionContext) _AssignmentUrls(ctx context.Context, sel ast.Selecti if out.Values[i] == graphql.Null { out.Invalids++ } - case "repos": - out.Values[i] = ec._AssignmentUrls_repos(ctx, field, obj) + case "repos": + out.Values[i] = ec._AssignmentUrls_repos(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + +var assignmentViewImplementors = []string{"AssignmentView"} + +func (ec *executionContext) _AssignmentView(ctx context.Context, sel ast.SelectionSet, obj *model.AssignmentView) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, assignmentViewImplementors) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AssignmentView") + case "course": + out.Values[i] = ec._AssignmentView_course(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._AssignmentView_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "extends": + out.Values[i] = ec._AssignmentView_extends(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } + case "abstract": + out.Values[i] = ec._AssignmentView_abstract(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "own": + out.Values[i] = ec._AssignmentView_own(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "resolved": + out.Values[i] = ec._AssignmentView_resolved(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "resolveError": + out.Values[i] = ec._AssignmentView_resolveError(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -5355,10 +6955,10 @@ func (ec *executionContext) _AssignmentUrls(ctx context.Context, sel ast.Selecti return out } -var assignmentViewImplementors = []string{"AssignmentView"} +var commitReportImplementors = []string{"CommitReport"} -func (ec *executionContext) _AssignmentView(ctx context.Context, sel ast.SelectionSet, obj *model.AssignmentView) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, assignmentViewImplementors) +func (ec *executionContext) _CommitReport(ctx context.Context, sel ast.SelectionSet, obj *model.CommitReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, commitReportImplementors) out := graphql.NewFieldSet(fields) deferredFieldSet := graphql.NewFieldSet(nil) @@ -5366,42 +6966,27 @@ func (ec *executionContext) _AssignmentView(ctx context.Context, sel ast.Selecti for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AssignmentView") - case "course": - out.Values[i] = ec._AssignmentView_course(ctx, field, obj) + out.Values[i] = graphql.MarshalString("CommitReport") + case "title": + out.Values[i] = ec._CommitReport_title(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "name": - out.Values[i] = ec._AssignmentView_name(ctx, field, obj) + case "committerName": + out.Values[i] = ec._CommitReport_committerName(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "extends": - out.Values[i] = ec._AssignmentView_extends(ctx, field, obj) + case "committedDate": + out.Values[i] = ec._CommitReport_committedDate(ctx, field, obj) if out.Values[i] == graphql.RequiredNull { out.Invalids++ } - case "abstract": - out.Values[i] = ec._AssignmentView_abstract(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "own": - out.Values[i] = ec._AssignmentView_own(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "resolved": - out.Values[i] = ec._AssignmentView_resolved(ctx, field, obj) + case "webUrl": + out.Values[i] = ec._CommitReport_webUrl(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "resolveError": - out.Values[i] = ec._AssignmentView_resolveError(ctx, field, obj) - if out.Values[i] == graphql.RequiredNull { - out.Invalids++ - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -5516,6 +7101,92 @@ func (ec *executionContext) _Course(ctx context.Context, sel ast.SelectionSet, o return out } +var dockerImageReportImplementors = []string{"DockerImageReport"} + +func (ec *executionContext) _DockerImageReport(ctx context.Context, sel ast.SelectionSet, obj *model.DockerImageReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dockerImageReportImplementors) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DockerImageReport") + case "wanted": + out.Values[i] = ec._DockerImageReport_wanted(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "image": + out.Values[i] = ec._DockerImageReport_image(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + +var dockerImagesReportImplementors = []string{"DockerImagesReport"} + +func (ec *executionContext) _DockerImagesReport(ctx context.Context, sel ast.SelectionSet, obj *model.DockerImagesReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dockerImagesReportImplementors) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DockerImagesReport") + case "status": + out.Values[i] = ec._DockerImagesReport_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "images": + out.Values[i] = ec._DockerImagesReport_images(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + var fieldMetaImplementors = []string{"FieldMeta"} func (ec *executionContext) _FieldMeta(ctx context.Context, sel ast.SelectionSet, obj *model.FieldMeta) graphql.Marshaler { @@ -5787,14 +7458,173 @@ func (ec *executionContext) _Group(ctx context.Context, sel ast.SelectionSet, ob for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Group") + out.Values[i] = graphql.MarshalString("Group") + case "name": + out.Values[i] = ec._Group_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "members": + out.Values[i] = ec._Group_members(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + +var mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mutation") + case "importCourseYAML": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_importCourseYAML(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "createCourse": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createCourse(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "setCourse": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_setCourse(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "setCourseStudents": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_setCourseStudents(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "setCourseGroups": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_setCourseGroups(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteCourse": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteCourse(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "setAssignment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_setAssignment(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "deleteAssignment": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteAssignment(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "setGitlabToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_setGitlabToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "removeGitlabToken": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_removeGitlabToken(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + +var projectMemberReportImplementors = []string{"ProjectMemberReport"} + +func (ec *executionContext) _ProjectMemberReport(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectMemberReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectMemberReportImplementors) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ProjectMemberReport") case "name": - out.Values[i] = ec._Group_name(ctx, field, obj) + out.Values[i] = ec._ProjectMemberReport_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "members": - out.Values[i] = ec._Group_members(ctx, field, obj) + case "username": + out.Values[i] = ec._ProjectMemberReport_username(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "webUrl": + out.Values[i] = ec._ProjectMemberReport_webUrl(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -5819,96 +7649,78 @@ func (ec *executionContext) _Group(ctx context.Context, sel ast.SelectionSet, ob return out } -var mutationImplementors = []string{"Mutation"} +var projectReportImplementors = []string{"ProjectReport"} -func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Mutation", - }) +func (ec *executionContext) _ProjectReport(ctx context.Context, sel ast.SelectionSet, obj *model.ProjectReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, projectReportImplementors) out := graphql.NewFieldSet(fields) deferredFieldSet := graphql.NewFieldSet(nil) deferLabelToView := make(map[string]*graphql.FieldSetView) for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) - switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Mutation") - case "importCourseYAML": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_importCourseYAML(ctx, field) - }) + out.Values[i] = graphql.MarshalString("ProjectReport") + case "name": + out.Values[i] = ec._ProjectReport_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "createCourse": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createCourse(ctx, field) - }) + case "active": + out.Values[i] = ec._ProjectReport_active(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "setCourse": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_setCourse(ctx, field) - }) + case "emptyRepo": + out.Values[i] = ec._ProjectReport_emptyRepo(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "setCourseStudents": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_setCourseStudents(ctx, field) - }) + case "commits": + out.Values[i] = ec._ProjectReport_commits(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "setCourseGroups": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_setCourseGroups(ctx, field) - }) - if out.Values[i] == graphql.Null { + case "createdAt": + out.Values[i] = ec._ProjectReport_createdAt(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { out.Invalids++ } - case "deleteCourse": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_deleteCourse(ctx, field) - }) - if out.Values[i] == graphql.Null { + case "lastActivity": + out.Values[i] = ec._ProjectReport_lastActivity(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { out.Invalids++ } - case "setAssignment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_setAssignment(ctx, field) - }) + case "lastCommit": + out.Values[i] = ec._ProjectReport_lastCommit(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } + case "openIssuesCount": + out.Values[i] = ec._ProjectReport_openIssuesCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "deleteAssignment": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_deleteAssignment(ctx, field) - }) + case "openMergeRequestsCount": + out.Values[i] = ec._ProjectReport_openMergeRequestsCount(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "setGitlabToken": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_setGitlabToken(ctx, field) - }) + case "webUrl": + out.Values[i] = ec._ProjectReport_webUrl(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } - case "removeGitlabToken": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_removeGitlabToken(ctx, field) - }) + case "members": + out.Values[i] = ec._ProjectReport_members(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } + case "release": + out.Values[i] = ec._ProjectReport_release(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6257,6 +8069,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "assignmentReport": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_assignmentReport(ctx, field) + if res == graphql.RequiredNull { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "__type": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { @@ -6293,6 +8127,97 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } +var releaseMergeRequestReportImplementors = []string{"ReleaseMergeRequestReport"} + +func (ec *executionContext) _ReleaseMergeRequestReport(ctx context.Context, sel ast.SelectionSet, obj *model.ReleaseMergeRequestReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, releaseMergeRequestReportImplementors) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ReleaseMergeRequestReport") + case "found": + out.Values[i] = ec._ReleaseMergeRequestReport_found(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "webUrl": + out.Values[i] = ec._ReleaseMergeRequestReport_webUrl(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "pipelineStatus": + out.Values[i] = ec._ReleaseMergeRequestReport_pipelineStatus(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + +var releaseReportImplementors = []string{"ReleaseReport"} + +func (ec *executionContext) _ReleaseReport(ctx context.Context, sel ast.SelectionSet, obj *model.ReleaseReport) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, releaseReportImplementors) + + out := graphql.NewFieldSet(fields) + deferredFieldSet := graphql.NewFieldSet(nil) + deferLabelToView := make(map[string]*graphql.FieldSetView) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ReleaseReport") + case "mergeRequest": + out.Values[i] = ec._ReleaseReport_mergeRequest(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } + case "dockerImages": + out.Values[i] = ec._ReleaseReport_dockerImages(ctx, field, obj) + if out.Values[i] == graphql.RequiredNull { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.Deferred, int32(min(len(deferLabelToView), math.MaxInt32))) + + ec.ProcessDeferredGroup(graphql.DeferredGroup{ + Defers: deferLabelToView, + Path: graphql.GetPath(ctx), + FieldSet: deferredFieldSet, + Context: ctx, + }) + + return out +} + var repoUrlImplementors = []string{"RepoUrl"} func (ec *executionContext) _RepoUrl(ctx context.Context, sel ast.SelectionSet, obj *model.RepoURL) graphql.Marshaler { @@ -6932,6 +8857,32 @@ func (ec *executionContext) marshalNCourse2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3 return ec._Course(ctx, sel, v) } +func (ec *executionContext) marshalNDockerImageReport2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐDockerImageReportᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.DockerImageReport) graphql.Marshaler { + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNDockerImageReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐDockerImageReport(ctx, sel, v[i]) + }) + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDockerImageReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐDockerImageReport(ctx context.Context, sel ast.SelectionSet, v *model.DockerImageReport) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DockerImageReport(ctx, sel, v) +} + func (ec *executionContext) unmarshalNFieldKind2githubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐFieldKind(ctx context.Context, v any) (model.FieldKind, error) { var res model.FieldKind err := res.UnmarshalGQL(v) @@ -7150,6 +9101,58 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti return res } +func (ec *executionContext) marshalNProjectMemberReport2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectMemberReportᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ProjectMemberReport) graphql.Marshaler { + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNProjectMemberReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectMemberReport(ctx, sel, v[i]) + }) + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNProjectMemberReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectMemberReport(ctx context.Context, sel ast.SelectionSet, v *model.ProjectMemberReport) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ProjectMemberReport(ctx, sel, v) +} + +func (ec *executionContext) marshalNProjectReport2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectReportᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.ProjectReport) graphql.Marshaler { + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNProjectReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectReport(ctx, sel, v[i]) + }) + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNProjectReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐProjectReport(ctx context.Context, sel ast.SelectionSet, v *model.ProjectReport) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._ProjectReport(ctx, sel, v) +} + func (ec *executionContext) marshalNRepoUrl2ᚕᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐRepoURLᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.RepoURL) graphql.Marshaler { ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { fc := graphql.GetFieldContext(ctx) @@ -7419,6 +9422,13 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } +func (ec *executionContext) marshalOAssignmentReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐAssignmentReport(ctx context.Context, sel ast.SelectionSet, v *model.AssignmentReport) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._AssignmentReport(ctx, sel, v) +} + func (ec *executionContext) marshalOAssignmentUrls2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐAssignmentUrls(ctx context.Context, sel ast.SelectionSet, v *model.AssignmentUrls) graphql.Marshaler { if v == nil { return graphql.Null @@ -7463,6 +9473,13 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return res } +func (ec *executionContext) marshalOCommitReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐCommitReport(ctx context.Context, sel ast.SelectionSet, v *model.CommitReport) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._CommitReport(ctx, sel, v) +} + func (ec *executionContext) marshalOCourse2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐCourse(ctx context.Context, sel ast.SelectionSet, v *model.Course) graphql.Marshaler { if v == nil { return graphql.Null @@ -7470,6 +9487,27 @@ func (ec *executionContext) marshalOCourse2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3 return ec._Course(ctx, sel, v) } +func (ec *executionContext) marshalODockerImagesReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐDockerImagesReport(ctx context.Context, sel ast.SelectionSet, v *model.DockerImagesReport) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DockerImagesReport(ctx, sel, v) +} + +func (ec *executionContext) marshalOReleaseMergeRequestReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐReleaseMergeRequestReport(ctx context.Context, sel ast.SelectionSet, v *model.ReleaseMergeRequestReport) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ReleaseMergeRequestReport(ctx, sel, v) +} + +func (ec *executionContext) marshalOReleaseReport2ᚖgithubᚗcomᚋobcodeᚋglabsᚋv3ᚋwebᚋgraphᚋmodelᚐReleaseReport(ctx context.Context, sel ast.SelectionSet, v *model.ReleaseReport) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._ReleaseReport(ctx, sel, v) +} + func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v any) (*string, error) { if v == nil { return nil, nil diff --git a/web/graph/model/models_gen.go b/web/graph/model/models_gen.go index c01d9e5..ef38034 100644 --- a/web/graph/model/models_gen.go +++ b/web/graph/model/models_gen.go @@ -10,6 +10,25 @@ import ( "time" ) +// A live report over the repositories of one assignment — one row per project +// (repo) with activity, last commit, open issues/merge requests, members and an +// optional release status. Fetched from GitLab using the caller's stored token. +type AssignmentReport struct { + Course string `json:"course"` + Assignment string `json:"assignment"` + // The assignment-level group URL. + URL string `json:"url"` + Description string `json:"description"` + // When the report was generated. + Generated *time.Time `json:"generated,omitempty"` + // Whether the assignment configures a release merge request (adds that column). + HasReleaseMergeRequest bool `json:"hasReleaseMergeRequest"` + // Whether the assignment configures release docker images (adds that column). + HasReleaseDockerImages bool `json:"hasReleaseDockerImages"` + // One entry per repository in the assignment's group, sorted by name. + Projects []*ProjectReport `json:"projects"` +} + // The repository URLs for one assignment: the assignment-level group URL plus one // URL per student or per group. Read-only and derived purely from the resolved // configuration — no GitLab token or API call is involved. @@ -39,6 +58,14 @@ type AssignmentView struct { ResolveError *string `json:"resolveError,omitempty"` } +// The most recent commit across a repository's branches. +type CommitReport struct { + Title string `json:"title"` + CommitterName string `json:"committerName"` + CommittedDate *time.Time `json:"committedDate,omitempty"` + WebURL string `json:"webUrl"` +} + // A course as stored for the current user. Each user sees only their own courses; // there is no way to reach another user's course. type Course struct { @@ -61,6 +88,16 @@ type Course struct { UpdatedAt time.Time `json:"updatedAt"` } +type DockerImageReport struct { + Wanted string `json:"wanted"` + Image *string `json:"image,omitempty"` +} + +type DockerImagesReport struct { + Status string `json:"status"` + Images []*DockerImageReport `json:"images"` +} + // The assignment editor is schema-driven: the GUI renders a guided, validated form // from this server-authoritative metadata, so labels, help text and dropdown // options live in exactly one place. @@ -135,9 +172,45 @@ type GroupInput struct { type Mutation struct { } +// A member of a repository (only the display fields, never GitLab-internal ids). +type ProjectMemberReport struct { + Name string `json:"name"` + Username string `json:"username"` + WebURL string `json:"webUrl"` +} + +// The report for one repository. +type ProjectReport struct { + Name string `json:"name"` + // Whether there was any activity beyond creation (or any commits). + Active bool `json:"active"` + EmptyRepo bool `json:"emptyRepo"` + Commits int `json:"commits"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + LastActivity *time.Time `json:"lastActivity,omitempty"` + LastCommit *CommitReport `json:"lastCommit,omitempty"` + OpenIssuesCount int `json:"openIssuesCount"` + OpenMergeRequestsCount int `json:"openMergeRequestsCount"` + WebURL string `json:"webUrl"` + Members []*ProjectMemberReport `json:"members"` + Release *ReleaseReport `json:"release,omitempty"` +} + type Query struct { } +type ReleaseMergeRequestReport struct { + Found bool `json:"found"` + WebURL string `json:"webUrl"` + PipelineStatus string `json:"pipelineStatus"` +} + +// The release status of a repository, when the assignment configures a release. +type ReleaseReport struct { + MergeRequest *ReleaseMergeRequestReport `json:"mergeRequest,omitempty"` + DockerImages *DockerImagesReport `json:"dockerImages,omitempty"` +} + // One repository URL together with who it belongs to. type RepoURL struct { // The student's email (or username/id fallback) or the group's name. diff --git a/web/graph/report.graphqls b/web/graph/report.graphqls new file mode 100644 index 0000000..25299ed --- /dev/null +++ b/web/graph/report.graphqls @@ -0,0 +1,84 @@ +""" +A live report over the repositories of one assignment — one row per project +(repo) with activity, last commit, open issues/merge requests, members and an +optional release status. Fetched from GitLab using the caller's stored token. +""" +type AssignmentReport { + course: String! + assignment: String! + "The assignment-level group URL." + url: String! + description: String! + "When the report was generated." + generated: Time + "Whether the assignment configures a release merge request (adds that column)." + hasReleaseMergeRequest: Boolean! + "Whether the assignment configures release docker images (adds that column)." + hasReleaseDockerImages: Boolean! + "One entry per repository in the assignment's group, sorted by name." + projects: [ProjectReport!]! +} + +"The report for one repository." +type ProjectReport { + name: String! + "Whether there was any activity beyond creation (or any commits)." + active: Boolean! + emptyRepo: Boolean! + commits: Int! + createdAt: Time + lastActivity: Time + lastCommit: CommitReport + openIssuesCount: Int! + openMergeRequestsCount: Int! + webUrl: String! + members: [ProjectMemberReport!]! + release: ReleaseReport +} + +"The most recent commit across a repository's branches." +type CommitReport { + title: String! + committerName: String! + committedDate: Time + webUrl: String! +} + +"A member of a repository (only the display fields, never GitLab-internal ids)." +type ProjectMemberReport { + name: String! + username: String! + webUrl: String! +} + +"The release status of a repository, when the assignment configures a release." +type ReleaseReport { + mergeRequest: ReleaseMergeRequestReport + dockerImages: DockerImagesReport +} + +type ReleaseMergeRequestReport { + found: Boolean! + webUrl: String! + pipelineStatus: String! +} + +type DockerImagesReport { + status: String! + images: [DockerImageReport!]! +} + +type DockerImageReport { + wanted: String! + image: String +} + +extend type Query { + """ + A live report over the repositories of one assignment, fetched from GitLab with + the caller's stored token. Null when there is no such assignment or it cannot be + resolved (e.g. an abstract base). Errors when no token is stored or GitLab is + unreachable. + """ + assignmentReport(course: String!, name: String!): AssignmentReport +} diff --git a/web/graph/report.resolvers.go b/web/graph/report.resolvers.go new file mode 100644 index 0000000..3e633bd --- /dev/null +++ b/web/graph/report.resolvers.go @@ -0,0 +1,29 @@ +package graph + +// 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.94 + +import ( + "context" + "errors" + + "github.com/obcode/glabs/v3/web/db" + "github.com/obcode/glabs/v3/web/graph/model" +) + +// AssignmentReport is the resolver for the assignmentReport field. +func (r *queryResolver) AssignmentReport(ctx context.Context, course string, name string) (*model.AssignmentReport, error) { + rep, err := r.app.AssignmentReport(ctx, course, name) + if err != nil { + if errors.Is(err, db.ErrCourseNotFound) { + return nil, nil + } + return nil, err + } + if rep == nil { + return nil, nil + } + return toGraphAssignmentReport(rep), nil +} diff --git a/web/graph/report_mapping.go b/web/graph/report_mapping.go new file mode 100644 index 0000000..e1b55b2 --- /dev/null +++ b/web/graph/report_mapping.go @@ -0,0 +1,94 @@ +package graph + +import ( + "github.com/obcode/glabs/v3/gitlab/report" + "github.com/obcode/glabs/v3/web/graph/model" +) + +// Mappers for the assignment report. They project the internal report types +// (which carry raw GitLab API structs, e.g. *gitlab.ProjectMember) onto the +// GraphQL model, exposing only the display fields — never GitLab-internal ids. + +func toGraphAssignmentReport(rep *report.Reports) *model.AssignmentReport { + projects := make([]*model.ProjectReport, 0, len(rep.Projects)) + for _, p := range rep.Projects { + if p == nil { + continue + } + projects = append(projects, toGraphProjectReport(p)) + } + return &model.AssignmentReport{ + Course: rep.Course, + Assignment: rep.Assignment, + URL: rep.URL, + Description: rep.Description, + Generated: rep.Generated, + HasReleaseMergeRequest: rep.HasReleaseMergeRequest, + HasReleaseDockerImages: rep.HasReleaseDockerImages, + Projects: projects, + } +} + +func toGraphProjectReport(p *report.ProjectReport) *model.ProjectReport { + members := make([]*model.ProjectMemberReport, 0, len(p.Members)) + for _, m := range p.Members { + if m == nil { + continue + } + members = append(members, &model.ProjectMemberReport{ + Name: m.Name, + Username: m.Username, + WebURL: m.WebURL, + }) + } + + var lastCommit *model.CommitReport + if p.LastCommit != nil { + lastCommit = &model.CommitReport{ + Title: p.LastCommit.Title, + CommitterName: p.LastCommit.CommitterName, + CommittedDate: p.LastCommit.CommittedDate, + WebURL: p.LastCommit.WebURL, + } + } + + return &model.ProjectReport{ + Name: p.Name, + Active: p.IsActive, + EmptyRepo: p.IsEmpty, + Commits: p.Commits, + CreatedAt: p.CreatedAt, + LastActivity: p.LastActivity, + LastCommit: lastCommit, + OpenIssuesCount: p.OpenIssuesCount, + OpenMergeRequestsCount: p.OpenMergeRequestsCount, + WebURL: p.WebURL, + Members: members, + Release: toGraphReleaseReport(p.Release), + } +} + +func toGraphReleaseReport(rel *report.Release) *model.ReleaseReport { + if rel == nil { + return nil + } + out := &model.ReleaseReport{} + if rel.MergeRequest != nil { + out.MergeRequest = &model.ReleaseMergeRequestReport{ + Found: rel.MergeRequest.Found, + WebURL: rel.MergeRequest.WebURL, + PipelineStatus: rel.MergeRequest.PipelineStatus, + } + } + if rel.DockerImages != nil { + images := make([]*model.DockerImageReport, 0, len(rel.DockerImages.Images)) + for _, img := range rel.DockerImages.Images { + if img == nil { + continue + } + images = append(images, &model.DockerImageReport{Wanted: img.Wanted, Image: img.Image}) + } + out.DockerImages = &model.DockerImagesReport{Status: rel.DockerImages.Status, Images: images} + } + return out +} diff --git a/web/graph/report_mapping_test.go b/web/graph/report_mapping_test.go new file mode 100644 index 0000000..ce088db --- /dev/null +++ b/web/graph/report_mapping_test.go @@ -0,0 +1,55 @@ +package graph + +import ( + "testing" + "time" + + "github.com/obcode/glabs/v3/gitlab/report" + gitlab "gitlab.com/gitlab-org/api/client-go/v2" +) + +func TestToGraphAssignmentReport(t *testing.T) { + now := time.Now() + rep := &report.Reports{ + Course: "mpd", + Assignment: "blatt1", + URL: "https://gl/mpd/x", + Description: "d", + Generated: &now, + HasReleaseMergeRequest: true, + Projects: []*report.ProjectReport{{ + Name: "blatt1-alice", + IsActive: true, + Commits: 3, + WebURL: "https://gl/p", + Members: []*gitlab.ProjectMember{ + {Name: "Alice", Username: "alice", WebURL: "https://gl/u/alice"}, + }, + LastCommit: &report.Commit{Title: "init", CommitterName: "Alice", WebURL: "https://gl/c"}, + Release: &report.Release{ + MergeRequest: &report.MergeRequest{Found: true, WebURL: "https://gl/mr", PipelineStatus: "success"}, + }, + }}, + } + + out := toGraphAssignmentReport(rep) + if out.Course != "mpd" || out.Assignment != "blatt1" || !out.HasReleaseMergeRequest { + t.Fatalf("top-level fields wrong: %+v", out) + } + if len(out.Projects) != 1 { + t.Fatalf("projects = %d, want 1", len(out.Projects)) + } + p := out.Projects[0] + if p.Name != "blatt1-alice" || !p.Active || p.Commits != 3 { + t.Errorf("project fields wrong: %+v", p) + } + if len(p.Members) != 1 || p.Members[0].Username != "alice" || p.Members[0].Name != "Alice" { + t.Errorf("members wrong: %+v", p.Members) + } + if p.LastCommit == nil || p.LastCommit.Title != "init" { + t.Errorf("lastCommit wrong: %+v", p.LastCommit) + } + if p.Release == nil || p.Release.MergeRequest == nil || !p.Release.MergeRequest.Found { + t.Errorf("release wrong: %+v", p.Release) + } +}