fix(core): propagate filterQuery in GetServingEnvironments and GetModelArtifacts - #3220
Merged
google-oss-prow[bot] merged 1 commit intoSep 22, 2026
Conversation
…elArtifacts Both methods built the repository pagination options without copying FilterQuery, so the parameter was dropped and the endpoints returned the full unfiltered list. ServingEnvironmentListOptions also had no GetRestEntityType, so ApplyFilterQuery skipped it even once the field was set. This is the sibling of kubeflow#3208, which covered the other two list endpoints. Assisted-by: Claude Signed-off-by: Rishabh <rishabhsaiv@gmail.com>
vjkumar2756
reviewed
Sep 13, 2026
vjkumar2756
left a comment
Contributor
There was a problem hiding this comment.
@rishabhsai
Code looks great. It successfully fixes the filterQuery issue for model artifacts & serving environments with solid unit tests.
NIce OnE
Member
|
@rishabhsai, thanks for the PR. /lgtm |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pboyd The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Description
filterQueryis accepted and then dropped onGET /api/model_registry/v1/serving_environmentsandGET /api/model_registry/v1/model_artifacts(and their v1alpha3 twins), so both endpoints return the full unfiltered list and an unparseable filter comes back as a success instead of a bad request.The parameter reaches core and is lost there.
GetServingEnvironmentsatinternal/core/serving_environment.go:105andGetModelArtifactsatinternal/core/artifact.go:598copyPageSize,OrderBy,SortOrderandNextPageTokenintomodels.Paginationbut notFilterQuery. Serving environments have a second cause:ServingEnvironmentListOptionsininternal/db/models/serving_environment.go:3does not implementGetRestEntityType, so thelistOptions.(FilterApplier)assertion ininternal/platform/db/repository/generic_repository.go:50fails andApplyFilterQueryskips the filter even once the field is set. Adding the two assignments and the missing method is the whole change.#3207 and #3208 found and fixed the same defect on
/inference_servicesand/serves, two of the four list endpoints that declarefilterQueryin the OpenAPI specs, and #3207 stated the others were already correct; the remaining two are fixed here.DocArtifactListOptions,DataSetListOptions,MetricListOptionsandParameterListOptionsalso lackGetRestEntityType, but no endpoint that acceptsfilterQueryreaches them (GetArtifactsusesArtifactListOptions, which has it), so they are left alone.Fixes #3219
How Has This Been Tested?
Two new tests shaped after
TestGetInferenceServicesWithFilterQueryfrom #3208:TestGetServingEnvironmentsWithFilterQueryininternal/core/serving_environment_test.goandTestGetModelArtifactsWithFilterQueryininternal/core/artifact_test.go. Each covers name equality,externalId,LIKE,ANDandOR, invalid syntax, a filter matching nothing, and a filter combined withpageSize=1over two pages. The existingTestArtifactFilterQuery/GetModelArtifacts with experimentId filterasserted onlyGreaterOrEqual(len(items), 1)under a note calling the leakage "the current behavior"; it now asserts the exact single match.Before the change,
go test ./internal/core/ -run FilterQuery -count=1:After the change, same command:
make test,make vet,make lintandmake buildall pass locally on Go 1.26.1 with the testcontainers MySQL 8.3 and PostgreSQL databases. Reverting the three source edits while keeping the tests makes both new tests fail again, and reverting only theGetRestEntityTypeaddition makesTestGetServingEnvironmentsWithFilterQueryfail on its own, so each edit is load bearing.Merge criteria:
All the commits have been signed-off (To pass the
DCOcheck)The commits have meaningful messages
Automated tests are provided as part of the PR for major new functionalities; testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
The developer has manually tested the changes and verified that the changes work.
Code changes follow the kubeflow contribution guidelines.
For first time contributors: Please reach out to the Reviewers to ensure all tests are being run, ensuring the label
ok-to-testhas been added to the PR.This is my first PR here, so a reviewer will need to add the
ok-to-testlabel for CI to run.If you have UI changes