Skip to content

DEV-14971: Python SDK storage-service compatibility unit tests#459

Open
sihrc wants to merge 7 commits intomasterfrom
dev-14971-python-sdk-storage-compat
Open

DEV-14971: Python SDK storage-service compatibility unit tests#459
sihrc wants to merge 7 commits intomasterfrom
dev-14971-python-sdk-storage-compat

Conversation

@sihrc
Copy link
Copy Markdown
Member

@sihrc sihrc commented Apr 11, 2026

Summary

  • Adds unit tests verifying the Python SDK is fully compatible with storage-service response shapes (the Rainbow replacement)
  • Audit result: no client patches needed — storage-service /files/store returns path/name/upload_type matching exactly what UploadDocument expects; indico-file:// URI handling is unchanged
  • Tests cover UploadDocument, CreateStorageURLs, and RetrieveStorageObject against the LegacyUploadResponseItem response shape

Test plan

  • test_upload_document_posts_to_storage_files_store — confirms POST target path
  • test_upload_document_processes_path_name_upload_type — confirms response field mapping
  • test_upload_document_handles_multiple_files — multi-file upload batch
  • test_create_storage_urls_builds_indico_file_uris — URI construction from response
  • test_create_storage_urls_round_trips_through_retrieve — round-trip URI → path
  • test_retrieve_storage_object_strips_indico_file_scheme — path extraction
  • test_retrieve_storage_object_accepts_dict_with_url_key — dict input variant
  • test_retrieve_storage_object_fetches_content — end-to-end GET with mock response

All 8 tests pass. No network required.

Part of DEV-14699 storage-service migration epic.

🤖 Generated with Claude Code


Note

Low Risk
Low risk: adds/adjusts test-only dependencies and introduces new unit tests without changing runtime SDK behavior.

Overview
Adds new unit tests that assert the SDK’s storage flows remain compatible with storage-service responses, covering UploadDocument response parsing, CreateStorageURLs URI construction, and RetrieveStorageObject path handling (including redirects).

Adds tests for _UploadSMExport signed-URL uploads (success and failure paths) and for the uv-dynamic-versioning release tag regex in pyproject.toml. Updates dev/test dependencies (pytest-asyncio, requests-mock, msgpack, and tomli for Python <3.11) and refreshes uv.lock accordingly.

Reviewed by Cursor Bugbot for commit 34bdc7f. Bugbot is set up for automated code reviews on this repo. Configure here.

jacobmanderson and others added 3 commits March 13, 2026 11:14
…ervice response shapes

Audit confirms no client patches needed — storage-service produces the
same response shapes Rainbow does:
- /files/store: path/name/upload_type match what UploadDocument expects
- indico-file:// URI construction/round-trip via CreateStorageURLs works
- RetrieveStorageObject strips indico-file:// prefix correctly

Tests mock at the HTTP level; no running service required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sihrc
Copy link
Copy Markdown
Member Author

sihrc commented Apr 15, 2026

Storage migration freeze checkpoint (2026-04-15): PR remains under NOT MERGE policy, but is still failing from 2026-04-12. Requesting a CI rerun to refresh review evidence while keeping this PR unmerged.

@sihrc
Copy link
Copy Markdown
Member Author

sihrc commented Apr 15, 2026

Correction: failing check context is publish_python_sdk-unit_tests. Please rerun this CI context for fresh freeze-period validation signal (PR remains NOT MERGE).

@sihrc
Copy link
Copy Markdown
Member Author

sihrc commented Apr 15, 2026

Escalation: check context publish_python_sdk-unit_tests is still stale (last started 2026-04-12T00:02:54Z) after rerun request. Requesting CI run owners/maintainers to trigger a fresh Harness run so we can refresh freeze-period validation evidence. PR remains NOT MERGE.

@sihrc
Copy link
Copy Markdown
Member Author

sihrc commented Apr 15, 2026

@goatrocks @Sung96kim @jacobmanderson @nicholas-lockhart @arsandhu and @IndicoDataSolutions/pr-be-indicodata-ai: targeted rerun request for stale Harness context publish_python_sdk-unit_tests (still on 2026-04-12T00:02:54Z). Please trigger/own a fresh run for freeze-period validation evidence. PR remains NOT MERGE.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 00d3720. Configure here.

Comment thread tests/unit/test_release_version_pattern.py Outdated
uri = "indico-file:///storage/uploads/42/abc-uuid"
req = RetrieveStorageObject(uri)
assert req.path == "/storage/uploads/42/abc-uuid"
assert req.method == HTTPMethod.GET
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test requests unused mock_request and client fixtures

Low Severity

test_create_storage_urls_round_trips_through_retrieve declares mock_request and client as parameters but never references either in the test body. These fixtures trigger HTTP client initialization (including an auth token refresh mock), adding unnecessary setup overhead and coupling. Compare with test_retrieve_storage_object_strips_indico_file_scheme and test_retrieve_storage_object_accepts_dict_with_url_key, which correctly omit fixtures they don't need.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 00d3720. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants