-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEVPROD-7219 Remove db access from cli commands #7912
Conversation
return errors.Errorf("project ref '%s' not found", projectIdentifier) | ||
} | ||
// Projects that use the GitHub merge queue cannot enqueue to the commit queue. | ||
apiPatch.CanEnqueueToCommitQueue = (p.HasValidGitInfo() || p.IsGithubPRPatch()) && proj.CommitQueue.MergeQueue != model.MergeQueueGitHub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is only used by the UI, right? Instead of including this here, could we instead remove CanEnqueueToCommitQueue from the APIPatch struct and instead just add a resolver for it? (like
evergreen/graphql/patch_resolver.go
Line 62 in e002320
func (r *patchResolver) CommitQueuePosition(ctx context.Context, obj *restModel.APIPatch) (*int, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(@khelif96 is that reasonable?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this makes sense to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in DM moving this to a new patchResolver for the field rather than the main patch query resolver.
DEVPROD-7219
Description
Adding a db call to get project during API creation broke this function for the CLI
We now ignore the db calls when it comes from the CLI
When the function is called from the CLI, it returns the same value it used to return before the calls to the db were added
Testing
works locally