(#12269) multiple cycles in graph fail on sort#425
Merged
grimradical merged 6 commits intopuppetlabs:2.7.xfrom Feb 1, 2012
slippycheeze:bug/2.7.x/12269-multiple-cycles-in-graph-fail-on-sort
Merged
(#12269) multiple cycles in graph fail on sort#425grimradical merged 6 commits intopuppetlabs:2.7.xfrom slippycheeze:bug/2.7.x/12269-multiple-cycles-in-graph-fail-on-sort
grimradical merged 6 commits intopuppetlabs:2.7.xfrom
slippycheeze:bug/2.7.x/12269-multiple-cycles-in-graph-fail-on-sort
Conversation
added 6 commits
January 29, 2012 15:20
We have found a couple of places where the behaviour of the items tested, and the behaviour of the real system, differ - because the tests were run over simpler objects than the real Puppet::Type instances we work on in the field. This moves from testing on fake things to testing on the real deal, which gives us a much more solid basis to trust the tests. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Type instances have a reasonable natural order, which allows us to make them Comparable. This, in turn, makes any interaction where ordering is of interest easier to deal with. This implementation uses the string form of the resource as the basis for comparison, which is a reasonable starting point from existing definitions of ordering over resource instances. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
This eliminates the proxy sorting in the graph library, which was working around the fact that Puppet::Type was not able to be ordered out of the box. That makes the whole process significantly more robust. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Like types, our providers have a natural internal order. Exposing that allows us to eliminate proxy sorting everywhere that it is done, and have more uniform treatment of our types. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
The module tool used to generate and sort by a proxy key for providers, when detailing their content. Instead, this can use the natural ordering of providers previously introduced. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
This adds a simple acceptance test that validates we detect and report cycles in a catalog as we compile and try to execute it. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
grimradical
added a commit
that referenced
this pull request
Feb 1, 2012
…cycles-in-graph-fail-on-sort (#12269) multiple cycles in graph fail on sort
melissa
pushed a commit
to melissa/puppet
that referenced
this pull request
Mar 30, 2018
(maint) Remove unused include from pxp_schemas.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes up code that handled the randomized hash ordering in Ruby 1.8.7 after a CVE fix:
At the time I felt it was safer to avoid changes to core classes, and instead to use an externally generated key for sorting. This turned out not to be the case - as so often the "safe" choice turns out t be worse that the "right" fix would have been.
This redresses that by extending the core
Puppet::TypeandPuppet::Providerclasses to support ordering (against other instances of the same class, or subclasses), and then uses that everywhere that we need to express a natural ordering over sets of the same type.It also adds an acceptance test, moves away from fake input data to tests, and generally improves our chances of detecting a similar problem next time through.