Age | Commit message (Collapse) | Author | Files | Lines |
|
Before this commit, the spec tests checked for symlink-ignore behavior on all
OSes. After this commit, the spec tests only check symlink-ignore
behavior on OSes that have symlinks.
|
|
Before this commit, pmtignore functionality worked, but only after
checking for symlinks, so it was impossible to ignore symlinks. This
commit allows symlinks to be ignored, too.
|
|
Adding spec tests to cover build when .pmtignore/.gitignore files are present/absent
|
|
PUP-2745 Forge malformed dependency fix
|
|
Prior to this commit build/unpack were trying to use the Ruby stdlib symlink to
deal with symlinks. This fails on platforms (Windows) that Puppet says supports
symlinks because it does not duck punch Ruby stdlib.
This commit switches the specs and code for build/unpack to use Puppet FS lib's
symlink functions. This should allow it to function correctly on Windows hosts that Puppet
supports symlinks.
|
|
Prior to this commit we would try to use symlinks in the tests on platforms that
do not support symlinking.
This commit uses the Puppet feature checker to conditionally try the tests if
Puppet thinks the platform supports symlinks (Unixes, Linuxes, Win 2k8+).
|
|
Adding spec tests to check for symlinks in build/install.
|
|
Prior to this commit there wasn't much verification for module dependencies.
This commit adds verification the module dependencies have sane names and version
ranges. If verification fails, it will raise an argument exception.
|
|
|
|
(PUP-2936) Fix checksum during PMT build (stable branch)
|
|
Prior to this commit `puppet module build` was checksumming the source directory
and putting that in checksums.json.
This commit corrects that behavior so it checksums the built module instead.
|
|
* upstream/stable:
(maint) Confine enc_provides_node_when_store_configs_enabled to debian
(PUP-2943) Update acceptance tests
(PUP-2943) Clean ignore-changes uninstall logic
(PUP-2943) Uninstall/upgrade ignore changes spec
(PUP-2943) Add PMT --ignore-changes
|
|
highb/fix/master/pup-2882_upgrade_broken_for_one_version
(PUP-2882) Fix single available upgrade
|
|
Adding more spec tests for the --ignore-changes flag on uninstall/upgrade
|
|
Maint/master/update rspec
|
|
Prior to this commit `puppet module upgrade` would fail with an error message
about not being able to satisfy the upgrade when there is only one published
release of the module.
This commit changes the error message to say that there is no version to upgrade
to. This should reduce some user confusion.
|
|
(PUP-1186) Ignore PAX header in tar unpacking
|
|
Given an object with an attr_accessor and using an example shortcut like so:
subject { metadata.to_hash }
its(:keys) do
subject.sort.should == %w[ name version author summary license source issues_url project_page dependencies ].sort
end
The value of subject in the example varies between RSpec 2.11 and 2.13.
This commit removes the shortcut in favor of a slightly longer but more
compatible test that explicitly invokes the #keys method and does an
expectation on that.
|
|
Prior to this commit if you installed a puppet module built on a platform with
a tar implementation that adds PAX headers and your platform didn't have a native
tar implementation (Windows), the module would contain junk PaxHeader directories.
This is due to the default POSIX behavior programmed in to minitar (the ruby tar
implementation used for platforms with out native tar) for an unknown typeflag,
such as those used in PAX headers, is to treat it as a regular file and extract it.
This commit adds a pre-scan step to our use of minitar for unpacking that finds
all the files with standard typeflags (0-7) and then only unpacks those, thus ignoring
any Pax typeflags like 'x' or 'g'.
|
|
Prior to this commit the module tool would fail to perform any actions if any
module found in the modulepath had an invalid semver.
This commit warns about invalid semvers in installed modules, sets the version to
0.0.0, and moves on. This allows the module tool to continue to work, even with the
invalid semver found in the path. This commit also adds some rudimentary tests
for the Puppet::ModuleTool::InstalledModules class.
|
|
Prior to Puppet 3.6.0, users had a ‘description’ property which they
could reliably expand into their module skeleton’s ERB templates. This
property was removed from the default set of properties in Puppet 3.6.0,
which effectively broke template expansion for users relying on it.
This change ensures that users can continue to rely on this property.
|
|
|
|
Prior to this change, we’d attempted to handle shell escaping of
arguments by passing arrays of arguments rather than a single full
command string. While this worked as intended, it meant that we needed
to stream data between processes through Ruby. As it happens, larger
tarballs would cause the write pipeline to become backed up, and since
we would attempt to write all the data before reading any, we would
effectively deadlock.
Rather than attempting to stream by chunks, we’ve reverted back to using
the full string commands, and managing shell escapes (where needed) in
Ruby.
|
|
The Gnu tar implementation executes `tar cf - #{sourcedir}`, which can be a
relative path. So it is not necessary to expand it, and doing so causes the
test to fail on windows.
|
|
Prior to this commit, the specs made assertions about absolute file
paths, which works perfectly until you try running the tests under
Windows. This change patches the tests so that they will continue to
run properly under both Windows and Linux.
|
|
pvande/bug/master/pup2278_fix_pmt_handling_of_paths_with_spaces
Accept paths with spaces in PMT tarball interactions.
|
|
pvande/task/master/pup2284_puppet_module_generate_interview
Add an interview to the PMT `generate` action.
|
|
Conflicts:
acceptance/tests/modules/changes/missing_metadata_json.rb
lib/puppet/module_tool/applications/application.rb
lib/puppet/module_tool/applications/builder.rb
lib/puppet/module_tool/applications/checksummer.rb
spec/unit/module_tool/applications/builder_spec.rb
|
|
In the previous commit, the default behavior of `execpipe` was changed
to ensure that the pipe was always opened in read/write mode. While we
aren't aware of any regressions this change would cause, the cautious
route is to maintain the same default behavior for now; to that end,
this commit adds a `mode` parameter to `execpipe`, allowing callers to
choose the mode the pipe is opened in.
|
|
Prior to this commit, validation would raise non-sensical validation
errors if you attempted to validate a module name that contained a
separator (either '-' or '/'), but less than one character on either
side. This change adds validation for those cases.
|
|
Before this change, the PMT Checksummer spec was using the in-built
'tmpfile' library directly. For conformance with the rest of the test
suite, it's been recommended that we should use PuppetSpec::Files for
that functionality (which this change implements).
|
|
Previously the code that validated module names took a pessimistic
approach, validating conformance only to assert unrelated non-conformance.
As it turns out, this is messy to read and understand, so this change
rewrites the logic in a more straightforward manner.
|
|
Prior to this commit, if the module_working_dir or the path to a module
being built contained whitespace, our simple string-interpolation
would fail to create a valid call to `tar` or `gzip`. This change fixes
the bugs resulting from that behavior.
|
|
Prior to this commit, there were a number of places where documentation
was missing and test names were insufficiently descriptive. This commit
adds additional clarity around those places, and makes a couple of code
clarity changes as well.
|
|
Prior to this commit, when you generated a new module, it created a simple
metadata.json file with the same standard defaults for every module. Since
JSON may not be the most familiar language for all of our users, we now do
some work up front to pre-fill that JSON file with useful data based on user
input.
|
|
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.
|
|
Prior to this commit, the Modulefile was used as the primary source of user-facing metadata for modules. This file was executable Ruby, which was intended to describe a simple data structure. This causes a few problems for us in the long-term, including making automated module builds a significantly more difficult proposition, and making changes to acceptable metadata a slow process (requiring new releases of Puppet). In addition, the only piece of Puppet code that interacted directly with the Module file was the `module build` action – anywhere we actually need to know something about the module, we look it up from the metadata.json file.
This commit removes this level of indirection between user input and module data, making the metadata.json file a first-class citizen in Puppet modules. It similarly deprecates the Modulefile as a supported source of module data. Checksums have also been moved into their own file (per PE-3124), and `puppet module changes` has been updated to leverage the new file when available (per PE-3120).
For users building a module containing only a Modulefile, this will issue a warning that the Modulefile is deprecated, and output the corresponding metadata.json file.
For users building a module containing both a Modulefile and a metadata.json file, this will issue a warning that the Modulefile is deprecated and is being ignored.
|
|
(PUP-1749) Fix module_tool extract for non-gnu tar
|
|
Changes to the way Puppet::ModuleTool::Tar::Gnu works means that the
*::Tar::Solaris variant should now be redundant. It existed to require
gtar when the underlying platform did not support GNU-tar options, but
the changes to the core Tar::Gnu class mean that we no longer use any
flags or options that don't work just fine with oldschool unix tar
executables. Remove Puppet::ModuleTool::Tar::Solaris.
On a side note, Tar::Gnu should probably be renamed to something more
generic.
|
|
* pr/2322:
(PUP-1563) Don't recurse when dependencies are empty
(PUP-1563) resolve_install_conflicts excessively recurses
Closes GH-2322
|
|
Previously we would recurse for each leaf dependency unnecessarily.
This commit ensures we only recurse if we have a non-empty set of
dependencies, and adds a debug message when conflicts are checked.
It also adds a spec tests to ensure we evaluate each module for
conflicts only once.
Paired-with: Josh Partlow <joshua.partlow@puppetlabs.com>
|
|
I'm not entirely sure if I'm using #yields() correctly but this allows
me to expect that Dir.chdir is called, and still expect all the calls to
Puppet::Util::Execution.execute to be made.
|
|
The module tool was relying on the implicit creation and caching of
legacy environments based on puppet settings for environment and
modulepath. But this does not work for the new directory style of
environments. So we are being explicit about using the current
environment from the context, and overriding modulepath to prepend a
target_dir if given, and then directly inserting the environment to be
used into the options rather than expecting the module_tool applications
to retrieve the correct environment from any other loaders.
Testing is now simpler, but because we are now comparing different but
equal environments, I added equality and hash to node/environment to
facilitate this.
This in turn broke tests, because of
Puppet::Node::Environment#known_resource_types which caches using the
global $known_resource_types. Previously this would always clear itself
when called if $known_resource_types.environment
!= self, but with the new node equality, state was now leaking between
tests. The test_helper now sets $known_resource_types nil after each
test.
|
|
The v2.0 api implementation had a type that was not caught by any tests.
This fixes that issue (a typo) and adds a test that would have shown the
problem.
|
|
This moves the global context handling out of the Puppet::Context class
and onto the Puppet module, which allows Puppet::Context to be a more
generic, overridable context system. It also allows references to
context information to be a little bit shorter.
This doesn't tackle making settings information available in the
context, and so there might be a little confusion between Puppet[] and
Puppet.lookup.
|
|
Environments are more than just a name, they are also a modulepath and a
manifest. This commit makes a "create" method for setting up
environments with specific modulepaths and manifests rather than relying
on the Puppet Settings at the time that methods are called. In order to
control environments for module installation they now take advantage of
this in order to control the modulepath that things will be installed
into.
|
|
After trying to get the manifest and modulepath during the
initialization for an environment, it turned out that a lot of other
things depended on a very specific load order. Some of those needed to
change around, others needed to delay executing until later, after
everything had been loaded and initialized (creation of the root
environment was one of these). The reset of the Parser::Functions also
moved so that it doesn't happen until settings have been initialized.
|
|
|
|
|
|
BSD tar doesn't support "--no-same-permissions --no-same-owner"
Tests and minor fixups by Adrien Thebo <adrien@puppetlabs.com>
|