Jira (PUP-10289) Route HttpPool.connection through http client

31 views
Skip to first unread message

Josh Cooper (JIRA)

unread,
Feb 10, 2020, 1:03:04 PM2/10/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Task PUP-10289
Route HttpPool.connection through http client
Change By: Josh Cooper
Fix Version/s: PUP 6.14.0
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Feb 10, 2020, 1:03:04 PM2/10/20
to puppe...@googlegroups.com
Josh Cooper created an issue
Issue Type: Task Task
Assignee: Unassigned
Created: 2020/02/10 10:02 AM
Priority: Normal Normal
Reporter: Josh Cooper

Puppet::Network::HttpPool.connection, and deprecated methods http_instance and http_ssl_instance, currently return an instance of Puppet::Network::HTTP::Connection which is the legacy way of handling network connections.

For this issue, have the connection, etc methods return an adapter that implements the Connection API, but routes the requests through the HTTP client. This should only happen if the http_client_class is not overridden (ie in puppetserver). The adapter should return and raise the same way as the Connection class does. To access these, "unwrap" the response and exception using Puppet::HTTP::Response#nethttp and Puppet::HTTP::HTTPError#cause, respectively.

When running in puppetserver, the Puppet::Network::HttpPool.http_client_class will be non-nil, and in that case we should continue returning instances of that class when connection, etc are called.

For this ticket, implement the public methods from Puppet::Network::HTTP::Connection on the adapter:

get
post
head
delete
put
request_get
request_head
request_post
address
port
use_ssl?

The request_XXX methods accept a code block and yield the response to it.

Josh Cooper (JIRA)

unread,
Feb 10, 2020, 1:04:04 PM2/10/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Coremunity Hopper

Melissa Stone (JIRA)

unread,
Feb 24, 2020, 12:55:04 PM2/24/20
to puppe...@googlegroups.com
Melissa Stone assigned an issue to Melissa Stone
Change By: Melissa Stone
Assignee: Melissa Stone

Melissa Stone (JIRA)

unread,
Feb 24, 2020, 12:55:05 PM2/24/20
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Coremunity Hopper Platform Core KANBAN

Josh Cooper (JIRA)

unread,
Feb 27, 2020, 1:21:05 PM2/27/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
{{Puppet::Network::HttpPool.connection}}, and deprecated methods {{http_instance}} and {{http_ssl_instance}}, currently return an instance of {{Puppet::Network::HTTP::Connection}} which is the legacy way of handling network connections.

For this issue, have the {{connection}}, etc methods return an adapter that implements the {{Connection}} API, but routes the requests through the HTTP client. This should only happen if the {{http_client_class}} is not overridden (ie in puppetserver). The adapter should return and raise the same way as the Connection class does. To access these, "unwrap" the response and exception using {{Puppet::HTTP::Response#nethttp}} and {{Puppet::HTTP::HTTPError#cause}}, respectively.

When running in puppetserver, the {{Puppet::Network::HttpPool.http_client_class}} will be non-nil, and in that case we should continue returning instances of that class when {{connection}}, etc are called.


For this ticket, implement the public methods from {{Puppet::Network::HTTP::Connection}} on the adapter:

{noformat}

get
post
head
delete
put
request_get
request_head
request_post
address
port
use_ssl?
{noformat}


The {{request_XXX}} methods accept a code block and yield the response to it.


[Diagram for Puppet::Network::HTTP::ConnectionAdapter|http://www.plantuml.com/plantuml/png/TP5DQiCm48NtEiNWPI4vW0aXwKz95oaczGLKwU6Ao98OZUcYzEvjufeAH7OQlVbctfDsMJJBD7ebJZpeqFSTFNYTCpAvGDsK4aIffCrP3_Yhs_RQjzcSO4I7mMExfIz5P2xaB-yGH7tNs4kmZc4aSjlUtUHFo5TwFo08hLRRPU95AElcsNdGMvpOk30qfTGT-xAS1pTNsoUao48THuES8pUBEhjylASUFBemvN_bYOxHJXwvgKEzGZuZd-iuD_RDFWyYgOlHAw9wSTLIEAYqvJZdZI70Y8jXRtKIiABwhdYPab-lIvvQiaWCemNsyXqVpe96ZE_Wh7O8TXhz3m00]

As a result of this work, it should be possible to use the {{http}} report process or puppetdb terminus when running {{puppet apply}} and have those requests routed through our http client instead of the deprecated Puppet::Network::HTTP::Connection code.

Josh Cooper (JIRA)

unread,
Feb 27, 2020, 5:59:03 PM2/27/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
{{Puppet::Network::HttpPool.connection}}, and deprecated methods {{http_instance}} and {{http_ssl_instance}}, currently return an instance of {{Puppet::Network::HTTP::Connection}} which is the legacy way of handling network connections.

For this issue, have the {{connection}}, etc methods return an adapter that implements the {{Connection}} API, but routes the requests through the HTTP client. This should only happen if the {{http_client_class}} is not overridden (ie in puppetserver). The adapter should return and raise the same way as the Connection class does. To access these, "unwrap" the response and exception using {{Puppet::HTTP::Response#nethttp}} and {{Puppet::HTTP::HTTPError#cause}}, respectively.

When running in puppetserver, the {{Puppet::Network::HttpPool.http_client_class}} will be non-nil, and in that case we should continue returning instances of that class when {{connection}}, etc are called.

For this ticket, implement the public methods from {{Puppet::Network::HTTP::Connection}} on the adapter:

{noformat}
get
post
head
delete
put
request_get
request_head
request_post
address
port
use_ssl?
{noformat}

The {{request_XXX}} methods accept a code block and yield the response to it.

[Diagram for Puppet::Network::HTTP::ConnectionAdapter|http://www.plantuml.com/plantuml/png/ TP5DQiCm48NtEiNWPI4vW0aXwKz95oaczGLKwU6Ao98OZUcYzEvjufeAH7OQlVbctfDsMJJBD7ebJZpeqFSTFNYTCpAvGDsK4aIffCrP3_Yhs_RQjzcSO4I7mMExfIz5P2xaB TL1BQiCm4Dth54FsoG52C4a_a4sACBw0AZzS4Ns4DAABqhlNdvgwYEpqFa_pPiwPLUBYh6335dJjEadFLkMCJCQJB362XOXAtzM0NtmyphxJgOLcvGUBfg4lGQIdv9Wty2o - yGH7tNs4kmZc4aSjlUtUHFo5TwFo08hLRRPU95AElcsNdGMvpOk30qfTGT XRWCy4pxVRDoBV8_B6_T5YxvtVnxYnWIaqn18 - xAS1pTNsoUao48THuES8pUBEhjylASUFBemvN_bYOxHJXwvgKEzGZuZd UGTgkwT7XveWx96L_od_9Ajz0NYv6gAh - iuD_RDFWyYgOlHAw9wSTLIEAYqvJZdZI70Y8jXRtKIiABwhdYPab 1FqEwrwqVpPkBNPcZ3C5EjdfmRLaRrDhwNFODtaEp2VxIgyX8WcfkSvbj_d3OvgSpVvWUvE3UaR8um_V5sHy0]

[Source|http://www.plantuml.com/plantuml/uml/TL1BQiCm4Dth54FsoG52C4a_a4sACBw0AZzS4Ns4DAABqhlNdvgwYEpqFa_pPiwPLUBYh6335dJjEadFLkMCJCQJB362XOXAtzM0NtmyphxJgOLcvGUBfg4lGQIdv9Wty2o
- lIvvQiaWCemNsyXqVpe96ZE_Wh7O8TXhz3m00 XRWCy4pxVRDoBV8_B6_T5YxvtVnxYnWIaqn18-UGTgkwT7XveWx96L_od_9Ajz0NYv6gAh-1FqEwrwqVpPkBNPcZ3C5EjdfmRLaRrDhwNFODtaEp2VxIgyX8WcfkSvbj_d3OvgSpVvWUvE3UaR8um_V5sHy0 ]


As a result of this work, it should be possible to use the {{http}} report process or puppetdb terminus when running {{puppet apply}} and have those requests routed through our http client instead of the deprecated Puppet::Network::HTTP::Connection code.

Josh Cooper (Jira)

unread,
Mar 2, 2020, 1:19:04 PM3/2/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.14.0
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 27, 2020, 12:37:05 PM4/27/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-10289
 
Re: Route HttpPool.connection through http client

Looks like we'll need this so that external callers like puppetdb and classifier termini don't need to change in 6.x

Rob Braden (Jira)

unread,
Apr 27, 2020, 1:59:05 PM4/27/20
to puppe...@googlegroups.com
Rob Braden assigned an issue to Unassigned
 
Change By: Rob Braden
Assignee: Melissa Stone

Josh Cooper (Jira)

unread,
Apr 27, 2020, 5:36:04 PM4/27/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.16.0

Josh Cooper (Jira)

unread,
May 1, 2020, 7:26:03 PM5/1/20
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
Change By: Josh Cooper
Assignee: Josh Cooper

Josh Cooper (Jira)

unread,
May 15, 2020, 12:17:03 PM5/15/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Deprecation
Release Notes Summary: Calls to Puppet::Network::HttpPool (http_instance, http_ssl_instance, connection) are routed to the new HTTP client, but preserve the existing behavior for that API. The HttpPool class will be deprecated in a future 6.y release and removed in Puppet 7.

Melissa Stone (Jira)

unread,
May 18, 2020, 12:37:03 PM5/18/20
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
May 19, 2020, 10:02:02 AM5/19/20
to puppe...@googlegroups.com
Claire Cadman updated an issue
 
Change By: Claire Cadman
Labels: doc_reviewed

Melissa Stone (Jira)

unread,
May 19, 2020, 12:34:04 PM5/19/20
to puppe...@googlegroups.com
 
Re: Route HttpPool.connection through http client

This has passed ci as a part of puppet-agent 6.15.0.221.gf7013c22

Josh Cooper (Jira)

unread,
May 19, 2020, 5:18:03 PM5/19/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-10289

There’s an issue in PE because the old API accepted the URL as the path argument to get, post, etc. need to update the adapter to accept that form

Melissa Stone (Jira)

unread,
May 20, 2020, 6:49:03 PM5/20/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 21, 2020, 3:03:02 PM5/21/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages