| Age | Commit message (Collapse) | Author | Files | Lines |
|
This also includes some minor refactoring of the contain function.
|
|
Prefer the current American spelling from the past 30 years.
|
|
This commit adds the ability to pass a cancelled resource handler callback
to the traverse method such that if the traversal is cancelled, then the
callback is invoked once for each resource that is ready, but not yet
evaluated.
In addition, the resource is "finished", which unblocks its dependents, so
that the callback can handle those as well.
While writing tests for this, we found a bug in the main while loop.
Previously, the loop was removing the next ready resource, and then checking
if the loop had been cancelled. But if the loop was ever cancelled, the removed
resource was effectively lost. This commit reverses the order so that we only
remove the next ready resource if we intend to evaluate it.
Paired-with: Patrick Carlisle <patrick@puppetlabs.com>
|
|
This creates an old prioritizer for resources as it existed in commit
f51e967b73ff0154801f514aff40ca524bdd8ab1.
|
|
Previously the code for generating priorities was scattered throughout
the places that needed to add vertices to the relationship graph. This
pulls out that logic into a class that can generate the priorities for
resources, and those contained in other resources. This is needed to be
able to make this strategy pluggable.
|
|
We often talk about "the graph", but until now there hasn't been a clear
graph that we were talking about. The relationship graph that is used
for evaluation is the best candidate to fill this role, since it
contains all of the ordering information that is needed.
This also removes Puppet::Util::Graph, which was unused.
|
|
The underlying red-black tree that is used as the priority queue for
tracking what resources to evaluate will only allow a single value per
key. This means that when generated resources are added they need to get
unique priority keys. However there could be an arbitrary number of
these resources added in between existing resources. This commit
provides a Puppet::Graph::Key that behaves like the numbering scheme of
an outline so that priorities can be arbitrarily nested and the nested
priorities are between the priorities at the outer level.
The integration tests for the file type caught this error. It only
showed up when 2 unique, new resources are generated.
|