Project

Profile

Help

Story #894

Updated by bmbouter about 9 years ago

This is designed to come after story #892, but this represents a consolidation of the CLI to ease the burden on plugin writers. This which is independent of the API changes and required to have the CLI updates described in #892 and #923. work with story #892. 


 h3. The Plan 

 The One main area of work is getting plugins out of the business of needing to implement anything specific for uploads. The CLI code in platform will provide a single command for "upload" that is not provided by plugins. It will take the same options as the /import_upload API allows. 

 Plugins will have a way to manifest the content names and optional parameters the user is required to specify, along with help text for each of the to be used by the CLI. Plugin writers are not expected to provide any code for this, just manifests which will be used by platform. Each plugin will document the content types it supports    will document the way to use those fields specific to that content type. 

 This single command will upload a file, using chunking if necessary. If all chunks are received correctly, then it performs the /import_upload automatically. A separate command to import a completed upload_id will not be provided by the CLI, but a recipe will be documented where an the same file and upload_id can be specified with a different repo name and the normal upload/offset/fast-forward behavior will allow the previously uploaded content to be imported into a separate repository without much data exchanged. 

 If an unrecoverable error occurs, the user is shown a output of a command they can specify to attempt to restart a failed ID by upload_id. That takes the file and blindly uploads it again to that upload_id, and relies on the server to tell it the offset it should fast-forward to. Attempting to resume an upload_id that doesn't exist shows a reasonable error message to the user. 


 h3. Benefits 

 * Uploading becomes a single command that supports resume transparently. 

 * All plugins will not have to do anything to support upload outside of the normal interfaces they need to make anyway, and specifying the content type upload manifest. 

 * The CLI will become more consistent and the code will be de-duplicated as its moved to platform. This will resolve problems that we have currently such as the upload commands for puppet and rpm are very different from each other for no good reason.

Back