| Age | Commit message (Collapse) | Author | Files | Lines |
|
Previously PMT was checking for integer status codes when downloading
modules. This results in all module downloads failing. After this PMT
will check for string status codes when downloading modules.
|
|
Before this PMT would not check if the module download request
succeeded before trying install the module. This causes informative
errors from forge to be hidden by an error about the checksum of the
download not matching. After this PMT will only move forward with module
installation if a 200 is received from forge otherwise it will display
the error returned by forge.
|
|
Prior to this commit a malformed name in the dependencies for a downloaded forge
module dependency would cause the PMT to fail unexpectedly.
This commit causes the PMT to ignore malformed dependencies.
|
|
Before this PMT only supported basic authentication which the Puppet Forge
does not. This adds the ability to configure other authentication
methods and request that forge include extra module groups in responses.
|
|
Without this patch it is not possible to use the Puppet Module
Tool (PMT) with an authenticated proxy.
Many enterprises utilise the services of authenticated proxies for
Internet access. Current code is able to utilise a proxy, but does
not consider credentials for authenticated proxies.
This patch uses the credentials from either the environment settings
for HTTP_PROXY or http_proxy, or the corresponding values in the
puppet.conf file. The patch allows for http_proxy_user and
http_proxy_password to supplement the current http_proxy_host and
http_proxy_port variables within the puppet.conf.
|
|
Prior to this commit, the PMT managed all communication with the Forge via the
(now legacy) /v1 API. That API has been deprecated (primarily due to scalability
concerns), which is less of an issue since it was never officially a public API.
This commit migrates all communication to the Forge to the new /v3 API, which is
expected to be launched as our official public API "soon". This commit also
integrates a standalone dependency resolver, as the /v3 API contains no implicit
dependency resolution (as the /v1 API did); consequently, large portions of the
PMT code have been changed, and others have become unreachable.
This commit also changes the default host that the PMT communicates with, from
https://forge.puppetlabs.com to https://forgeapi.puppetlabs.com (the natural
URL for the Forge API service). Since the tool now expects to communicate with
a completely different service, it will be unable to communicate with services
that do not implement the same /v3 API.
|
|
This changes it so that the puppet/forge file handles pulling in all of
the forge related code and thereby sidesteps all sorts of load order
issues.
|
|
The module tool ignored the path part of the URI when specifying a
custom module_repository setting.
Example:
puppet module install foo-bar --module_repository=‘http://forge.example.com/forge’
fetched http://forge.example.com/api/v1/releases.json?module=foo/bar
instead of
http://forge.example.com/forge/api/v1/releases.json?module=foo/bar
Same issue when it tries to fetch the file itself.
|
|
In 3.x, the pkgdmg provider no longer honors http_proxy_host or http_proxy_port
settings or environment variables. This takes the methods to do this from
puppet/forge/repository and puts them in puppet/util/http_proxy, and updates
repository.rb and pkgdmg.rb to use it.
|
|
When a bad HTTP response indicating an error, or an "error" string in the
response is received from the forge, raise Puppet::Forge::Errors::ForgeError
subclases rather than RuntimeErrors.
This allows the error to be caught by the module face and the error rendered
appropriately, i.e. as JSON if requested by the user. Else fallback code for
unhandled exceptions is used, causing the exception to only be written via
logging.
|
|
The additional hyphen between "p" and the patch number is now handled.
|
|
|
|
When passing a requirement string with an unescaped URI character,
such as '>= 1.0.3' to puppet module install, an error would be raised.
Added URI escape to make_http_request to ensure all URIs are properly
escaped.
|
|
Previously we were seeing errors being returned in the acceptance framework,
when the puppet module face had problems but the existing error message is far
too generic to be used to understand the root cause of such problems.
This patch changes the read_response code and CommunicationsError exceptions so
that the underlying comms error message is exposed to the client. The generic
message has been kept, but a new line 'Details:' has been added that will
expose the underlying error.
This patch solves this problem by accepting the original exception that was
called, and using the message of that exception to describe the detail.
To make sure the generic error will catch and wrap the correct exceptions, we
have added a list of what we believe are the common exceptions that Net::HTTP
raises when remote or network problems occur. Other exceptions will continue to
be raised up to the face as per normal.
Test coverage has been added to make sure the exceptions behave as expected, as
this was lacking beforehand.
|
|
Many tests set stubs or expectations on configuration values. This is
unnecessary, as settings are reset before each test. Because creating a stub
stubs out the entire value method on settings, stubbing any individual setting
interferes with retrieving any other setting. This makes for weird errors and
fragile tests. This commit changes most cases to just set each setting
directly.
Expectations on settings were often used to verify that a setting is used.
This is not a good way of testing this, since it checks that the value is
accessed but not that it is actually used correctly. Most expecations on
settings are better expressed by changing the setting and then verifying a
returned value.
|
|
This patch turn on SSL support when an HTTPS url is provided, and also changes
the default URL to https://forge.puppetlabs.com so that now all interaction is
done via SSL.
As not all Ruby setups on weird operating systems are proven to work, effort
was spent in making sure validation errors are captured and returned as a
meaningful error to the user. This was also captured as a simple acceptance
test by testing against a self-signed certificate (in our case, a puppet
master).
The forge error handling in Puppet::Forge::Repository was changed to return
a new set of exceptions specific to the Puppet::Forge API set, so they can
be captured by consumers and displayed. This also helps a lot with test mocking
and tests have been changed accordingly.
To reflect the new error handling in Puppet::Forge::Repository the search face
was changed to capture exceptions and hand them off to the rendering parts as
data in a hash, to mimic how the rest of the puppet/face/module components
work.
All the existing acceptance tests were changed to now test against SSL, and
existing unit tests were also changed to reflect changes herein. New tests were
added for Puppet::ModuleTool::Applications::Searcher as previously this had no
coverage.
|
|
The RUBY_PATCHLEVEL constant is not available on ruby 1.8.5. To fix this
the pathlevel section will default to nothing if the RUBY_PATCHLEVEL is not
available.
|
|
The User-Agent will provide the server with some information
about the version of the module tool, the version of puppet, and the
version of ruby that is being used.
This commit also ensures that Puppet::Forge does not depend on the
Puppet::Face code. In order to achieve that the module face now is
responsible for creating the correct Puppet::Forge object and handing
that to the various components of the face for execution.
The Puppet::Face now provides an interface for interacting with the
repository in ways that various users were doing by asking for the
repository directly.
|
|
Removed some unreachable code that occured after an exception being
thrown. Pushed the construction of the Net::HTTP::Get object into the
repository so that it doesn't leak as much of its implementation out to
its clients.
Refactored the tests so that they include as many nested
contexts and pulled out helper methods to make the tests be more
explanatory.
|
|
This rather large commit includes all the work needed to get the `puppet
module` face in Puppet with all it's actions. I tried to break this up
into smaller commits, but it was difficult to do so and keep the
individual commits in a state that had passing specs since many changes
in shared module_tool code affected multiple actions. This code was
developed in an integration branch over a few montsh and is now being
merged back into Puppet core in the same state that shipped with Puppet
Enterprise 2.5.
The work here was done by Pieter van de Bruggen <pieter@puppetlabs.com>,
Kelsey Hightower <kelsey@puppetlabs.com> and myself.
|
|
Before this patch each module application makes direct connection to the
Puppet Forge. This is a maintenance nightmare, any changes to the
Forge API requires changes to all the module applications.
This patch re-factors how we communicate with the Forge. All module
application now use the interface exposed by the `lib/puppet/forge.rb`
module.
This patch also includes tests for the new forge.rb module, and updates
others to reflect the new behaviour.
|