fix(BA-5975): honor AND/OR/NOT in deployment my/project search#11506
Merged
jopemachine merged 3 commits intomainfrom May 8, 2026
Merged
fix(BA-5975): honor AND/OR/NOT in deployment my/project search#11506jopemachine merged 3 commits intomainfrom
jopemachine merged 3 commits intomainfrom
Conversation
my_search and project_search inlined filter conversion and dropped DeploymentFilter.AND/OR/NOT. Delegate to _convert_deployment_filter so all three search variants share one correct path.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes a regression in the deployment GraphQL adapter where my_search / project_search ignored nested AND / OR / NOT filters, causing multi-condition queries to return effectively unfiltered results.
Changes:
- Refactors
my_searchandproject_searchto delegate filter handling to the shared_convert_deployment_filterhelper. - Adds component tests to validate
ANDbehavior formy_search/project_searchandORbehavior formy_search. - Adds a changelog entry describing the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/ai/backend/manager/api/adapters/deployment/adapter.py |
Routes my_search / project_search filter conversion through the shared helper to honor nested boolean filters. |
tests/component/deployment/test_deployment.py |
Adds component coverage for adapter filtering behavior (AND/OR) to prevent regressions. |
changes/11506.fix.md |
Documents the GraphQL filter fix in the changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
| if condition is not None: | ||
| conditions.append(condition) | ||
| conditions.extend(self._convert_deployment_filter(input.filter)) |
Comment on lines
+491
to
+496
| filter_input = DeploymentFilterV2( | ||
| OR=[ | ||
| DeploymentFilterV2(tags=StringFilter(i_contains="alpha")), | ||
| DeploymentFilterV2(tags=StringFilter(i_contains="beta")), | ||
| ], | ||
| ) |
Comment on lines
+47
to
+48
| ) | ||
| from ai.backend.common.dto.manager.v2.deployment.request import ( |
OR flattened sub-filter conditions into a single OR list, degenerating (A∧B) ∨ (C∧D) into A ∨ B ∨ C ∨ D. NOT had the symmetric problem. Add combine_conditions_and helper. Each OR sub is AND-grouped before OR-combining; each NOT sub is independently negated and pushed to the top-level AND list. Apply to all _convert_*_filter methods in the deployment adapter.
4 tasks
jopemachine
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
my_searchandproject_searchin the deployment GQL adapter inlined the filter conversion and silently droppedDeploymentFilter.AND/OR/NOT, so multi-condition queries degenerated into "no filter applied" (e.g.myDeploymentswithAND: [{tags:{iContains:"4123"}}, {tags:{iContains:"1"}}]returned every non-stopped deployment)._convert_deployment_filterhelper thatadmin_searchalready uses, so all three variants share one correct path. As a side effect, the previously droppeddomain_name,project_id,resource_group,created_user_id,created_at, anddestroyed_atfields are now honored onmy_search/project_searchas well.my_searchandproject_searchplus OR onmy_searchto pin the regression.Test plan
pants fmt fix lint checkon the changed filespants test tests/component/deployment/test_deployment.py(15/15 pass, including the 3 newTestDeploymentAdapterFiltercases)Resolves BA-5975