diff --git a/graphql/generated.go b/graphql/generated.go index 8854fd86fa1..7b7ca28c8f4 100644 --- a/graphql/generated.go +++ b/graphql/generated.go @@ -665,7 +665,7 @@ type ComplexityRoot struct { SaveSubscription func(childComplexity int, subscription model.APISubscription) int SchedulePatch func(childComplexity int, patchID string, configure PatchConfigure) int SchedulePatchTasks func(childComplexity int, patchID string) int - ScheduleTasks func(childComplexity int, taskIds []string, versionID *string) int + ScheduleTasks func(childComplexity int, taskIds []string, versionID string) int ScheduleUndispatchedBaseTasks func(childComplexity int, patchID string) int SetAnnotationMetadataLinks func(childComplexity int, taskID string, execution int, metadataLinks []*model.APIMetadataLink) int SetLastRevision func(childComplexity int, opts SetLastRevisionInput) int @@ -998,7 +998,7 @@ type ComplexityRoot struct { DistroTaskQueue func(childComplexity int, distroID string) int Distros func(childComplexity int, onlySpawnable bool) int GithubProjectConflicts func(childComplexity int, projectID string) int - HasVersion func(childComplexity int, id *string, patchID *string) int + HasVersion func(childComplexity int, patchID string) int Host func(childComplexity int, hostID string) int HostEvents func(childComplexity int, hostID string, hostTag *string, limit *int, page *int) int Hosts func(childComplexity int, hostID *string, distroID *string, currentTaskID *string, statuses []string, startedBy *string, sortBy *HostSortBy, sortDir *SortDirection, page *int, limit *int) int @@ -1008,14 +1008,14 @@ type ComplexityRoot struct { MyHosts func(childComplexity int) int MyPublicKeys func(childComplexity int) int MyVolumes func(childComplexity int) int - Patch func(childComplexity int, id *string, patchID *string) int + Patch func(childComplexity int, patchID string) int Pod func(childComplexity int, podID string) int Project func(childComplexity int, projectIdentifier string) int ProjectEvents func(childComplexity int, identifier string, limit *int, before *time.Time) int ProjectSettings func(childComplexity int, identifier string) int Projects func(childComplexity int) int - RepoEvents func(childComplexity int, repoID *string, id *string, limit *int, before *time.Time) int - RepoSettings func(childComplexity int, repoID *string, id *string) int + RepoEvents func(childComplexity int, repoID string, limit *int, before *time.Time) int + RepoSettings func(childComplexity int, repoID string) int SpruceConfig func(childComplexity int) int SubnetAvailabilityZones func(childComplexity int) int Task func(childComplexity int, taskID string, execution *int) int @@ -1026,7 +1026,7 @@ type ComplexityRoot struct { User func(childComplexity int, userID *string) int UserConfig func(childComplexity int) int UserSettings func(childComplexity int) int - Version func(childComplexity int, id *string, versionID *string) int + Version func(childComplexity int, versionID string) int ViewableProjectRefs func(childComplexity int) int } @@ -1712,7 +1712,7 @@ type MutationResolver interface { AbortTask(ctx context.Context, taskID string) (*model.APITask, error) OverrideTaskDependencies(ctx context.Context, taskID string) (*model.APITask, error) RestartTask(ctx context.Context, taskID string, failedOnly bool) (*model.APITask, error) - ScheduleTasks(ctx context.Context, taskIds []string, versionID *string) ([]*model.APITask, error) + ScheduleTasks(ctx context.Context, taskIds []string, versionID string) ([]*model.APITask, error) SetTaskPriority(ctx context.Context, taskID string, priority int) (*model.APITask, error) UnscheduleTask(ctx context.Context, taskID string) (*model.APITask, error) ClearMySubscriptions(ctx context.Context) (int, error) @@ -1802,14 +1802,14 @@ type QueryResolver interface { Hosts(ctx context.Context, hostID *string, distroID *string, currentTaskID *string, statuses []string, startedBy *string, sortBy *HostSortBy, sortDir *SortDirection, page *int, limit *int) (*HostsResponse, error) TaskQueueDistros(ctx context.Context) ([]*TaskQueueDistro, error) Pod(ctx context.Context, podID string) (*model.APIPod, error) - Patch(ctx context.Context, id *string, patchID *string) (*model.APIPatch, error) + Patch(ctx context.Context, patchID string) (*model.APIPatch, error) GithubProjectConflicts(ctx context.Context, projectID string) (*model1.GithubProjectConflicts, error) Project(ctx context.Context, projectIdentifier string) (*model.APIProjectRef, error) Projects(ctx context.Context) ([]*GroupedProjects, error) ProjectEvents(ctx context.Context, identifier string, limit *int, before *time.Time) (*ProjectEvents, error) ProjectSettings(ctx context.Context, identifier string) (*model.APIProjectSettings, error) - RepoEvents(ctx context.Context, repoID *string, id *string, limit *int, before *time.Time) (*ProjectEvents, error) - RepoSettings(ctx context.Context, repoID *string, id *string) (*model.APIProjectSettings, error) + RepoEvents(ctx context.Context, repoID string, limit *int, before *time.Time) (*ProjectEvents, error) + RepoSettings(ctx context.Context, repoID string) (*model.APIProjectSettings, error) ViewableProjectRefs(ctx context.Context) ([]*GroupedProjects, error) MyHosts(ctx context.Context) ([]*model.APIHost, error) MyVolumes(ctx context.Context) ([]*model.APIVolume, error) @@ -1825,8 +1825,8 @@ type QueryResolver interface { BuildVariantsForTaskName(ctx context.Context, projectIdentifier string, taskName string) ([]*task.BuildVariantTuple, error) MainlineCommits(ctx context.Context, options MainlineCommitsOptions, buildVariantOptions *BuildVariantOptions) (*MainlineCommits, error) TaskNamesForBuildVariant(ctx context.Context, projectIdentifier string, buildVariant string) ([]string, error) - HasVersion(ctx context.Context, id *string, patchID *string) (bool, error) - Version(ctx context.Context, id *string, versionID *string) (*model.APIVersion, error) + HasVersion(ctx context.Context, patchID string) (bool, error) + Version(ctx context.Context, versionID string) (*model.APIVersion, error) } type RepoSettingsResolver interface { Aliases(ctx context.Context, obj *model.APIProjectSettings) ([]*model.APIProjectAlias, error) @@ -1995,10 +1995,10 @@ type PlannerSettingsInputResolver interface { Version(ctx context.Context, obj *model.APIPlannerSettings, data PlannerVersion) error } type ProjectSettingsInputResolver interface { - ProjectID(ctx context.Context, obj *model.APIProjectSettings, data *string) error + ProjectID(ctx context.Context, obj *model.APIProjectSettings, data string) error } type RepoSettingsInputResolver interface { - RepoID(ctx context.Context, obj *model.APIProjectSettings, data *string) error + RepoID(ctx context.Context, obj *model.APIProjectSettings, data string) error } type SleepScheduleInputResolver interface { WholeWeekdaysOff(ctx context.Context, obj *host.SleepScheduleInfo, data []int) error @@ -4724,7 +4724,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Mutation.ScheduleTasks(childComplexity, args["taskIds"].([]string), args["versionId"].(*string)), true + return e.complexity.Mutation.ScheduleTasks(childComplexity, args["taskIds"].([]string), args["versionId"].(string)), true case "Mutation.scheduleUndispatchedBaseTasks": if e.complexity.Mutation.ScheduleUndispatchedBaseTasks == nil { @@ -6512,7 +6512,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.HasVersion(childComplexity, args["id"].(*string), args["patchId"].(*string)), true + return e.complexity.Query.HasVersion(childComplexity, args["patchId"].(string)), true case "Query.host": if e.complexity.Query.Host == nil { @@ -6612,7 +6612,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Patch(childComplexity, args["id"].(*string), args["patchId"].(*string)), true + return e.complexity.Query.Patch(childComplexity, args["patchId"].(string)), true case "Query.pod": if e.complexity.Query.Pod == nil { @@ -6679,7 +6679,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.RepoEvents(childComplexity, args["repoId"].(*string), args["id"].(*string), args["limit"].(*int), args["before"].(*time.Time)), true + return e.complexity.Query.RepoEvents(childComplexity, args["repoId"].(string), args["limit"].(*int), args["before"].(*time.Time)), true case "Query.repoSettings": if e.complexity.Query.RepoSettings == nil { @@ -6691,7 +6691,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.RepoSettings(childComplexity, args["repoId"].(*string), args["id"].(*string)), true + return e.complexity.Query.RepoSettings(childComplexity, args["repoId"].(string)), true case "Query.spruceConfig": if e.complexity.Query.SpruceConfig == nil { @@ -6798,7 +6798,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.Version(childComplexity, args["id"].(*string), args["versionId"].(*string)), true + return e.complexity.Query.Version(childComplexity, args["versionId"].(string)), true case "Query.viewableProjectRefs": if e.complexity.Query.ViewableProjectRefs == nil { @@ -11049,10 +11049,10 @@ func (ec *executionContext) field_Mutation_scheduleTasks_args(ctx context.Contex } } args["taskIds"] = arg0 - var arg1 *string + var arg1 string if tmp, ok := rawArgs["versionId"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionId")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } @@ -11663,24 +11663,15 @@ func (ec *executionContext) field_Query_githubProjectConflicts_args(ctx context. func (ec *executionContext) field_Query_hasVersion_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - var arg1 *string + var arg0 string if tmp, ok := rawArgs["patchId"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("patchId")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["patchId"] = arg1 + args["patchId"] = arg0 return args, nil } @@ -11870,24 +11861,15 @@ func (ec *executionContext) field_Query_mainlineCommits_args(ctx context.Context func (ec *executionContext) field_Query_patch_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - var arg1 *string + var arg0 string if tmp, ok := rawArgs["patchId"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("patchId")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["patchId"] = arg1 + args["patchId"] = arg0 return args, nil } @@ -12008,10 +11990,10 @@ func (ec *executionContext) field_Query_project_args(ctx context.Context, rawArg func (ec *executionContext) field_Query_repoEvents_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *string + var arg0 string if tmp, ok := rawArgs["repoId"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) - directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, tmp) } + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { access, err := ec.unmarshalNProjectSettingsAccess2githubᚗcomᚋevergreenᚑciᚋevergreenᚋgraphqlᚐProjectSettingsAccess(ctx, "VIEW") if err != nil { @@ -12027,52 +12009,41 @@ func (ec *executionContext) field_Query_repoEvents_args(ctx context.Context, raw if err != nil { return nil, graphql.ErrorOnPath(ctx, err) } - if data, ok := tmp.(*string); ok { + if data, ok := tmp.(string); ok { arg0 = data - } else if tmp == nil { - arg0 = nil } else { - return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)) } } args["repoId"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg1 - var arg2 *int + var arg1 *int if tmp, ok := rawArgs["limit"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("limit")) - arg2, err = ec.unmarshalOInt2ᚖint(ctx, tmp) + arg1, err = ec.unmarshalOInt2ᚖint(ctx, tmp) if err != nil { return nil, err } } - args["limit"] = arg2 - var arg3 *time.Time + args["limit"] = arg1 + var arg2 *time.Time if tmp, ok := rawArgs["before"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("before")) - arg3, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, tmp) + arg2, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, tmp) if err != nil { return nil, err } } - args["before"] = arg3 + args["before"] = arg2 return args, nil } func (ec *executionContext) field_Query_repoSettings_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *string + var arg0 string if tmp, ok := rawArgs["repoId"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) - directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, tmp) } + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalNString2string(ctx, tmp) } directive1 := func(ctx context.Context) (interface{}, error) { access, err := ec.unmarshalNProjectSettingsAccess2githubᚗcomᚋevergreenᚑciᚋevergreenᚋgraphqlᚐProjectSettingsAccess(ctx, "VIEW") if err != nil { @@ -12088,24 +12059,13 @@ func (ec *executionContext) field_Query_repoSettings_args(ctx context.Context, r if err != nil { return nil, graphql.ErrorOnPath(ctx, err) } - if data, ok := tmp.(*string); ok { + if data, ok := tmp.(string); ok { arg0 = data - } else if tmp == nil { - arg0 = nil } else { - return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp)) + return nil, graphql.ErrorOnPath(ctx, fmt.Errorf(`unexpected type %T from directive, should be string`, tmp)) } } args["repoId"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg1 return args, nil } @@ -12214,24 +12174,15 @@ func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs m func (ec *executionContext) field_Query_version_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - var arg1 *string + var arg0 string if tmp, ok := rawArgs["versionId"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("versionId")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) + arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err } } - args["versionId"] = arg1 + args["versionId"] = arg0 return args, nil } @@ -31332,7 +31283,7 @@ func (ec *executionContext) _Mutation_scheduleTasks(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ScheduleTasks(rctx, fc.Args["taskIds"].([]string), fc.Args["versionId"].(*string)) + return ec.resolvers.Mutation().ScheduleTasks(rctx, fc.Args["taskIds"].([]string), fc.Args["versionId"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -43819,7 +43770,7 @@ func (ec *executionContext) _Query_patch(ctx context.Context, field graphql.Coll }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Patch(rctx, fc.Args["id"].(*string), fc.Args["patchId"].(*string)) + return ec.resolvers.Query().Patch(rctx, fc.Args["patchId"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -44340,7 +44291,7 @@ func (ec *executionContext) _Query_repoEvents(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().RepoEvents(rctx, fc.Args["repoId"].(*string), fc.Args["id"].(*string), fc.Args["limit"].(*int), fc.Args["before"].(*time.Time)) + return ec.resolvers.Query().RepoEvents(rctx, fc.Args["repoId"].(string), fc.Args["limit"].(*int), fc.Args["before"].(*time.Time)) }) if err != nil { ec.Error(ctx, err) @@ -44401,7 +44352,7 @@ func (ec *executionContext) _Query_repoSettings(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().RepoSettings(rctx, fc.Args["repoId"].(*string), fc.Args["id"].(*string)) + return ec.resolvers.Query().RepoSettings(rctx, fc.Args["repoId"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -45708,7 +45659,7 @@ func (ec *executionContext) _Query_hasVersion(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().HasVersion(rctx, fc.Args["id"].(*string), fc.Args["patchId"].(*string)) + return ec.resolvers.Query().HasVersion(rctx, fc.Args["patchId"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -45763,7 +45714,7 @@ func (ec *executionContext) _Query_version(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Version(rctx, fc.Args["id"].(*string), fc.Args["versionId"].(*string)) + return ec.resolvers.Query().Version(rctx, fc.Args["versionId"].(string)) }) if err != nil { ec.Error(ctx, err) @@ -70408,7 +70359,7 @@ func (ec *executionContext) unmarshalInputProjectSettingsInput(ctx context.Conte switch k { case "projectId": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("projectId")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } @@ -70888,7 +70839,7 @@ func (ec *executionContext) unmarshalInputRepoSettingsInput(ctx context.Context, switch k { case "repoId": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) - data, err := ec.unmarshalOString2ᚖstring(ctx, v) + data, err := ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } diff --git a/graphql/mutation_resolver.go b/graphql/mutation_resolver.go index e99cb04dc09..0ea00b02182 100644 --- a/graphql/mutation_resolver.go +++ b/graphql/mutation_resolver.go @@ -1123,7 +1123,7 @@ func (r *mutationResolver) RestartTask(ctx context.Context, taskID string, faile } // ScheduleTasks is the resolver for the scheduleTasks field. -func (r *mutationResolver) ScheduleTasks(ctx context.Context, taskIds []string, versionID *string) ([]*restModel.APITask, error) { +func (r *mutationResolver) ScheduleTasks(ctx context.Context, taskIds []string, versionID string) ([]*restModel.APITask, error) { scheduledTasks := []*restModel.APITask{} scheduled, err := setManyTasksScheduled(ctx, r.sc.GetURL(), true, taskIds...) if err != nil { diff --git a/graphql/project_settings_resolver.go b/graphql/project_settings_resolver.go index b482d4ffb57..aec788cd139 100644 --- a/graphql/project_settings_resolver.go +++ b/graphql/project_settings_resolver.go @@ -41,8 +41,8 @@ func (r *projectSettingsResolver) Vars(ctx context.Context, obj *restModel.APIPr } // ProjectID is the resolver for the projectId field. -func (r *projectSettingsInputResolver) ProjectID(ctx context.Context, obj *restModel.APIProjectSettings, data *string) error { - obj.Id = data +func (r *projectSettingsInputResolver) ProjectID(ctx context.Context, obj *restModel.APIProjectSettings, data string) error { + obj.Id = utility.ToStringPtr(data) return nil } diff --git a/graphql/query_resolver.go b/graphql/query_resolver.go index 5553ec2d020..575af8fd46a 100644 --- a/graphql/query_resolver.go +++ b/graphql/query_resolver.go @@ -21,7 +21,6 @@ import ( "github.com/evergreen-ci/evergreen/rest/data" restModel "github.com/evergreen-ci/evergreen/rest/model" "github.com/evergreen-ci/evergreen/thirdparty" - "github.com/evergreen-ci/evergreen/util" "github.com/evergreen-ci/plank" "github.com/evergreen-ci/utility" "github.com/mongodb/anser/bsonutil" @@ -374,16 +373,14 @@ func (r *queryResolver) Pod(ctx context.Context, podID string) (*restModel.APIPo } // Patch is the resolver for the patch field. -func (r *queryResolver) Patch(ctx context.Context, id *string, patchID *string) (*restModel.APIPatch, error) { - // TODO: Remove this temporary workaround. - patchId := util.CoalesceString(utility.FromStringPtr(id), utility.FromStringPtr(patchID)) - patch, err := data.FindPatchById(patchId) +func (r *queryResolver) Patch(ctx context.Context, patchID string) (*restModel.APIPatch, error) { + patch, err := data.FindPatchById(patchID) if err != nil { return nil, InternalServerError.Send(ctx, err.Error()) } if evergreen.IsFinishedVersionStatus(*patch.Status) { - statuses, err := task.GetTaskStatusesByVersion(ctx, patchId, false) + statuses, err := task.GetTaskStatusesByVersion(ctx, patchID, false) if err != nil { return nil, InternalServerError.Send(ctx, fmt.Sprintf("fetching task statuses for patch: %s", err.Error())) } @@ -495,14 +492,12 @@ func (r *queryResolver) ProjectSettings(ctx context.Context, identifier string) } // RepoEvents is the resolver for the repoEvents field. -func (r *queryResolver) RepoEvents(ctx context.Context, repoID *string, id *string, limit *int, before *time.Time) (*ProjectEvents, error) { - // TODO: Remove this temporary workaround. - repoId := util.CoalesceString(utility.FromStringPtr(id), utility.FromStringPtr(repoID)) +func (r *queryResolver) RepoEvents(ctx context.Context, repoID string, limit *int, before *time.Time) (*ProjectEvents, error) { timestamp := time.Now() if before != nil { timestamp = *before } - events, err := data.GetEventsById(repoId, timestamp, utility.FromIntPtr(limit)) + events, err := data.GetEventsById(repoID, timestamp, utility.FromIntPtr(limit)) res := &ProjectEvents{ EventLogEntries: getPointerEventList(events), Count: len(events), @@ -511,10 +506,8 @@ func (r *queryResolver) RepoEvents(ctx context.Context, repoID *string, id *stri } // RepoSettings is the resolver for the repoSettings field. -func (r *queryResolver) RepoSettings(ctx context.Context, repoID *string, id *string) (*restModel.APIProjectSettings, error) { - // TODO: Remove this temporary workaround. - repoId := util.CoalesceString(utility.FromStringPtr(id), utility.FromStringPtr(repoID)) - repoRef, err := model.FindOneRepoRef(repoId) +func (r *queryResolver) RepoSettings(ctx context.Context, repoID string) (*restModel.APIProjectSettings, error) { + repoRef, err := model.FindOneRepoRef(repoID) if err != nil { return nil, InternalServerError.Send(ctx, fmt.Sprintf("error looking in repo collection: %s", err.Error())) } @@ -976,40 +969,35 @@ func (r *queryResolver) TaskNamesForBuildVariant(ctx context.Context, projectIde } // HasVersion is the resolver for the hasVersion field. -func (r *queryResolver) HasVersion(ctx context.Context, id *string, patchID *string) (bool, error) { - // TODO: Remove this temporary workaround. - patchId := util.CoalesceString(utility.FromStringPtr(id), utility.FromStringPtr(patchID)) - - v, err := model.VersionFindOne(model.VersionById(patchId)) +func (r *queryResolver) HasVersion(ctx context.Context, patchID string) (bool, error) { + v, err := model.VersionFindOne(model.VersionById(patchID)) if err != nil { - return false, InternalServerError.Send(ctx, fmt.Sprintf("finding version '%s': %s", patchId, err.Error())) + return false, InternalServerError.Send(ctx, fmt.Sprintf("finding version '%s': %s", patchID, err.Error())) } if v != nil { return true, nil } - if patch.IsValidId(patchId) { - p, err := patch.FindOneId(patchId) + if patch.IsValidId(patchID) { + p, err := patch.FindOneId(patchID) if err != nil { - return false, InternalServerError.Send(ctx, fmt.Sprintf("finding patch '%s': %s", patchId, err.Error())) + return false, InternalServerError.Send(ctx, fmt.Sprintf("finding patch '%s': %s", patchID, err.Error())) } if p != nil { return false, nil } } - return false, ResourceNotFound.Send(ctx, fmt.Sprintf("Unable to find patch or version %s", patchId)) + return false, ResourceNotFound.Send(ctx, fmt.Sprintf("Unable to find patch or version %s", patchID)) } // Version is the resolver for the version field. -func (r *queryResolver) Version(ctx context.Context, id *string, versionID *string) (*restModel.APIVersion, error) { - // TODO: Remove this temporary workaround. - versionId := util.CoalesceString(utility.FromStringPtr(id), utility.FromStringPtr(versionID)) - v, err := model.VersionFindOneId(versionId) +func (r *queryResolver) Version(ctx context.Context, versionID string) (*restModel.APIVersion, error) { + v, err := model.VersionFindOneId(versionID) if err != nil { - return nil, InternalServerError.Send(ctx, fmt.Sprintf("finding version '%s': %s", versionId, err.Error())) + return nil, InternalServerError.Send(ctx, fmt.Sprintf("finding version '%s': %s", versionID, err.Error())) } if v == nil { - return nil, ResourceNotFound.Send(ctx, fmt.Sprintf("version '%s' not found", versionId)) + return nil, ResourceNotFound.Send(ctx, fmt.Sprintf("version '%s' not found", versionID)) } apiVersion := restModel.APIVersion{} apiVersion.BuildFromService(*v) diff --git a/graphql/repo_settings_resolver.go b/graphql/repo_settings_resolver.go index 51d4ebacd57..3b9fcbfb0eb 100644 --- a/graphql/repo_settings_resolver.go +++ b/graphql/repo_settings_resolver.go @@ -41,8 +41,8 @@ func (r *repoSettingsResolver) Vars(ctx context.Context, obj *restModel.APIProje } // RepoID is the resolver for the repoId field. -func (r *repoSettingsInputResolver) RepoID(ctx context.Context, obj *restModel.APIProjectSettings, data *string) error { - obj.Id = data +func (r *repoSettingsInputResolver) RepoID(ctx context.Context, obj *restModel.APIProjectSettings, data string) error { + obj.Id = utility.ToStringPtr(data) return nil } diff --git a/graphql/schema/mutation.graphql b/graphql/schema/mutation.graphql index 4716b73d565..ac9b1911134 100644 --- a/graphql/schema/mutation.graphql +++ b/graphql/schema/mutation.graphql @@ -91,7 +91,7 @@ type Mutation { abortTask(taskId: String!): Task! overrideTaskDependencies(taskId: String!): Task! restartTask(taskId: String!, failedOnly: Boolean!): Task! - scheduleTasks(taskIds: [String!]!, versionId: String): [Task!]! + scheduleTasks(taskIds: [String!]!, versionId: String!): [Task!]! setTaskPriority(taskId: String!, priority: Int!): Task! unscheduleTask(taskId: String!): Task! diff --git a/graphql/schema/query.graphql b/graphql/schema/query.graphql index 1b649e2642b..374c814f8fe 100644 --- a/graphql/schema/query.graphql +++ b/graphql/schema/query.graphql @@ -42,7 +42,7 @@ type Query { pod(podId: String!): Pod! # patch - patch(id: String @deprecated(reason: "use patchId instead"), patchId: String): Patch! + patch(patchId: String!): Patch! # project githubProjectConflicts(projectId: String!): GithubProjectConflicts! @@ -55,8 +55,8 @@ type Query { @requireProjectAccess(access: VIEW) ): ProjectEvents! projectSettings(identifier: String! @requireProjectAccess(access: VIEW)): ProjectSettings! - repoEvents(repoId: String @requireProjectAccess(access: VIEW), id: String @deprecated(reason: "use repoId instead"), limit: Int = 0, before: Time): ProjectEvents! - repoSettings(repoId: String @requireProjectAccess(access: VIEW), id: String @deprecated(reason: "use repoId instead")): RepoSettings! + repoEvents(repoId: String! @requireProjectAccess(access: VIEW), limit: Int = 0, before: Time): ProjectEvents! + repoSettings(repoId: String! @requireProjectAccess(access: VIEW)): RepoSettings! viewableProjectRefs: [GroupedProjects]! # spawn @@ -89,6 +89,6 @@ type Query { taskNamesForBuildVariant(projectIdentifier: String!, buildVariant: String!): [String!] # version - hasVersion(id: String @deprecated(reason: "use patchId instead"), patchId: String): Boolean! - version(id: String @deprecated(reason: "use versionId instead"), versionId: String): Version! + hasVersion(patchId: String!): Boolean! + version(versionId: String!): Version! } diff --git a/graphql/schema/types/project_settings.graphql b/graphql/schema/types/project_settings.graphql index ff1b7ceda8c..d2fcc97e511 100644 --- a/graphql/schema/types/project_settings.graphql +++ b/graphql/schema/types/project_settings.graphql @@ -20,7 +20,7 @@ It contains information about project settings (e.g. Build Baron configurations, update the settings for a given project. """ input ProjectSettingsInput { - projectId: String # TODO: Make this required. + projectId: String! aliases: [ProjectAliasInput!] githubWebhooksEnabled: Boolean projectRef: ProjectInput diff --git a/graphql/schema/types/repo_settings.graphql b/graphql/schema/types/repo_settings.graphql index 05e112d8917..1f38868e0be 100644 --- a/graphql/schema/types/repo_settings.graphql +++ b/graphql/schema/types/repo_settings.graphql @@ -5,7 +5,7 @@ It contains information about repo settings (e.g. Build Baron configurations, su update the settings for a given project. """ input RepoSettingsInput { - repoId: String # TODO: Make this required. + repoId: String! aliases: [ProjectAliasInput!] githubWebhooksEnabled: Boolean projectRef: RepoRefInput ## use the repo ref here in order to have stronger types diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/change_identifier.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/change_identifier.graphql index 8e92d40c790..1a84692ad93 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/change_identifier.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/change_identifier.graphql @@ -1,8 +1,9 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "second_project_id" projectRef: { - id: "second_project_id", + id: "second_project_id" identifier: "sandbox" } }, diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/commit_queue_section.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/commit_queue_section.graphql index 11d14739c4b..b16da432cf3 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/commit_queue_section.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/commit_queue_section.graphql @@ -1,6 +1,7 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "sandbox_project_id" projectRef: { id: "sandbox_project_id" commitQueue: { diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/general_section.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/general_section.graphql index c1f482ecf74..358e4a0fbbe 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/general_section.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/general_section.graphql @@ -1,10 +1,11 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "sandbox_project_id" projectRef: { - id: "sandbox_project_id", - identifier: "sandbox", - enabled: true, + id: "sandbox_project_id" + identifier: "sandbox" + enabled: true remotePath: "my_path_is_new" owner: "evergreen-ci" repo: "commit-queue-sandbox" diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/notifications_section.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/notifications_section.graphql index 2e357be0a72..f200ba5b0aa 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/notifications_section.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/notifications_section.graphql @@ -1,6 +1,7 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "sandbox_project_id" projectRef: { id: "sandbox_project_id" banner: { theme: WARNING, text: "banner text!!" } diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/patch_alias_section.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/patch_alias_section.graphql index 2badab90a08..ce8739132b4 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/patch_alias_section.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/patch_alias_section.graphql @@ -1,6 +1,7 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "sandbox_project_id" projectRef: { id: "sandbox_project_id" patchTriggerAliases: [] diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/plugins_section.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/plugins_section.graphql index b3c312c631d..0a4c88f2a84 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/plugins_section.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/plugins_section.graphql @@ -1,6 +1,7 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "sandbox_project_id" projectRef: { id: "sandbox_project_id" patchTriggerAliases: [] diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/vars_section.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/vars_section.graphql index 64fc7916018..718285f1ff7 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/vars_section.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/vars_section.graphql @@ -1,8 +1,9 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "sandbox_project_id" projectRef: { - id: "sandbox_project_id" + id: "sandbox_project_id" } vars: { vars: {goodbye: "now"}, diff --git a/graphql/tests/mutation/saveProjectSettingsForSection/queries/views_and_filters_section.graphql b/graphql/tests/mutation/saveProjectSettingsForSection/queries/views_and_filters_section.graphql index ddc7248167d..5b7fa17112c 100644 --- a/graphql/tests/mutation/saveProjectSettingsForSection/queries/views_and_filters_section.graphql +++ b/graphql/tests/mutation/saveProjectSettingsForSection/queries/views_and_filters_section.graphql @@ -1,6 +1,7 @@ mutation { saveProjectSettingsForSection( projectSettings: { + projectId: "sandbox_project_id" projectRef: { id: "sandbox_project_id" parsleyFilters: [ diff --git a/graphql/tests/mutation/saveRepoSettingsForSection/queries/commit_queue_section.graphql b/graphql/tests/mutation/saveRepoSettingsForSection/queries/commit_queue_section.graphql index 276f70e8cb6..ef7ce79d7c9 100644 --- a/graphql/tests/mutation/saveRepoSettingsForSection/queries/commit_queue_section.graphql +++ b/graphql/tests/mutation/saveRepoSettingsForSection/queries/commit_queue_section.graphql @@ -1,6 +1,7 @@ mutation { saveRepoSettingsForSection( repoSettings: { + repoId: "repo_id" projectRef: { id: "repo_id" commitQueue: { diff --git a/graphql/tests/mutation/saveRepoSettingsForSection/queries/general_section.graphql b/graphql/tests/mutation/saveRepoSettingsForSection/queries/general_section.graphql index 07000b64805..0ff0d1d7499 100644 --- a/graphql/tests/mutation/saveRepoSettingsForSection/queries/general_section.graphql +++ b/graphql/tests/mutation/saveRepoSettingsForSection/queries/general_section.graphql @@ -1,6 +1,7 @@ mutation { saveRepoSettingsForSection( repoSettings: { + repoId: "repo_id" projectRef: { id: "repo_id" owner: "hello", diff --git a/graphql/tests/mutation/saveRepoSettingsForSection/queries/vars_section.graphql b/graphql/tests/mutation/saveRepoSettingsForSection/queries/vars_section.graphql index 58471306ac5..b289417fa2a 100644 --- a/graphql/tests/mutation/saveRepoSettingsForSection/queries/vars_section.graphql +++ b/graphql/tests/mutation/saveRepoSettingsForSection/queries/vars_section.graphql @@ -1,6 +1,7 @@ mutation { saveRepoSettingsForSection( repoSettings: { + repoId: "repo_id" projectRef: { id: "repo_id" } diff --git a/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks.graphql b/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks.graphql index 467ac00993d..e634d28ff6a 100644 --- a/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks.graphql +++ b/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks.graphql @@ -1,5 +1,5 @@ mutation { - scheduleTasks(taskIds: ["wuzzup"]) { + scheduleTasks(taskIds: ["wuzzup"], versionId: "version") { status } -} \ No newline at end of file +} diff --git a/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks_failure.graphql b/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks_failure.graphql index 823613a2e12..6d9a5cbe37a 100644 --- a/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks_failure.graphql +++ b/graphql/tests/mutation/scheduleTasks/queries/schedule_tasks_failure.graphql @@ -1,5 +1,5 @@ mutation { - scheduleTasks(taskIds: ["non-existent"]) { + scheduleTasks(taskIds: ["non-existent"], versionId: "version") { status } -} \ No newline at end of file +} diff --git a/graphql/tests/patch/baseTaskStatuses/queries/base_task_statuses.graphql b/graphql/tests/patch/baseTaskStatuses/queries/base_task_statuses.graphql index 3f84396f2d4..cee5bc6b971 100644 --- a/graphql/tests/patch/baseTaskStatuses/queries/base_task_statuses.graphql +++ b/graphql/tests/patch/baseTaskStatuses/queries/base_task_statuses.graphql @@ -1,5 +1,5 @@ { - patch(id: "5dd2e89cd1fe07048e43bb9c") { + patch(patchId: "5dd2e89cd1fe07048e43bb9c") { baseTaskStatuses } } diff --git a/graphql/tests/patch/baseVersion/queries/base_version.graphql b/graphql/tests/patch/baseVersion/queries/base_version.graphql index 2ae0bd9bbd6..b58049e44b7 100644 --- a/graphql/tests/patch/baseVersion/queries/base_version.graphql +++ b/graphql/tests/patch/baseVersion/queries/base_version.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { id versionFull { baseVersion { diff --git a/graphql/tests/patch/baseVersion/queries/base_version_null.graphql b/graphql/tests/patch/baseVersion/queries/base_version_null.graphql index 742fa028996..fe182aed97f 100644 --- a/graphql/tests/patch/baseVersion/queries/base_version_null.graphql +++ b/graphql/tests/patch/baseVersion/queries/base_version_null.graphql @@ -1,5 +1,5 @@ { - patch(id: "5d7288d91f8c8a403bc34a7d") { + patch(patchId: "5d7288d91f8c8a403bc34a7d") { id versionFull { baseVersion { diff --git a/graphql/tests/patch/builds/queries/builds_do_not_exist.graphql b/graphql/tests/patch/builds/queries/builds_do_not_exist.graphql index 2fa2f4c8827..adf2ec326c1 100644 --- a/graphql/tests/patch/builds/queries/builds_do_not_exist.graphql +++ b/graphql/tests/patch/builds/queries/builds_do_not_exist.graphql @@ -1,5 +1,5 @@ { - patch(id: "9e4ff3abe3c3317e352062e4") { + patch(patchId: "9e4ff3abe3c3317e352062e4") { builds { id buildVariant diff --git a/graphql/tests/patch/builds/queries/builds_exist.graphql b/graphql/tests/patch/builds/queries/builds_exist.graphql index 4771a22adfb..9581c74d9f6 100644 --- a/graphql/tests/patch/builds/queries/builds_exist.graphql +++ b/graphql/tests/patch/builds/queries/builds_exist.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e94c8213e8e8651bee37561") { + patch(patchId: "5e94c8213e8e8651bee37561") { builds { id buildVariant diff --git a/graphql/tests/patch/childPatchAliases/queries/child_patch_aliases.graphql b/graphql/tests/patch/childPatchAliases/queries/child_patch_aliases.graphql index a5a02005112..5e2b7a4562b 100644 --- a/graphql/tests/patch/childPatchAliases/queries/child_patch_aliases.graphql +++ b/graphql/tests/patch/childPatchAliases/queries/child_patch_aliases.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e1") { + patch(patchId: "5e4ff3abe3c3317e352062e1") { childPatchAliases { alias patchId diff --git a/graphql/tests/patch/childPatches/queries/child_patches.graphql b/graphql/tests/patch/childPatches/queries/child_patches.graphql index 7a468e0b3f5..49f040a0c0b 100644 --- a/graphql/tests/patch/childPatches/queries/child_patches.graphql +++ b/graphql/tests/patch/childPatches/queries/child_patches.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e1") { + patch(patchId: "5e4ff3abe3c3317e352062e1") { id childPatches { id diff --git a/graphql/tests/patch/childPatches/queries/child_patches_null.graphql b/graphql/tests/patch/childPatches/queries/child_patches_null.graphql index 67be00100c1..a0a05bd968c 100644 --- a/graphql/tests/patch/childPatches/queries/child_patches_null.graphql +++ b/graphql/tests/patch/childPatches/queries/child_patches_null.graphql @@ -1,5 +1,5 @@ { - patch(id: "5d7288d91f8c8a403bc34a7d") { + patch(patchId: "5d7288d91f8c8a403bc34a7d") { id childPatches { id diff --git a/graphql/tests/patch/commitQueuePosition/queries/commit_queue_patch.graphql b/graphql/tests/patch/commitQueuePosition/queries/commit_queue_patch.graphql index f5069f44f57..c96e3fb8991 100644 --- a/graphql/tests/patch/commitQueuePosition/queries/commit_queue_patch.graphql +++ b/graphql/tests/patch/commitQueuePosition/queries/commit_queue_patch.graphql @@ -1,5 +1,5 @@ { - patch(id: "5c74085f32f41738270aeba8") { + patch(patchId: "5c74085f32f41738270aeba8") { commitQueuePosition } } diff --git a/graphql/tests/patch/commitQueuePosition/queries/github_merge_patch.graphql b/graphql/tests/patch/commitQueuePosition/queries/github_merge_patch.graphql index 73d625ef69a..b2986b3c2bf 100644 --- a/graphql/tests/patch/commitQueuePosition/queries/github_merge_patch.graphql +++ b/graphql/tests/patch/commitQueuePosition/queries/github_merge_patch.graphql @@ -1,5 +1,5 @@ { - patch(id: "64db7d48b237368d9eea0d10") { + patch(patchId: "64db7d48b237368d9eea0d10") { commitQueuePosition } } diff --git a/graphql/tests/patch/commitQueuePosition/queries/github_pr_patch.graphql b/graphql/tests/patch/commitQueuePosition/queries/github_pr_patch.graphql index 321c70f7c5d..a0c5360eec0 100644 --- a/graphql/tests/patch/commitQueuePosition/queries/github_pr_patch.graphql +++ b/graphql/tests/patch/commitQueuePosition/queries/github_pr_patch.graphql @@ -1,5 +1,5 @@ { - patch(id: "9e4ff3abe3c3317e352062e4") { + patch(patchId: "9e4ff3abe3c3317e352062e4") { commitQueuePosition } } diff --git a/graphql/tests/patch/createTime/queries/create_time.graphql b/graphql/tests/patch/createTime/queries/create_time.graphql index 0c8913bc45a..1ae960076f6 100644 --- a/graphql/tests/patch/createTime/queries/create_time.graphql +++ b/graphql/tests/patch/createTime/queries/create_time.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e94c8213e8e8651bee37561") { + patch(patchId: "5e94c8213e8e8651bee37561") { createTime } } diff --git a/graphql/tests/patch/createTime/queries/create_time_null.graphql b/graphql/tests/patch/createTime/queries/create_time_null.graphql index 090aec8b979..c33ae11cea3 100644 --- a/graphql/tests/patch/createTime/queries/create_time_null.graphql +++ b/graphql/tests/patch/createTime/queries/create_time_null.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { createTime } } diff --git a/graphql/tests/patch/duration/queries/makespan.graphql b/graphql/tests/patch/duration/queries/makespan.graphql index 1e96b514334..b5793dc0eb9 100644 --- a/graphql/tests/patch/duration/queries/makespan.graphql +++ b/graphql/tests/patch/duration/queries/makespan.graphql @@ -1,5 +1,5 @@ { - patch(id: "9a1f8ab8834b87d7b5d251a5") { + patch(patchId: "9a1f8ab8834b87d7b5d251a5") { duration { makespan } diff --git a/graphql/tests/patch/duration/queries/time_taken.graphql b/graphql/tests/patch/duration/queries/time_taken.graphql index 17cf7aa6320..306bf166e3b 100644 --- a/graphql/tests/patch/duration/queries/time_taken.graphql +++ b/graphql/tests/patch/duration/queries/time_taken.graphql @@ -1,5 +1,5 @@ { - patch(id: "9e4ff3abe3c3317e352062e4"){ + patch(patchId: "9e4ff3abe3c3317e352062e4"){ duration { timeTaken } diff --git a/graphql/tests/patch/moduleCodeChanges/queries/module_code_changes.graphql b/graphql/tests/patch/moduleCodeChanges/queries/module_code_changes.graphql index 097c6350697..ddc881517bb 100644 --- a/graphql/tests/patch/moduleCodeChanges/queries/module_code_changes.graphql +++ b/graphql/tests/patch/moduleCodeChanges/queries/module_code_changes.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { moduleCodeChanges { branchName htmlLink diff --git a/graphql/tests/patch/parameters/queries/parameters.graphql b/graphql/tests/patch/parameters/queries/parameters.graphql index 09adacd31e6..feb1e94cc43 100644 --- a/graphql/tests/patch/parameters/queries/parameters.graphql +++ b/graphql/tests/patch/parameters/queries/parameters.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { parameters { key value diff --git a/graphql/tests/patch/patchTriggerAliases/queries/patch_trigger_aliases.graphql b/graphql/tests/patch/patchTriggerAliases/queries/patch_trigger_aliases.graphql index 9bc312533ea..4440a423501 100644 --- a/graphql/tests/patch/patchTriggerAliases/queries/patch_trigger_aliases.graphql +++ b/graphql/tests/patch/patchTriggerAliases/queries/patch_trigger_aliases.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { patchTriggerAliases { alias childProjectId diff --git a/graphql/tests/patch/project/queries/variants_and_tasks.graphql b/graphql/tests/patch/project/queries/variants_and_tasks.graphql index 9a9fb8748a0..88d3b474e43 100644 --- a/graphql/tests/patch/project/queries/variants_and_tasks.graphql +++ b/graphql/tests/patch/project/queries/variants_and_tasks.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e94c8213e8e8651bee37561") { + patch(patchId: "5e94c8213e8e8651bee37561") { projectIdentifier project { variants { diff --git a/graphql/tests/patch/projectMetadata/queries/project_metadata.graphql b/graphql/tests/patch/projectMetadata/queries/project_metadata.graphql index a163517e18f..101cde8ee94 100644 --- a/graphql/tests/patch/projectMetadata/queries/project_metadata.graphql +++ b/graphql/tests/patch/projectMetadata/queries/project_metadata.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { id projectMetadata { owner diff --git a/graphql/tests/patch/taskCount/queries/task_count.graphql b/graphql/tests/patch/taskCount/queries/task_count.graphql index cb9c9efd7da..e512d75440c 100644 --- a/graphql/tests/patch/taskCount/queries/task_count.graphql +++ b/graphql/tests/patch/taskCount/queries/task_count.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { id taskCount } diff --git a/graphql/tests/patch/taskStatuses/queries/task_statuses.graphql b/graphql/tests/patch/taskStatuses/queries/task_statuses.graphql index ef9604d5512..61ca6a30216 100644 --- a/graphql/tests/patch/taskStatuses/queries/task_statuses.graphql +++ b/graphql/tests/patch/taskStatuses/queries/task_statuses.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e4ff3abe3c3317e352062e4") { + patch(patchId: "5e4ff3abe3c3317e352062e4") { taskStatuses } } diff --git a/graphql/tests/patch/time/queries/patch_time_1.graphql b/graphql/tests/patch/time/queries/patch_time_1.graphql index f956f302460..bba4c64ee29 100644 --- a/graphql/tests/patch/time/queries/patch_time_1.graphql +++ b/graphql/tests/patch/time/queries/patch_time_1.graphql @@ -1,5 +1,5 @@ { - patch(id: "5e1f8ab8834b87d7b5d251a5") { + patch(patchId: "5e1f8ab8834b87d7b5d251a5") { time { started finished diff --git a/graphql/tests/patch/time/queries/patch_time_2.graphql b/graphql/tests/patch/time/queries/patch_time_2.graphql index 256459844d8..8f19b9264ea 100644 --- a/graphql/tests/patch/time/queries/patch_time_2.graphql +++ b/graphql/tests/patch/time/queries/patch_time_2.graphql @@ -1,5 +1,5 @@ { - patch(id: "9e1f8ab8834b87d7b5d251a5") { + patch(patchId: "9e1f8ab8834b87d7b5d251a5") { time { started finished diff --git a/graphql/tests/patch/version/queries/version.graphql b/graphql/tests/patch/version/queries/version.graphql index d49bfb95bd6..0e71adf7e07 100644 --- a/graphql/tests/patch/version/queries/version.graphql +++ b/graphql/tests/patch/version/queries/version.graphql @@ -1,5 +1,5 @@ { - patch(id: "9e4ff3abe3c3317e352062e4") { + patch(patchId: "9e4ff3abe3c3317e352062e4") { versionFull { id } diff --git a/graphql/tests/patch/version/queries/version_null.graphql b/graphql/tests/patch/version/queries/version_null.graphql index 389ba878821..e67bdb920db 100644 --- a/graphql/tests/patch/version/queries/version_null.graphql +++ b/graphql/tests/patch/version/queries/version_null.graphql @@ -1,5 +1,5 @@ { - patch(id: "5c74085f32f41738270aeba8") { + patch(patchId: "5c74085f32f41738270aeba8") { versionFull { id } diff --git a/graphql/tests/query/hasVersion/queries/does_not_exist.graphql b/graphql/tests/query/hasVersion/queries/does_not_exist.graphql index aae56df07b6..495eaef6357 100644 --- a/graphql/tests/query/hasVersion/queries/does_not_exist.graphql +++ b/graphql/tests/query/hasVersion/queries/does_not_exist.graphql @@ -1,3 +1,3 @@ query { - hasVersion(id: "notARealId") + hasVersion(patchId: "notARealId") } diff --git a/graphql/tests/query/hasVersion/queries/mainline_commit.graphql b/graphql/tests/query/hasVersion/queries/mainline_commit.graphql index edac568d0a9..92fc4faebd0 100644 --- a/graphql/tests/query/hasVersion/queries/mainline_commit.graphql +++ b/graphql/tests/query/hasVersion/queries/mainline_commit.graphql @@ -1,3 +1,3 @@ query { - hasVersion(id: "evergreen_5e823e1f28baeaa22ae00823d83e03082cd148ab") + hasVersion(patchId: "evergreen_5e823e1f28baeaa22ae00823d83e03082cd148ab") } diff --git a/graphql/tests/query/hasVersion/queries/new_args.graphql b/graphql/tests/query/hasVersion/queries/new_args.graphql deleted file mode 100644 index ab357411c8d..00000000000 --- a/graphql/tests/query/hasVersion/queries/new_args.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query { - hasVersion(patchId: "evergreen_5e823e1f28baeaa22ae00823d83e03082cd148ab") -} diff --git a/graphql/tests/query/hasVersion/queries/patch.graphql b/graphql/tests/query/hasVersion/queries/patch.graphql index 9b184fcef40..bc4cf47ab1a 100644 --- a/graphql/tests/query/hasVersion/queries/patch.graphql +++ b/graphql/tests/query/hasVersion/queries/patch.graphql @@ -1,3 +1,3 @@ query { - hasVersion(id: "5dd2e89cd1fe07048e43bc8f") + hasVersion(patchId: "5dd2e89cd1fe07048e43bc8f") } diff --git a/graphql/tests/query/hasVersion/queries/periodic_build.graphql b/graphql/tests/query/hasVersion/queries/periodic_build.graphql index 9c1574d5751..f297536a281 100644 --- a/graphql/tests/query/hasVersion/queries/periodic_build.graphql +++ b/graphql/tests/query/hasVersion/queries/periodic_build.graphql @@ -1,3 +1,3 @@ query { - hasVersion(id: "5dd2e89cd1fe07048e43bb9c") + hasVersion(patchId: "5dd2e89cd1fe07048e43bb9c") } diff --git a/graphql/tests/query/hasVersion/results.json b/graphql/tests/query/hasVersion/results.json index 998ea3b20aa..5a7de97bc01 100644 --- a/graphql/tests/query/hasVersion/results.json +++ b/graphql/tests/query/hasVersion/results.json @@ -24,14 +24,6 @@ } } }, - { - "query_file": "new_args.graphql", - "result": { - "data": { - "hasVersion": true - } - } - }, { "query_file": "does_not_exist.graphql", "result": { diff --git a/graphql/tests/query/patch/queries/new_args.graphql b/graphql/tests/query/patch/queries/patch.graphql similarity index 100% rename from graphql/tests/query/patch/queries/new_args.graphql rename to graphql/tests/query/patch/queries/patch.graphql diff --git a/graphql/tests/query/patch/results.json b/graphql/tests/query/patch/results.json index f20bedcfb57..88b313b6733 100644 --- a/graphql/tests/query/patch/results.json +++ b/graphql/tests/query/patch/results.json @@ -1,7 +1,7 @@ { "tests": [ { - "query_file": "new_args.graphql", + "query_file": "patch.graphql", "result": { "data": { "patch": { diff --git a/graphql/tests/query/version/queries/new_args.graphql b/graphql/tests/query/version/queries/new_args.graphql deleted file mode 100644 index ad7dd7799c1..00000000000 --- a/graphql/tests/query/version/queries/new_args.graphql +++ /dev/null @@ -1,18 +0,0 @@ -{ - version(versionId: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe") { - id - activated - author - branch - createTime - errors - finishTime - ignored - message - order - repo - requester - revision - startTime - } -} diff --git a/graphql/tests/query/version/queries/version.graphql b/graphql/tests/query/version/queries/version.graphql index 7c2a46f5727..ad7dd7799c1 100644 --- a/graphql/tests/query/version/queries/version.graphql +++ b/graphql/tests/query/version/queries/version.graphql @@ -1,5 +1,5 @@ { - version(id: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe") { + version(versionId: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe") { id activated author diff --git a/graphql/tests/query/version/results.json b/graphql/tests/query/version/results.json index 4f4fc349f3a..3a089913ce1 100644 --- a/graphql/tests/query/version/results.json +++ b/graphql/tests/query/version/results.json @@ -24,31 +24,6 @@ } } } - }, - { - "query_file": "new_args.graphql", - "result": { - "data": { - "version": { - "id": "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe", - "activated": false, - "author": "Fake User", - "branch": "main", - "createTime": "2020-12-22T17:01:40-05:00", - "errors": [ - "tasks section in 'send email' function: function 'send email' not found in project functions" - ], - "finishTime": "2020-12-22T20:46:43.817-05:00", - "ignored": true, - "message": "EVG-13229: Project Patches Page (#555)", - "order": 656, - "repo": "spruce", - "requester": "gitter_request", - "revision": "a7906eed65f88ae436ddb5c19096969f198a9efe", - "startTime": "2020-12-22T17:04:51.38-05:00" - } - } - } } ] } diff --git a/graphql/tests/version/baseTaskStatuses/queries/base_task_statuses.graphql b/graphql/tests/version/baseTaskStatuses/queries/base_task_statuses.graphql index 5e7d04440ca..a9038e93030 100644 --- a/graphql/tests/version/baseTaskStatuses/queries/base_task_statuses.graphql +++ b/graphql/tests/version/baseTaskStatuses/queries/base_task_statuses.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { baseTaskStatuses } } diff --git a/graphql/tests/version/baseVersion/queries/base_version.graphql b/graphql/tests/version/baseVersion/queries/base_version.graphql index 786e51758b4..dc9119ec55c 100644 --- a/graphql/tests/version/baseVersion/queries/base_version.graphql +++ b/graphql/tests/version/baseVersion/queries/base_version.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { baseVersion { id } diff --git a/graphql/tests/version/buildVariantStats/queries/build_variant_stats.graphql b/graphql/tests/version/buildVariantStats/queries/build_variant_stats.graphql index fc6b28a616a..ff7a9326f77 100644 --- a/graphql/tests/version/buildVariantStats/queries/build_variant_stats.graphql +++ b/graphql/tests/version/buildVariantStats/queries/build_variant_stats.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { id buildVariantStats(options: {}) { variant diff --git a/graphql/tests/version/buildVariants/queries/build_variants.graphql b/graphql/tests/version/buildVariants/queries/build_variants.graphql index c414cbefb4c..6a89804c69f 100644 --- a/graphql/tests/version/buildVariants/queries/build_variants.graphql +++ b/graphql/tests/version/buildVariants/queries/build_variants.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { id taskCount buildVariants(options: { diff --git a/graphql/tests/version/externalLinksForMetadata/queries/external_links_for_metadata.graphql b/graphql/tests/version/externalLinksForMetadata/queries/external_links_for_metadata.graphql index fd988d4ad17..4124d6b2514 100644 --- a/graphql/tests/version/externalLinksForMetadata/queries/external_links_for_metadata.graphql +++ b/graphql/tests/version/externalLinksForMetadata/queries/external_links_for_metadata.graphql @@ -1,5 +1,5 @@ { - version(id: "spruce_e0e5f60e32e6dfeb02ff0ea8d6ea5473d49eaa9d") { + version(versionId: "spruce_e0e5f60e32e6dfeb02ff0ea8d6ea5473d49eaa9d") { externalLinksForMetadata { url displayName diff --git a/graphql/tests/version/externalLinksForMetadata/queries/external_links_unmatching_requester.graphql b/graphql/tests/version/externalLinksForMetadata/queries/external_links_unmatching_requester.graphql index e48b06746b5..4f7e009e29c 100644 --- a/graphql/tests/version/externalLinksForMetadata/queries/external_links_unmatching_requester.graphql +++ b/graphql/tests/version/externalLinksForMetadata/queries/external_links_unmatching_requester.graphql @@ -1,5 +1,5 @@ { - version(id: "unmatching_requester") { + version(versionId: "unmatching_requester") { externalLinksForMetadata { url displayName diff --git a/graphql/tests/version/gitTags/queries/git_tags.graphql b/graphql/tests/version/gitTags/queries/git_tags.graphql index 059c96d1c2d..283ce6c223f 100644 --- a/graphql/tests/version/gitTags/queries/git_tags.graphql +++ b/graphql/tests/version/gitTags/queries/git_tags.graphql @@ -1,5 +1,5 @@ query { - version(id: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe") { + version(versionId: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe") { id gitTags { pusher diff --git a/graphql/tests/version/manifest/queries/manifest.graphql b/graphql/tests/version/manifest/queries/manifest.graphql index 5ca9efb2e21..5348e2879a0 100644 --- a/graphql/tests/version/manifest/queries/manifest.graphql +++ b/graphql/tests/version/manifest/queries/manifest.graphql @@ -1,5 +1,5 @@ { - version(id: "spruce_e0e5f60e32e6dfeb02ff0ea8d6ea5473d49eaa9d"){ + version(versionId: "spruce_e0e5f60e32e6dfeb02ff0ea8d6ea5473d49eaa9d"){ manifest { id revision diff --git a/graphql/tests/version/previousVersion/queries/previous_version.graphql b/graphql/tests/version/previousVersion/queries/previous_version.graphql index c288a23247b..a4dc4db7810 100644 --- a/graphql/tests/version/previousVersion/queries/previous_version.graphql +++ b/graphql/tests/version/previousVersion/queries/previous_version.graphql @@ -1,5 +1,5 @@ { - version(id: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe"){ + version(versionId: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe"){ id previousVersion { id diff --git a/graphql/tests/version/projectMetadata/queries/project_metadata.graphql b/graphql/tests/version/projectMetadata/queries/project_metadata.graphql index 621316e5692..e14cfe30bb3 100644 --- a/graphql/tests/version/projectMetadata/queries/project_metadata.graphql +++ b/graphql/tests/version/projectMetadata/queries/project_metadata.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4"){ + version(versionId: "5e4ff3abe3c3317e352062e4"){ id projectMetadata { owner diff --git a/graphql/tests/version/taskStatuses/queries/task_statuses.graphql b/graphql/tests/version/taskStatuses/queries/task_statuses.graphql index 8af3c531d20..8e9c0f7d77b 100644 --- a/graphql/tests/version/taskStatuses/queries/task_statuses.graphql +++ b/graphql/tests/version/taskStatuses/queries/task_statuses.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { taskStatuses } } diff --git a/graphql/tests/version/tasks/queries/all_params.graphql b/graphql/tests/version/tasks/queries/all_params.graphql index 04f16320551..21fe56a30e2 100644 --- a/graphql/tests/version/tasks/queries/all_params.graphql +++ b/graphql/tests/version/tasks/queries/all_params.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { limit: 2 page: 0 diff --git a/graphql/tests/version/tasks/queries/count.graphql b/graphql/tests/version/tasks/queries/count.graphql index e5518b27b39..cbbf44b4d49 100644 --- a/graphql/tests/version/tasks/queries/count.graphql +++ b/graphql/tests/version/tasks/queries/count.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: {}) { count } diff --git a/graphql/tests/version/tasks/queries/execution_tasks.graphql b/graphql/tests/version/tasks/queries/execution_tasks.graphql index 08e2680c918..fd2dbe449c9 100644 --- a/graphql/tests/version/tasks/queries/execution_tasks.graphql +++ b/graphql/tests/version/tasks/queries/execution_tasks.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { page: 0 }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_base_status.graphql b/graphql/tests/version/tasks/queries/filter_by_base_status.graphql index 4b06c809967..8d4e1d8f96e 100644 --- a/graphql/tests/version/tasks/queries/filter_by_base_status.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_base_status.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { baseStatuses: ["failed"] }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_base_status_aborted.graphql b/graphql/tests/version/tasks/queries/filter_by_base_status_aborted.graphql index eade849b94a..1db43a2280c 100644 --- a/graphql/tests/version/tasks/queries/filter_by_base_status_aborted.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_base_status_aborted.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { baseStatuses: ["aborted"] }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_base_status_multiple.graphql b/graphql/tests/version/tasks/queries/filter_by_base_status_multiple.graphql index da837b05b13..67ee2b91d68 100644 --- a/graphql/tests/version/tasks/queries/filter_by_base_status_multiple.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_base_status_multiple.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { baseStatuses: ["aborted", "failed"] }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_status.graphql b/graphql/tests/version/tasks/queries/filter_by_status.graphql index f09015af633..d328c6bbb13 100644 --- a/graphql/tests/version/tasks/queries/filter_by_status.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_status.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { statuses: ["failed"] }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_status_aborted.graphql b/graphql/tests/version/tasks/queries/filter_by_status_aborted.graphql index 40554ca5ee8..2680ab9a624 100644 --- a/graphql/tests/version/tasks/queries/filter_by_status_aborted.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_status_aborted.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { statuses: ["aborted"] }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_status_multiple.graphql b/graphql/tests/version/tasks/queries/filter_by_status_multiple.graphql index 10df5f5b70a..d2f2b7875c8 100644 --- a/graphql/tests/version/tasks/queries/filter_by_status_multiple.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_status_multiple.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { statuses: ["failed", "success"] }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_task_name.graphql b/graphql/tests/version/tasks/queries/filter_by_task_name.graphql index 245efd6bf4c..856c238c7cd 100644 --- a/graphql/tests/version/tasks/queries/filter_by_task_name.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_task_name.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { taskName: "test" }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_task_name_bad.graphql b/graphql/tests/version/tasks/queries/filter_by_task_name_bad.graphql index 94a564b445a..2d47c545671 100644 --- a/graphql/tests/version/tasks/queries/filter_by_task_name_bad.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_task_name_bad.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { taskName: "asdfd" }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_variant.graphql b/graphql/tests/version/tasks/queries/filter_by_variant.graphql index ffacaa2fe01..be006ee912c 100644 --- a/graphql/tests/version/tasks/queries/filter_by_variant.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_variant.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { variant: "windows" }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_variant_bad.graphql b/graphql/tests/version/tasks/queries/filter_by_variant_bad.graphql index 6082ee19847..e9724ee608e 100644 --- a/graphql/tests/version/tasks/queries/filter_by_variant_bad.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_variant_bad.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { variant: "asdfd" }) { data { id diff --git a/graphql/tests/version/tasks/queries/filter_by_variant_partial.graphql b/graphql/tests/version/tasks/queries/filter_by_variant_partial.graphql index 7fa96be9eb9..d7675576444 100644 --- a/graphql/tests/version/tasks/queries/filter_by_variant_partial.graphql +++ b/graphql/tests/version/tasks/queries/filter_by_variant_partial.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { variant: "win" }) { data { id diff --git a/graphql/tests/version/tasks/queries/limit_and_pagination_1.graphql b/graphql/tests/version/tasks/queries/limit_and_pagination_1.graphql index c27e998c6d6..69a86e1d3a2 100644 --- a/graphql/tests/version/tasks/queries/limit_and_pagination_1.graphql +++ b/graphql/tests/version/tasks/queries/limit_and_pagination_1.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { limit: 2, page: 0 }) { data { id diff --git a/graphql/tests/version/tasks/queries/limit_and_pagination_2.graphql b/graphql/tests/version/tasks/queries/limit_and_pagination_2.graphql index e4cae74919d..cdcbce5ebd5 100644 --- a/graphql/tests/version/tasks/queries/limit_and_pagination_2.graphql +++ b/graphql/tests/version/tasks/queries/limit_and_pagination_2.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { limit: 2, page: 1 }) { data { id diff --git a/graphql/tests/version/tasks/queries/no_params.graphql b/graphql/tests/version/tasks/queries/no_params.graphql index 7ab986cc790..6f9f7078aca 100644 --- a/graphql/tests/version/tasks/queries/no_params.graphql +++ b/graphql/tests/version/tasks/queries/no_params.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: {}) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_by_base_status.graphql b/graphql/tests/version/tasks/queries/sort_by_base_status.graphql index 5494b7b48d4..2d725b60876 100644 --- a/graphql/tests/version/tasks/queries/sort_by_base_status.graphql +++ b/graphql/tests/version/tasks/queries/sort_by_base_status.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { sorts: [{ Key: BASE_STATUS, Direction: ASC }] }) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_by_duration.graphql b/graphql/tests/version/tasks/queries/sort_by_duration.graphql index 87ed622e298..34251b9586d 100644 --- a/graphql/tests/version/tasks/queries/sort_by_duration.graphql +++ b/graphql/tests/version/tasks/queries/sort_by_duration.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { sorts: [{ Key: DURATION, Direction: DESC }] }) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_by_name.graphql b/graphql/tests/version/tasks/queries/sort_by_name.graphql index 9050805681f..7adb9ce811d 100644 --- a/graphql/tests/version/tasks/queries/sort_by_name.graphql +++ b/graphql/tests/version/tasks/queries/sort_by_name.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { sorts: [{ Key: NAME, Direction: ASC }] }) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_by_status.graphql b/graphql/tests/version/tasks/queries/sort_by_status.graphql index 9d36ed03d33..1595e1fac2e 100644 --- a/graphql/tests/version/tasks/queries/sort_by_status.graphql +++ b/graphql/tests/version/tasks/queries/sort_by_status.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { sorts: [{ Key: STATUS, Direction: ASC }] }) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_by_variant.graphql b/graphql/tests/version/tasks/queries/sort_by_variant.graphql index 57de0f54d30..2d9a4dae43e 100644 --- a/graphql/tests/version/tasks/queries/sort_by_variant.graphql +++ b/graphql/tests/version/tasks/queries/sort_by_variant.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { sorts: [{ Key: VARIANT, Direction: ASC }] }) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_descending_base_status.graphql b/graphql/tests/version/tasks/queries/sort_descending_base_status.graphql index 78c604cac1e..3275f47dcc5 100644 --- a/graphql/tests/version/tasks/queries/sort_descending_base_status.graphql +++ b/graphql/tests/version/tasks/queries/sort_descending_base_status.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { sorts: [{ Key: BASE_STATUS, Direction: DESC }] }) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_descending_status.graphql b/graphql/tests/version/tasks/queries/sort_descending_status.graphql index a0cdbe20001..a90e4eea8cc 100644 --- a/graphql/tests/version/tasks/queries/sort_descending_status.graphql +++ b/graphql/tests/version/tasks/queries/sort_descending_status.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { sorts: [{ Key: STATUS, Direction: DESC }] }) { data { id diff --git a/graphql/tests/version/tasks/queries/sort_multiple.graphql b/graphql/tests/version/tasks/queries/sort_multiple.graphql index dceb59079fc..45591b5af76 100644 --- a/graphql/tests/version/tasks/queries/sort_multiple.graphql +++ b/graphql/tests/version/tasks/queries/sort_multiple.graphql @@ -1,5 +1,5 @@ { - version(id: "5e4ff3abe3c3317e352062e4") { + version(versionId: "5e4ff3abe3c3317e352062e4") { tasks(options: { limit: 50 page: 0 diff --git a/graphql/tests/version/upstreamProject/queries/upstream_project.graphql b/graphql/tests/version/upstreamProject/queries/upstream_project.graphql index 1b93fcd4925..834cb968fd0 100644 --- a/graphql/tests/version/upstreamProject/queries/upstream_project.graphql +++ b/graphql/tests/version/upstreamProject/queries/upstream_project.graphql @@ -1,5 +1,5 @@ { - version(id: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe"){ + version(versionId: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe"){ id upstreamProject { owner diff --git a/graphql/tests/version/warnings/queries/warnings.graphql b/graphql/tests/version/warnings/queries/warnings.graphql index 58d0a3236b8..d3473a6807a 100644 --- a/graphql/tests/version/warnings/queries/warnings.graphql +++ b/graphql/tests/version/warnings/queries/warnings.graphql @@ -1,5 +1,5 @@ { - version(id: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe") { + version(versionId: "spruce_a7906eed65f88ae436ddb5c19096969f198a9efe") { id warnings } diff --git a/graphql/version_resolver.go b/graphql/version_resolver.go index 16167ce2a18..2a87be02ba5 100644 --- a/graphql/version_resolver.go +++ b/graphql/version_resolver.go @@ -114,7 +114,7 @@ func (r *versionResolver) ChildVersions(ctx context.Context, obj *restModel.APIV childVersions := []*restModel.APIVersion{} for _, cp := range childPatchIds { // this calls the graphql Version query resolver - cv, err := r.Query().Version(ctx, utility.ToStringPtr(cp), utility.ToStringPtr(cp)) + cv, err := r.Query().Version(ctx, cp) if err != nil { // before erroring due to the version being nil or not found, // fetch the child patch to see if it's activated