User story #2881
Allow user to choose order of Directive application in a Rule
As reported by Michael Gliwinski (http://www.rudder-project.org/pipermail/rudder-users/2012-September/000094.html), sometimes, we would like to be able to specify the order of application of Directive in a Rule, because it does matter, even when convergence is taken into account 
So, we would like to be able to specify directive order in a rules.
More preciselly, that means being able to specify promise order in the bundlesequence.
Today, that's IMPOSSIBLE2.
A cool and clean solution would be to have a new Rule configuration screen, with one tab for each directive, and the tab order will give the directive orders.
, ok, actually if it matters, it must be that in some way, we don't converge, or that we forget some convergence cases. But sometimes, it is WAY easier to convergence to a given goal starting from some point than from other, and being able to specify order would allow that.
 because we "merge" directives from the same Technique in only one promise for a given node, for historical reason2, so that:
- given Technique A and B,
- directive A1 and A2 from A, B1 and B2 from B,
- rules R1 having A1 and B1, and R2 having A2 and B2, applied (in fine) to the same node N,
- then the generated bundlesequence for N looks like: bundlesequence(...some promise, A(1+2), ..., B(1+2), ...)
So that we just can't have R1 defining order A1 then B1 and R2 defining order B2 then A2. See #2880 for more details.
Updated by François ARMAND over 5 years ago
- Status changed from New to In progress
- Assignee set to François ARMAND
- Priority changed from N/A to 1
- Target version changed from Ideas (not version specific) to 3.1.1
We could have a partial solution that works "most of the time". It would be an enormous advantage, at least for Technique Editor techniques built to deploy things.
So, the solution runs as follow:
- Use the name of the directive as order (so that nothing as to be added on existing directive to be able to sort them),
- system techniques are already sorted first, let it like that,
- sort at best: sort rules and directive (we have a total order here, since name must be differents), and the, sort technique based on the resulting order of directive, non adding duplicates. So a techniques is inserted the first a directive basde on it is encountered.
That mean that some order won't be met, for example:
01. Rule 1
- 01. Directive 1 (Technique 1)
- 02. Directive 2 (Technique 2)
02. Rule 2
- Directive 3 (Technique 3)
03. Rule 3
- 01. Directive 2 (Technique 2)
- 02. Directive 1 (Technique 1)
Resulting order => Technique 1, Technique 2, Technique 3
But things being convergent, that should be ok. There are just now converging MUCH FASTER.