Skip to content

Ticket/2.7.x/12256 module tool core changes#504

Merged
slippycheeze merged 4 commits intopuppetlabs:2.7.xfrom
mmrobins:ticket/2.7.x/12256-module_tool_core_changes
Feb 15, 2012
Merged

Ticket/2.7.x/12256 module tool core changes#504
slippycheeze merged 4 commits intopuppetlabs:2.7.xfrom
mmrobins:ticket/2.7.x/12256-module_tool_core_changes

Conversation

@mmrobins
Copy link
Copy Markdown
Contributor

These are the changes the puppet module tool will need that potentially affect other parts of Puppet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is open to a false positive if the JSON file contains an array, or a simple string, at the top level. That would be an easy mistake for a user to make if they use some tool other than ours to handle the file format. Should this be more robust?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably in the future, but that's not the change we need now to make things work.

@mmrobins
Copy link
Copy Markdown
Contributor Author

Daniel, added unless method_defined? :intersection to the monkey patch method. Based on our in person conversation, that should address your concerns that are addressable at this point. Thanks.

Matt Robinson and others added 4 commits February 15, 2012 13:02
Having range intersection allows easier checking of version constraints,
and new comparson operators allow for ranged version constraints like
you would expect from a typical packaging system (ex 1.2.x).

There is also a slight change to the way prerelease version numbers are
validated so that a dash is required between the patch version and
prerelease string.  This was done to comply with the declared semver
spec:

    A pre-release version number MAY be denoted by appending an arbitrary
    string immediately following the patch version and a dash

This could affect forge module versions, or face versions, but neither
of these were found to be using prerelease versioning anyway.

Pieter van de Bruggen was the original author of these changes, but I'm
submitting them as part a larger rebase for module tool change.  I've
also reviewed the changes.
Being able to figure out what other modules depend on a module is useful
for resolving contraints when installing and preventing uninstalls of
modules that are still required.  And being able to tell if a module has
local changes is useful to prevent accidentally losing those changes
when upgrading or uninstalling a module.
Before this patch module requirements do not include version numbers.
Since modules with the same name, but different version numbers, can be
installed at the same time -- in different parts of the modulepath,
there is no way to tell which module has the dependency.

This patch fixes this issue by changing the data structure that
represents module requirements from a two item Array to a Hash with
three keys: name, version, and version_requirement.

This patch includes updated spec tests related to this change.
In Ruby 1.9 Range's implementation of include? changed so that if the
objects being compared were non-numeric it would iterate over them
instead of doing a comparison with the endpoints.  We're subclassing
numeric to force non-discrete range behavior.

Numeric doesn't allow singleton methods to be defined, so we had to
change the way inspect worked when dealing with MIN and MAX values.

Paired-with: Pieter van de Bruggen <pieter@puppetlabs.com>
slippycheeze added a commit that referenced this pull request Feb 15, 2012
…core_changes

Ticket/2.7.x/12256 module tool core changes
@slippycheeze slippycheeze merged commit bd4b6cf into puppetlabs:2.7.x Feb 15, 2012
melissa pushed a commit to melissa/puppet that referenced this pull request Mar 30, 2018
(PCP-625) Skip beaker time sync on Windows Sever 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants