Skip to content

Validate target status for VuMark instance generation#2991

Merged
adamtheturtle merged 3 commits intomainfrom
validate-vumark-target-status
Feb 22, 2026
Merged

Validate target status for VuMark instance generation#2991
adamtheturtle merged 3 commits intomainfrom
validate-vumark-target-status

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 22, 2026

Summary

  • Return TargetStatusNotSuccessError when a VuMark instance generation request (POST /targets/<target-id>/instances) targets a VuMark target not yet in the success state
  • Add processing_time_seconds, last_modified_date, upload_date fields and a status property to VuMarkTarget, following the same pattern as ImageTarget
  • Add get_vumark_target method to VuMarkDatabase for target lookup by ID
  • Add tests for the processing target error, raw HTTP response, successful target, and VuMarkTarget/VuMarkDatabase serialization round-trips

Closes #2981

Test plan

  • All 478 tests pass (5 new tests added)
  • All pre-commit hooks pass (including mypy, pyright, ruff, vulture, custom linters)
  • test_processing_target - verifies TargetStatusNotSuccessError is raised for a processing VuMark target
  • test_processing_target_raw_response - verifies HTTP 403 with correct result code
  • test_successful_target - verifies a ready target generates a VuMark instance successfully
  • test_vumark_target_to_dict - verifies VuMarkTarget serialization round-trip
  • test_vumark_database_to_dict - verifies VuMarkDatabase serialization round-trip

Note

Medium Risk
Changes request-handling behavior for a public-facing mock API endpoint and adds new target state/timestamp serialization, which could affect existing tests/clients relying on previous always-success behavior.

Overview
VuMark instance generation (POST /targets/<id>/instances) now validates the target’s status and returns TargetStatusNotSuccessError (HTTP 403) when the VuMark target is still processing (implemented in both the Flask server and the requests-mock server paths).

VuMarkTarget is extended to behave more like ImageTarget, adding processing/timestamp fields plus a computed status, and VuMarkDatabase gains get_vumark_target for ID-based lookup. Tests cover the new forbidden error behavior (including raw HTTP response), successful generation once processed, and VuMark target/database serialization round-trips.

Written by Cursor Bugbot for commit 62501fa. This will update automatically on new commits. Configure here.

Return TargetStatusNotSuccessError when a VuMark instance generation
request targets a VuMark target that is not yet in the success state.

Co-authored-by: Cursor <cursoragent@cursor.com>
Test that generating a VuMark instance for a still-processing target
returns TargetStatusNotSuccessError, and that VuMarkTarget/VuMarkDatabase
round-trip through to_dict/from_dict with the new timing fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
TestVuMarkTargetStatus.test_processing_target_returns_forbidden exercises
the Flask server code path (vws.py generate_vumark_instance) with a
processing VuMark target, covering the branch that raises
TargetStatusNotSuccessError. MockVWS uses the requests-mock server, so
this branch was previously uncovered.

Co-authored-by: Cursor <cursoragent@cursor.com>
@adamtheturtle adamtheturtle merged commit 37c2811 into main Feb 22, 2026
106 checks passed
@adamtheturtle adamtheturtle deleted the validate-vumark-target-status branch February 22, 2026 10:02
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.

Validate target status for VuMark instance generation

1 participant