You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create VuMarkTarget type for semantically correct VuMark fixture (#2968)
* Create VuMarkTarget type for semantically correct VuMark fixture
Previously, _vumark_database used ImageTarget for VuMark targets, which was
semantically incorrect since VuMark targets don't have image data. Now
VuMarkTarget is a proper type that reflects the differences: no image_value,
no processing_time_seconds, always SUCCESS status, and hardcoded tracking_rating.
Changes:
- Add VuMarkTarget and VuMarkTargetDict to target.py
- Add vumark_targets field to CloudDatabase (separate from image targets)
- Update not_deleted_targets to include both types for validator lookups
- Keep active_targets, inactive_targets, etc. as image-only for clarity
- Add POST /databases/{name}/vumark_targets Flask endpoint
- Update _vumark_database fixture to use VuMarkTarget
- Update _enable_use_docker_in_memory to use new endpoint
- Document VuMarkTarget in API reference
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* Fix type issues with get_target returning image targets only
The validator uses not_deleted_targets (which returns union type) so it can
find both image and VuMark targets. But get_target() is only called for image
targets in the Flask and requests mock servers, so return ImageTarget only.
* Fix mypy type hint for not_deleted_targets union
* Separate VuMark database from CloudDatabase and minimize VuMarkTarget
Introduce VuMarkDatabase and VuMarkDatabaseDict as distinct types from
CloudDatabase, since VuMark databases don't have client keys, state, or
quota fields. Minimize VuMarkTarget/VuMarkTargetDict to only the fields
actually used (target_id, name, delete_date). Update all validators,
Flask endpoints, and request mock servers to handle the AnyDatabase
union type.
Split target manager endpoints by database type: /databases for cloud,
/vumark_databases for VuMark. Add typed lookup helpers instead of
isinstance guards in endpoint functions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix Sphinx docs reference to renamed endpoint
The create_database endpoint was renamed to create_cloud_database
but the docs/source/docker.rst autoflask directive was not updated.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Split TargetManager.databases into typed cloud_databases and vumark_databases
This eliminates 22 isinstance checks by storing each database type
separately and narrowing all downstream signatures to the specific type
they need (CloudDatabase for VWS/VWQ APIs and validators).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Revert unnecessary changes to cloud-specific functions
Restore cloud functions to match main exactly - only VuMark additions remain.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Revert cosmetic changes to existing code
Remove unnecessary docstring tweaks, comment rewraps, and refactors
to CloudDatabase that are unrelated to VuMark support.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix VuMark auth by widening validators to accept both database types
VuMark database credentials were not found during VWS authentication
because validators only searched cloud databases. Widen all service
validator signatures to accept AnyDatabase (CloudDatabase | VuMarkDatabase),
pass both database types from the Flask and requests-mock servers, and
add VuMarkDatabase to the Sphinx API docs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Address bugbot review: scope validate_request to cloud-only databases
- Skip validate_request for VuMark endpoint; it does its own validation
with both database types (fixes 500 when VuMark creds hit cloud endpoints)
- Fix misleading error message in add_cloud_database ("cloud database" → "database")
- Deduplicate AnyDatabase alias: import from _database_matchers in target_manager
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Update tests to match new database conflict error message
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix coverage: remove dead VuMark branches, add duplicate key tests
- Remove delete_date field from VuMarkTarget (VuMark targets can't be deleted)
- Simplify VuMarkDatabase.not_deleted_targets (no filtering needed)
- Remove NOT_FOUND branch from delete_vumark_database (internal API)
- Add test_duplicate_vumark_keys to both Flask and requests-mock test suites
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix VuMark duplicate keys test isolation in Flask tests
Use distinct keys ("v1", "v2", "v3") for VuMark database tests to avoid
conflicts with the TARGET_MANAGER singleton state from cloud database tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
0 commit comments