Jira (BOLT-1403) Prepare bolt-server for bolt_shim removal

3 views
Skip to first unread message

Casey Williams (JIRA)

unread,
Jun 17, 2019, 7:07:05 PM6/17/19
to puppe...@googlegroups.com
Casey Williams updated an issue
 
Puppet Task Runner / Task BOLT-1403
Prepare bolt-server for bolt_shim removal
Change By: Casey Williams
Summary: Refactor Prepare bolt-server spec tests in preparation for bolt_shim removal
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Casey Williams (JIRA)

unread,
Jun 17, 2019, 7:16:02 PM6/17/19
to puppe...@googlegroups.com
Casey Williams updated an issue
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.

Casey Williams (JIRA)

unread,
Jun 17, 2019, 8:25:02 PM6/17/19
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Jun 19, 2019, 2:19:05 PM6/19/19
to puppe...@googlegroups.com
Geoff Nichols updated an issue
 
Change By: Geoff Nichols
Sprint: Skeletor Kanban 20190619 , Skeletor Kanban 20190703

Geoff Nichols (JIRA)

unread,
Jun 19, 2019, 2:20:03 PM6/19/19
to puppe...@googlegroups.com

Casey Williams (JIRA)

unread,
Jun 19, 2019, 4:12:04 PM6/19/19
to puppe...@googlegroups.com
Casey Williams updated an issue
Change By: Casey Williams
There are places in bolt-server where it is assumed that "task run" is the only type of 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.
* * SSH and WinRM route reuse:* There will be endpoints for each bolt action nested under the 'ssh' and 'winrm' route segments (/ssh/run_task, /ssh/run_command, /ssh/upload_file, etc.). There are a few cases (which are detailed in the transport app's spec tests) where a certain combination of parameters to an SSH or WinRM execution should be rejected and the request halted early – right now, this is done in the run_task handler, but we should break out the SSH and WinRM validations into their own functions and apply them using Sinatra's dynamic route handling, if possible.
* *
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.

Jonathan Morris (JIRA)

unread,
Jun 20, 2019, 1:06:02 PM6/20/19
to puppe...@googlegroups.com
Jonathan Morris commented on Task BOLT-1403
 
Re: Prepare bolt-server for bolt_shim removal

Casey Williams if you're interested in pairing on the spec test refactor portions of this, shout out.

Casey Williams (JIRA)

unread,
Jun 24, 2019, 3:40:02 PM6/24/19
to puppe...@googlegroups.com

https://github.com/puppetlabs/bolt/pull/1053 is up to address the second bullet point here.

Once that's merged, Jonathan Morris let's sync up on the spec test part.

Casey Williams (JIRA)

unread,
Jun 28, 2019, 7:20:02 PM6/28/19
to puppe...@googlegroups.com

Branan Riley (JIRA)

unread,
Jul 3, 2019, 2:50:06 PM7/3/19
to puppe...@googlegroups.com
Branan Riley updated an issue
 
Change By: Branan Riley
Sprint: Skeletor Kanban 20190619, Skeletor Kanban 20190703 , Skeletor Kanban 20190717

Casey Williams (JIRA)

unread,
Jul 8, 2019, 6:56:03 PM7/8/19
to puppe...@googlegroups.com

Michelle Fredette (JIRA)

unread,
Jul 10, 2019, 3:35:02 PM7/10/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages