Validate target status for VuMark instance generation#2991
Merged
adamtheturtle merged 3 commits intomainfrom Feb 22, 2026
Merged
Validate target status for VuMark instance generation#2991adamtheturtle merged 3 commits intomainfrom
adamtheturtle merged 3 commits intomainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TargetStatusNotSuccessErrorwhen a VuMark instance generation request (POST /targets/<target-id>/instances) targets a VuMark target not yet in thesuccessstateprocessing_time_seconds,last_modified_date,upload_datefields and astatusproperty toVuMarkTarget, following the same pattern asImageTargetget_vumark_targetmethod toVuMarkDatabasefor target lookup by IDVuMarkTarget/VuMarkDatabaseserialization round-tripsCloses #2981
Test plan
test_processing_target- verifiesTargetStatusNotSuccessErroris raised for a processing VuMark targettest_processing_target_raw_response- verifies HTTP 403 with correct result codetest_successful_target- verifies a ready target generates a VuMark instance successfullytest_vumark_target_to_dict- verifiesVuMarkTargetserialization round-triptest_vumark_database_to_dict- verifiesVuMarkDatabaseserialization round-tripNote
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 returnsTargetStatusNotSuccessError(HTTP 403) when the VuMark target is still processing (implemented in both the Flask server and therequests-mock server paths).VuMarkTargetis extended to behave more likeImageTarget, adding processing/timestamp fields plus a computedstatus, andVuMarkDatabasegainsget_vumark_targetfor 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.