Skip to content
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

Merged
merged 7 commits into from
Feb 5, 2025

Conversation

khelif96
Copy link
Contributor

@khelif96 khelif96 commented Jan 27, 2025

DEVPROD-14383

Description

Remove unused includeCommitQueue field and realized we filter on merge queue patches incorrectly. Updated the logic to reflect that.

@khelif96 khelif96 requested a review from minnakt January 30, 2025 20:54
Statuses: patchesInput.Statuses,
Page: patchesInput.Page,
Limit: patchesInput.Limit,
OnlyMergeQueue: patchesInput.OnlyCommitQueue,
Copy link
Contributor

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?

Comment on lines 190 to 197
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
Copy link
Contributor

@minnakt minnakt Feb 3, 2025

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
	}

@khelif96 khelif96 merged commit 703fa16 into evergreen-ci:main Feb 5, 2025
10 checks passed
@khelif96 khelif96 deleted the DEVPROD-14383 branch February 5, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants