Skip to content

fix: filter git tags with --match 'v*' to avoid pkg/ submodule tags in MILVUS_VERSION#48418

Open
yanliang567 wants to merge 1 commit intomilvus-io:masterfrom
yanliang567:fix/version-tag-match
Open

fix: filter git tags with --match 'v*' to avoid pkg/ submodule tags in MILVUS_VERSION#48418
yanliang567 wants to merge 1 commit intomilvus-io:masterfrom
yanliang567:fix/version-tag-match

Conversation

@yanliang567
Copy link
Contributor

Summary

  • Add --match 'v*' to git describe --exact-match --tags in MILVUS_VERSION calculation
  • Prevents pkg/v2.6.13 (Go submodule tag) from being picked instead of v2.6.13 on release builds
  • Without this fix, GetVersion returns pkg/v2.6.13 instead of 2.6.13 because sed 's/^v//' doesn't strip the pkg/ prefix

Root Cause

The milvus repo uses Go multi-module: pkg/ has its own go.mod with tags like pkg/v2.6.13. When both v2.6.13 and pkg/v2.6.13 exist on the same commit, git describe --exact-match --tags may return the pkg/ prefixed tag.

issue: #47823

Test plan

  • Verify on a tagged commit with both v* and pkg/v* tags: git describe --exact-match --tags --match 'v*' returns only the root tag
  • Dev builds unaffected (no exact tag match, falls through to branch-date-commit format)

🤖 Generated with Claude Code

…n MILVUS_VERSION

`git describe --exact-match --tags` may return `pkg/v2.6.13` (Go submodule tag)
instead of `v2.6.13` when both tags exist on the same commit. The subsequent
`sed 's/^v//'` does not strip the `pkg/` prefix, causing GetVersion to return
`pkg/v2.6.13` instead of `2.6.13` on release builds.

Add `--match 'v*'` to only match root module tags starting with `v`.

issue: milvus-io#47823

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yanliang567

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

@sre-ci-robot sre-ci-robot added approved size/XS Denotes a PR that changes 0-9 lines. area/compilation labels Mar 20, 2026
@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Mar 20, 2026
@sre-ci-robot
Copy link
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-build-all // for ci-v2/build-all (multi-arch builds)
  • /ci-rerun-buildenv // for ci-v2/build-env (build milvus-env builder images)
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-arm // for ci-v2/e2e-arm
  • /ci-rerun-e2e-default // for ci-v2/e2e-default
  • /ci-rerun-ciloop // for ci-v2/ciloop (build + unit tests in one pipeline)
  • /ci-rerun-gosdk // for ci-v2/go-sdk (Go SDK E2E tests, AMD)
  • /ci-rerun-gosdk-arm // for ci-v2/go-sdk-arm (Go SDK E2E tests, ARM)

If you have any questions or requests, please contact @zhikunyao.

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.55%. Comparing base (519719f) to head (a6be9ee).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #48418       +/-   ##
===========================================
+ Coverage   74.85%   77.55%    +2.70%     
===========================================
  Files        1480     2107      +627     
  Lines      245722   349380   +103658     
===========================================
+ Hits       183935   270974    +87039     
- Misses      53516    70136    +16620     
+ Partials     8271     8270        -1     
Components Coverage Δ
Client 79.25% <ø> (ø)
Core 83.95% <ø> (∅)
Go 75.72% <ø> (+<0.01%) ⬆️
see 650 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sre-ci-robot sre-ci-robot added the low-code-coverage add test-label from zhikun, diff coverage > 80% label Mar 20, 2026
@mergify
Copy link
Contributor

mergify bot commented Mar 20, 2026

@yanliang567 go-sdk check failed, comment rerun go-sdk can trigger the job again.

@sre-ci-robot sre-ci-robot removed the low-code-coverage add test-label from zhikun, diff coverage > 80% label Mar 20, 2026
@mergify mergify bot added the ci-passed label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved area/compilation ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug size/XS Denotes a PR that changes 0-9 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants