Skip to content

fix: add DB-Name header to get import progress REST API requests#3415

Open
xiaowshi wants to merge 3 commits intomilvus-io:masterfrom
xiaowshi:fix/bulk-import-db-name-header-v2
Open

fix: add DB-Name header to get import progress REST API requests#3415
xiaowshi wants to merge 3 commits intomilvus-io:masterfrom
xiaowshi:fix/bulk-import-db-name-header-v2

Conversation

@xiaowshi
Copy link
Copy Markdown

@xiaowshi xiaowshi commented Apr 16, 2026

issue #3413

@sre-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: xiaowshi
To complete the pull request process, please assign xuanyang-cn after the PR has been reviewed.
You can assign the PR to them by writing /assign @xuanyang-cn in a comment when ready.

The full list of commands accepted by this bot can be found 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

Signed-off-by: Xiaowei Shi <shallwe.shih@gmail.com>
@xiaowshi xiaowshi force-pushed the fix/bulk-import-db-name-header-v2 branch from 0126dec to 0f84f4b Compare April 16, 2026 02:59
@mergify mergify Bot added dco-passed and removed needs-dco labels Apr 16, 2026
@xiaowshi xiaowshi changed the title fix: add DB-Name header to bulk import REST API requests fix: add DB-Name header to get import progress REST API requests Apr 16, 2026
@yhmo
Copy link
Copy Markdown
Contributor

yhmo commented Apr 16, 2026

/lgtm

Copy link
Copy Markdown
Collaborator

@pymilvus-bot pymilvus-bot left a comment

Choose a reason for hiding this comment

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

The fix correctly adds db_name parameter to get_import_progress and injects it as the DB-Name HTTP header via _http_headers. However, the issue title and body explicitly call out both get_import_progress and list_import_jobs as affected.

Looking at list_import_jobs in master, it already accepts a db_name parameter but passes it only as a JSON body field ("dbName": db_name), not as the DB-Name HTTP header. Since the RBAC PrivilegeInterceptor reads the database name from the HTTP header, list_import_jobs has the same 403 problem for non-default databases with RBAC enabled.

Please also pass db_name to _post_request (and hence _http_headers) in list_import_jobs, similar to the fix already applied to get_import_progress.

Example (in list_import_jobs):

resp = _post_request(
    url=request_url, api_key=api_key, params=params, verify=verify, cert=cert,
    db_name=db_name,  # add this
    **kwargs,
)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.97%. Comparing base (4aeac5d) to head (24c17e4).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3415      +/-   ##
==========================================
+ Coverage   90.79%   90.97%   +0.18%     
==========================================
  Files          64       64              
  Lines       13945    13982      +37     
==========================================
+ Hits        12661    12720      +59     
+ Misses       1284     1262      -22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@XuanYang-cn
Copy link
Copy Markdown
Contributor

@xiaowshi, please add ut to increase the patch cov into 90% so that the patch checks will pass.

@sre-ci-robot sre-ci-robot removed the lgtm label Apr 17, 2026
@sre-ci-robot
Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@mergify mergify Bot added needs-dco and removed dco-passed labels Apr 17, 2026
Signed-off-by: Xiaowei Shi <shallwe.shih@gmail.com>
@xiaowshi xiaowshi force-pushed the fix/bulk-import-db-name-header-v2 branch from fba585e to 3d57e5e Compare April 17, 2026 10:58
@mergify mergify Bot added dco-passed and removed needs-dco labels Apr 17, 2026
@XuanYang-cn
Copy link
Copy Markdown
Contributor

XuanYang-cn commented Apr 23, 2026

Please run make format before pushing to fix code style. @xiaowshi

Signed-off-by: Xiaowei Shi <shallwe.shih@gmail.com>
@xiaowshi xiaowshi force-pushed the fix/bulk-import-db-name-header-v2 branch from 2ddbad8 to 24c17e4 Compare April 24, 2026 02:14
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.

5 participants