Project

General

Profile

Actions

Architecture #15783

closed

User story #6099: We should be able to call actions as many times as we want

Make class_prefix unique

Architecture #15783: Make class_prefix unique

Added by Félix DALLIDET about 6 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
N/A
Category:
Generic methods
Target version:
Effort required:
Medium
Name check:
To do
Fix check:
To do
Regression:

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");


Subtasks 2 (0 open2 closed)

User story #15784: Base log on the directive id and add a canonified directive id in report_dataReleasedNicolas CHARLESActions
Bug #16078: Applying directives using the exact same GM with same parameters will always result in missing reportsResolvedAlexis MoussetActions

Updated by Félix DALLIDET about 6 years ago Actions #1

  • Status changed from New to In progress
  • Assignee set to Félix DALLIDET

Updated by Félix DALLIDET about 6 years ago Actions #2

  • 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 6 years ago Actions #3

  • Pull Request deleted (https://github.com/Normation/ncf/pull/1068)

Updated by Félix DALLIDET about 6 years ago Actions #4

  • Pull Request set to https://github.com/Normation/ncf/pull/1070

Updated by Félix DALLIDET about 6 years ago Actions #5

  • Pull Request changed from https://github.com/Normation/ncf/pull/1070 to https://github.com/Normation/ncf/pull/1071

Updated by Vincent MEMBRÉ about 6 years ago Actions #6

  • 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 6 years ago Actions #8

  • Target version changed from 5.0.14 to 5.0.15

Updated by Vincent MEMBRÉ about 6 years ago Actions #10

  • Target version changed from 5.0.15 to 5.0.16

Updated by Alexis Mousset almost 6 years ago Actions #11

  • Target version changed from 5.0.16 to 5.0.17

Updated by Vincent MEMBRÉ over 5 years ago Actions #12

  • Target version changed from 5.0.17 to 5.0.18

Updated by Vincent MEMBRÉ over 5 years ago Actions #13

  • Target version changed from 5.0.18 to 5.0.19

Updated by Vincent MEMBRÉ over 5 years ago Actions #14

  • Status changed from Pending technical review to New

Updated by Vincent MEMBRÉ over 5 years ago Actions #15

  • Target version changed from 5.0.19 to 5.0.20

Updated by Vincent MEMBRÉ about 5 years ago Actions #16

  • Target version changed from 5.0.20 to 797

Updated by Benoît PECCATTE over 4 years ago Actions #17

  • Target version changed from 797 to 6.1.14

Updated by Vincent MEMBRÉ over 4 years ago Actions #18

  • Target version changed from 6.1.14 to 6.1.15

Updated by Vincent MEMBRÉ over 4 years ago Actions #19

  • Target version changed from 6.1.15 to 6.1.16

Updated by Vincent MEMBRÉ over 4 years ago Actions #20

  • Target version changed from 6.1.16 to 6.1.17

Updated by Vincent MEMBRÉ about 4 years ago Actions #21

  • Target version changed from 6.1.17 to 6.1.18

Updated by Vincent MEMBRÉ about 4 years ago Actions #22

  • Target version changed from 6.1.18 to 6.1.19

Updated by Alexis Mousset over 3 years ago Actions #23

  • Status changed from New to Resolved

Solved through report_id instead of promiser stack.

Actions

Also available in: PDF Atom