Repository navigation
Add workflow deploy gates to the Python SDK and CLI - #579
Draft
joaomarcoscrs wants to merge 4 commits into
Draft
joaomarcoscrs wants to merge 4 commits into
joaomarcoscrs wants to merge 4 commits into
Conversation
A workflow with a deploy gate no longer publishes through updateWorkflow, so add a client for the gates API (save a version, run its checks, deploy it, manage the Eval gate) and raise a typed error with the server's next steps when updateWorkflow is refused.
roboflow/roboflow#18948 added a manual_approval gate. The client and CLI can now set, read and remove its rules and read version approvals; approvers still decide in the app.
This branch has not been deployed
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.
roboflow/roboflow#18337 added deploy gates and roboflow/roboflow#18948 added the manual approval type. A gated workflow publishes only a saved version that passed every gate, so
updateWorkflowanswers409 deploy_check_requiredand saves nothing. The SDK surfaced that as aRoboflowErrorholding raw JSON.update_workflownow raisesWorkflowDeployGateError, aRoboflowErrorsubclass withcode,gate_typesandnext_steps, so existingexcept RoboflowErrorcode still works. No public signature changes.Workspace.workflow_deploy_gates()wraps the/workspaces/:ws/workflowsAPI:save_version(never publishes),run,get_version/wait_for_version,deploy, the Eval gate, and the approval rules and reads. Approvers still decide in the app, and the server refuses a plain API key that changes the rules. The CLI getsworkflow version save,workflow deploy-gates ...and a realworkflow deployin place of the hidden stub.run --waitandstatus --waitexit 1 unless the version is publishable, so they chain with&&.The version argument is named
workflow_versionbecauseSortedGroupsorts positional arguments alphabetically.updateWorkflowrefusal and the CLI, with HTTP mocked byresponses; full suite andmake check_code_qualityon Python 3.10 at a7cd94d.