Architecture #15783
closedUser story #6099: We should be able to call actions as many times as we want
Make class_prefix unique
Description
With the technique editor, the big idea is to define techniques that can be decline in multiple directives.
One of the problem is: if we have the same call made to a generic method, it will most likely be ignored at execution time by cfengine. Leading to broken reporting and
no easy way to properly what was executed on the system.
Since in Rudder, one directive is ALWAYS bond to only one technique, we could use the directive_id as key differentiator between each policy applied.
Which means that every call to a rudder logger or pure cfengine promise should be followed by a comment based on the directive id.
See:
commands: "${command}" contain => in_shell, classes => classes_generic_return_code_list_two("${old_class_prefix}", "${class_prefix}", @{kept_list}, @{repaired_list}), comment => "${report_data.directive_id}";
And
usebundle => _log_v3("Execute the command ${command}", "${command}", "${old_class_prefix}", "${class_prefix}", @{args}), comment => "${report_data.directive_id}";
This way every directive will be forced to execute its promises and reports on it, even if the exact same one was already evaluated sooner in the process.
But every exact same call will produce classes based on the same element which make reporting undoable. To avoid this we should also base the resulting classes
of each GM on the directive id .
Where:
"old_class_prefix" string => canonify("command_execution_result_${command}"); "args" slist => { "${command}", "${kept_codes}", "${repaired_codes}" }; "report_param" string => join("_", args); "full_class_prefix" string => canonify("command_execution_result_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000");
will become:
"old_class_prefix" string => canonify("${report_data.canonified_directive_id}_command_execution_result_${command}"); "args" slist => { "${command}", "${kept_codes}", "${repaired_codes}" }; "report_param" string => join("_", args); "full_class_prefix" string => canonify("${report_data.canonified_directive_id}_command_execution_result_${report_param}"); "class_prefix" string => string_head("${full_class_prefix}", "1000");
Updated by Félix DALLIDET about 5 years ago
- Status changed from New to In progress
- Assignee set to Félix DALLIDET
Updated by Félix DALLIDET about 5 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Félix DALLIDET to Nicolas CHARLES
- Pull Request set to https://github.com/Normation/ncf/pull/1068
Updated by Félix DALLIDET about 5 years ago
- Pull Request deleted (
https://github.com/Normation/ncf/pull/1068)
Updated by Félix DALLIDET about 5 years ago
- Pull Request set to https://github.com/Normation/ncf/pull/1070
Updated by Félix DALLIDET about 5 years ago
- Pull Request changed from https://github.com/Normation/ncf/pull/1070 to https://github.com/Normation/ncf/pull/1071
Updated by Vincent MEMBRÉ about 5 years ago
- Tracker changed from User story to Architecture
- Suggestion strength deleted (
Require - I need this to use Rudder as I intend) - User visibility deleted (
Infrequent - complex configurations | third party integrations)
Updated by Vincent MEMBRÉ about 5 years ago
- Target version changed from 5.0.14 to 5.0.15
Updated by Vincent MEMBRÉ about 5 years ago
- Target version changed from 5.0.15 to 5.0.16
Updated by Alexis Mousset almost 5 years ago
- Target version changed from 5.0.16 to 5.0.17
Updated by Vincent MEMBRÉ over 4 years ago
- Target version changed from 5.0.17 to 5.0.18
Updated by Vincent MEMBRÉ over 4 years ago
- Target version changed from 5.0.18 to 5.0.19
Updated by Vincent MEMBRÉ over 4 years ago
- Status changed from Pending technical review to New
Updated by Vincent MEMBRÉ over 4 years ago
- Target version changed from 5.0.19 to 5.0.20
Updated by Vincent MEMBRÉ about 4 years ago
- Target version changed from 5.0.20 to 797
Updated by Benoît PECCATTE over 3 years ago
- Target version changed from 797 to 6.1.14
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.1.14 to 6.1.15
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.1.15 to 6.1.16
Updated by Vincent MEMBRÉ over 3 years ago
- Target version changed from 6.1.16 to 6.1.17
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 6.1.17 to 6.1.18
Updated by Vincent MEMBRÉ about 3 years ago
- Target version changed from 6.1.18 to 6.1.19
Updated by Alexis Mousset over 2 years ago
- Status changed from New to Resolved
Solved through report_id instead of promiser stack.