-
Notifications
You must be signed in to change notification settings - Fork 130
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-14383 Remove includeCommitQueue field #8667
Conversation
graphql/project_resolver.go
Outdated
Statuses: patchesInput.Statuses, | ||
Page: patchesInput.Page, | ||
Limit: patchesInput.Limit, | ||
OnlyMergeQueue: patchesInput.OnlyCommitQueue, |
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.
could we also add an optional GraphQL input param OnlyMergeQueue
and migrate the frontend to use that parameter?
model/patch/db.go
Outdated
if len(opts.Requesters) > 0 || utility.FromBoolPtr(opts.OnlyMergeQueue) { | ||
pipeline = append(pipeline, bson.M{"$addFields": bson.M{"requester": requesterExpression}}) | ||
match["requester"] = bson.M{"$in": opts.Requesters} | ||
} | ||
// Conditionally add the commit queue filter if the user is explicitly filtering on it. | ||
// This is only used on the project patches page when we want to conditionally only show the commit queue patches. | ||
if utility.FromBoolPtr(opts.OnlyCommitQueue) { | ||
match[AliasKey] = evergreen.CommitQueueAlias | ||
} | ||
|
||
// This is only used on the user patches page when we want to filter out the commit queue | ||
if opts.IncludeCommitQueue != nil && !utility.FromBoolPtr(opts.IncludeCommitQueue) { | ||
match[AliasKey] = commitQueueFilter | ||
// Conditionally add the merge queue requester filter if the user is explicitly filtering on it. | ||
// This is only used on the project patches page when we want to conditionally only show merge queue patches. | ||
if utility.FromBoolPtr(opts.OnlyMergeQueue) { | ||
match["requester"] = evergreen.GithubMergeRequester |
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.
the construction of the if statements is a bit clunky, could we organize it in a different way? something like this maybe?
if len(opts.Requesters) > 0 || utility.FromBoolPtr(opts.OnlyMergeQueue) {
requesterMatch := bson.M{"$in": opts.Requesters}
if utility.FromBoolPtr(opts.OnlyMergeQueue) {
requesterMatch = bson.M{"$eq": evergreen.GithubMergeRequester}
}
pipeline = append(pipeline, bson.M{"$addFields": bson.M{"requester": requesterExpression}})
match["requester"] = requesterMatch
}
DEVPROD-14383
Description
Remove unused includeCommitQueue field and realized we filter on merge queue patches incorrectly. Updated the logic to reflect that.