Repository navigation
Raise / exit non-zero on failed model and directory uploads (#545) - #554
Closed
tonylampada wants to merge 2 commits into
Closed
tonylampada wants to merge 2 commits into
tonylampada wants to merge 2 commits into
Conversation
…load (#545) Version.deploy() and Workspace.deploy_model() now raise RoboflowError when the upload URL request or the signed PUT fails, instead of printing and returning. Workspace.upload_dataset() per-image flow returns a summary (uploaded, duplicates, failed). `roboflow model upload` and `roboflow image upload <dir>` exit 1 with a structured error naming what failed; a zip upload whose final status is failed also exits 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Deliver checks (dm-brain
|
| if not res.ok: | ||
| raise RoboflowError(f"Failed to upload the model (HTTP {res.status_code}): {res.text}") | ||
|
|
||
| print(f"View the status of your deployment at: {APP_URL}/{self.workspace}/{self.project}/{self.version}") |
Comment on lines
+694
to
+696
| "Share your model with the world at:" | ||
| f" {UNIVERSE_URL}/{self.workspace}/{self.project}/" | ||
| f"model/{self.version}" |
Comment on lines
+971
to
+972
| f"View the status of your deployment for project {project_id} at:" | ||
| f" {APP_URL}/{self.url}/{project_id}/models" |
Collaborator
Author
|
CI status:
|
… annotation failures Review round (jarbas-review): a zip status carrying a 'failed' field would have been read as the per-image summary and crashed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Review round (local
Full suite after fixes: 1245 OK (gist updated). CI red is the pre-existing ruff 0.17 ICN001 in untouched files (fixed by #551), not this PR. |
Collaborator
Author
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.
Description
Fixes #545: failed model and directory uploads were printed and swallowed, so scripts and agents driving the SDK/CLI saw success (exit 0,
"status": "uploaded"/"imported") for uploads that never landed. Serves objective O8 (one canonical API shape on every surface): SDK and CLI now report the same failure the API returned.Version.deploy()/Workspace.deploy_model()raiseRoboflowError(HTTP status + server body) when the upload URL request or the signed PUT fails. The hardcoded 429 "already has a trained model" text is gone; the server's own message is surfaced (Feature: Multiple Models Per Version #497 made it possibly stale).Workspace.upload_dataset()per-image flow returns{"uploaded", "duplicates", "failed": [{path, stage, error}]}instead ofNone. Failed images still don't raise.roboflow model uploadexits 1 with a structured error.roboflow image upload <dir>exits 1 when any image or annotation failed (failed_count+ list in the JSON error); a zip upload whose final status isfailedexits 1.countis now the real uploaded+duplicate count, not files on disk.Type of change
deploy()never raising now get an exception)How has this change been tested?
responses-mocked HTTP; 16 new; 12 of the original 15 fail onmain, the success-path ones pass on both). Full suite: 1245 OK.Any specific deployment considerations
None; ships with the next SDK release. Changelog should note the new
deploy()exception andupload_dataset()return value.Next step: 1 of 1 for #545. Out of scope: SDK progress lines on stdout under
--json(separate card).🤖 Generated with Claude Code