In support There are places in bolt-server where it is assumed that "task run" is the only type of spec testing for action that bolt server will run. Before we do BOLT-1400, BOLT-1401, and BOLT-1402, we want to look over the existing bolt-server code and find places where it makes sense to refactor things in an action-agnostic way, so that functionality can be reused for other bolt actions, like "command run", "upload file", and "run script".
*In scope:* * *JSON schemas:* The bolt server app reuses a partial json schema for task details in both the ssh and winrm request schemas (see them [here|https://github.com/puppetlabs/bolt/tree/master/lib/bolt_server/schemas]). We will also want to reuse the target schemas for winrm and ssh while creating new endpoints for other actions. Refactor the task endpoint schemas so that they load details about target parameters from two new schemas, one each for winrm and ssh targets. * *Spec tests:* Look at the following tests and refactor where warranted so that they can more easily test other bolt actions besides "task run" ("command run", "file upload", "script run"). * * [https://github.com/puppetlabs/bolt/blob/master/spec/bolt_server/transport_app_spec.rb] * * [https://github.com/puppetlabs/bolt/blob/master/spec/bolt_server/app_integration_spec.rb] ** Review these files and the three BOLT tickets and then extract any helpers, shared examples, etc. that seem appropriate.
*Out of scope:* * This ticket concerns only refactors that apply to all bolt actions – refactors that apply to only one or a few actions should be ticketed separately. The purpose of this ticket is only to unblock BOLT-1400, BOLT-1401, BOLT-1402 as a group. |
|
|