Skip to content

feat: V2 examples, deprecate function DTOs, hybrid search function chains, ListCompactionTasks - #610

Merged
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:mm
Sep 30, 2026
Merged

sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:mm

Conversation

@yhmo

@yhmo yhmo commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A single PR consolidating the V2 example/deprecation work together with two pymilvus-parity gaps. All changes are additive; no existing API behavior changes (one pure-virtual addition noted below).

Changes

New V2 examples (examples/src/v2/)

  • alias.cpp: CreateAlias, ListAliases, DescribeAlias, AlterAlias, DropAlias
  • partition.cpp: CreatePartition, HasPartition, LoadPartitions, GetPartitionStatistics, ReleasePartitions, DropPartition
  • index.cpp: CreateIndex, ListIndexes, DescribeIndex, AlterIndexProperties, DropIndexProperties, DropIndex (inserts a small row batch so describeIndex reports real rows)

Updated V2 examples

  • general.cpp: delete-by-ids, delete-by-filter, TruncateCollection, RenameCollection (with cleanup for the renamed leftover so it is rerun-safe)
  • add_field.cpp: AlterCollectionFieldProperties on a newly added field
  • db.cpp: AlterDatabaseProperties / DropDatabaseProperties
  • examples/README.md: register the new binaries; fix partition entry to GetPartitionStatistics()

Deprecations

  • AddCollectionFunctionRequest / DropCollectionFunctionRequest: marked @deprecated (docs only, no compile warnings), pointing to AddFunctionField / DropFunctionField

New public APIs (pymilvus parity)

  • HybridSearchRequest: FunctionChains() / SetFunctionChains / WithFunctionChains / AddFunctionChain; Validate() accepts rerank or function chains (mutually exclusive); the pre-callback serializes chains onto the wire
  • ListCompactionTasks (ListCompactionTasksRequest + MilvusClientV2::ListCompactionTasks): lists all retained compaction tasks of a collection via GetCompactionStateWithPlans
  • CompactionPlan: full CompactionMergeInfo surface (plan_id, trigger_id, collection_id, partition_id, channel, type, state, failure_reason, targets) plus CompactionType / CompactionTaskState enums; GetCompactionPlansResponse gains CollectionName()
  • ValidateFunctionChains() shared by SearchRequest and HybridSearchRequest (now enforces limit/offset op-param checks in both)

Infra

  • Bumped pinned milvus-proto to ae7fea6 (adds db_name/collection_name/collection_id to GetCompactionPlansRequest; also adds GetPersistentSegmentInfoRequest.states)
  • Switched system-test MinIO image to milvusdb/minio:RELEASE.2024-05-28T17-19-04Z because quay.io/minio/minio:RELEASE.2025-09-07T16-13-09Z returns unauthorized on pull and was failing the coverage CI job

API surface note

MilvusClientV2 gains one new pure virtual method ListCompactionTasks. Callers using Create() are unaffected; any external subclass/mock of MilvusClientV2 must add the override.

Testing

testing-ut and testing-it pass; clang-format/cpplint clean.

Signed-off-by: yhmo yihua.mo@zilliz.com

Copilot AI lite review requested due to automatic review settings September 24, 2026 06:59
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yhmo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.81437% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.72%. Comparing base (a0592aa) to head (5bb7e80).
⚠️ Report is 167 commits behind head on master.

Files with missing lines Patch % Lines
src/impl/MilvusClientV2Impl.cpp 84.61% 8 Missing ⚠️
src/impl/utils/DqlUtils.cpp 88.57% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #610       +/-   ##
===========================================
+ Coverage   53.47%   89.72%   +36.24%     
===========================================
  Files          52      393      +341     
  Lines        4432    16841    +12409     
  Branches        0     1851     +1851     
===========================================
+ Hits         2370    15110    +12740     
+ Misses       2062     1731      -331     
Files with missing lines Coverage Δ
src/impl/MilvusClientV2Impl.h 100.00% <ø> (ø)
src/impl/request/dql/HybridSearchRequest.cpp 90.65% <100.00%> (ø)
src/impl/request/dql/SearchRequest.cpp 94.73% <100.00%> (ø)
...mpl/request/utility/ListCompactionTasksRequest.cpp 100.00% <100.00%> (ø)
...pl/response/utility/GetCompactionPlansResponse.cpp 100.00% <100.00%> (ø)
src/impl/types/CompactionPlan.cpp 100.00% <100.00%> (ø)
src/include/milvus/MilvusClientV2.h 33.33% <ø> (ø)
.../request/collection/AddCollectionFunctionRequest.h 100.00% <ø> (ø)
...request/collection/DropCollectionFunctionRequest.h 100.00% <ø> (ø)
...c/include/milvus/request/dql/HybridSearchRequest.h 100.00% <ø> (ø)
... and 4 more

... and 396 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread examples/README.md Outdated
Comment thread examples/src/v2/index.cpp
Comment thread src/impl/request/dql/HybridSearchRequest.cpp Outdated
Comment thread src/impl/MilvusConnection.cpp Outdated
Comment thread src/impl/MilvusClientV2Impl.cpp
@mergify mergify Bot added the ci-passed label Sep 29, 2026
Comment thread src/include/milvus/MilvusClientV2.h
Comment thread examples/src/v2/general.cpp
Comment thread src/impl/utils/DqlUtils.cpp Outdated
Comment thread src/include/milvus/MilvusClientV2.h
Comment thread test/st/milvus_container.py
Comment thread src/include/milvus/types/CompactionPlan.h
…hains, ListCompactionTasks, deprecate function request DTOs

- deprecate AddCollectionFunctionRequest and DropCollectionFunctionRequest in
  favor of AddFunctionFieldRequest/DropFunctionFieldRequest (pymilvus parity)
- add examples/src/v2 alias.cpp, partition.cpp and index.cpp demonstrating the
  alias, partition and index management APIs
- general.cpp: demonstrate delete-by-ids, delete-by-filter, truncate and rename
- add_field.cpp: demonstrate AlterCollectionFieldProperties on an added field
- db.cpp: demonstrate AlterDatabaseProperties and DropDatabaseProperties
- index.cpp: insert a small row batch and flush before building indexes so
  describeIndex() reports meaningful indexed/total rows
- HybridSearchRequest: add FunctionChains()/SetFunctionChains/
  WithFunctionChains()/AddFunctionChain(); Validate() rejects function chains
  combined with a rerank and requires either one; the pre-callback converts
  each chain into the proto (pymilvus hybrid_search function_chains parity)
- ListCompactionTasks: new ListCompactionTasksRequest + MilvusClientV2::
  ListCompactionTasks facade that lists all retained compaction tasks of a
  collection via GetCompactionStateWithPlans (pymilvus list_compaction_tasks)
- bump pinned milvus-proto to ae7fea6 so GetCompactionPlansRequest carries
  db_name/collection_name (also adds GetPersistentSegmentInfoRequest.states)
- DqlUtils: guard the rerank param mapping for a null rerank function
- CompactionPlan: expose the full CompactionMergeInfo surface (plan_id,
  trigger_id, collection_id, partition_id, channel, type, state,
  failure_reason, targets) and CompactionType/CompactionTaskState enums;
  GetCompactionPlansResponse gains CollectionName() (pymilvus Plan parity)
- extract shared ValidateFunctionChains() used by SearchRequest and
  HybridSearchRequest so both enforce the limit/offset op-param checks
- reuse MilvusConnection::GetCompactionPlans for ListCompactionTasks instead
  of a duplicate GetCompactionStateWithPlans wrapper
- add unit tests and mocked tests covering the new request members,
  validation, collection_name, the full plan fields, and hybrid function
  chains on the wire request
- examples/README.md: fix partition example to reference GetPartitionStatistics
- test: switch system-test MinIO image to milvusdb/minio:RELEASE.2024-05-28T17-19-04Z
  (quay.io/minio image is not pullable in CI, failing the coverage job)

Signed-off-by: yhmo <yihua.mo@zilliz.com>
@yhmo yhmo changed the title feat: add V2 alias/partition/index examples and deprecate function request DTOs feat: V2 examples, deprecate function DTOs, hybrid search function chains, ListCompactionTasks Sep 30, 2026
@mergify mergify Bot removed the ci-passed label Sep 30, 2026
@yhmo yhmo added the lgtm label Sep 30, 2026
@mergify mergify Bot added the ci-passed label Sep 30, 2026
@sre-ci-robot
sre-ci-robot merged commit fd46338 into milvus-io:master Sep 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants