Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #22088: make iterator report more independent #1375

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VinceMacBuche
Copy link
Member

No description provided.

#####
# Actual command - for actions, non using systemd
#####
pass2.is_check_action.!is_process_action.method_found.action_ok::
"${report_data.method_id}" usebundle => _classes_success("${class_prefix}");
"${report_data.method_id}" usebundle => _classes_success("${report_data.method_id}");
"${report_data.method_id}" usebundle => _classes_success("${report_data.report_id}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't allow making a difference in methods calling several other methods.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all will use the same prefix, method_id is there for a reason

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method_id and report_id were using the same value

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before https://github.com/Normation/ncf/pull/1375/files#diff-0bdc2ac14352d653dea5f8de09cff543e70c7ffa33e8b8e82a1388dab7c938c2L519:

"report_data.report_id"      string => canonify("${report_id}_${report_data.directive_id}");
"report_data.method_id"      string => canonify("${report_id}_${report_data.directive_id}");

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if you have the problem with report_id then you had the problem with method_id

Hence this pr makes method id even more specific (and i keep use it as promiser because of this) as it allow reexecution of things that were not reexecuted

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway i made this changed in 7.2 but i think it should be on master

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method_id is modified each time we enter a sub-method (by the push/pop mechanism), report_id stays the same. What is in _method_reporting_context_v4 is only the initialization.

@VinceMacBuche VinceMacBuche changed the title Fixes #22088: make iterator report more independant Fixes #22088: make iterator report more independent Nov 17, 2022
# Canonified version, to be used in policies (as class prefix)
# it needs the directive_id to enforce unicity
"report_data.report_id" string => canonify("${report_id}_${report_data.directive_id}");
"report_data.method_id" string => canonify("${report_id}_${report_data.directive_id}_${report_data.index}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change looks really complex.
we need to clearly define what is expected in report, method, and why index is necessary like (why not use something else like an auto generated id from the webapp)
there are many moving parts, in services, packages in 20_services, but also in system techniques.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added an id to track the iteration on a method

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced usage a method_id to report_id (they were the same value)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use report_id effectively in reports and method_id where we need to identify the method

@VinceMacBuche VinceMacBuche force-pushed the bug_22088/make_iterator_report_more_independant branch from f7d1898 to 5bfe728 Compare November 17, 2022 19:34
@VinceMacBuche VinceMacBuche changed the base branch from branches/rudder/7.2 to master November 24, 2022 13:41
@VinceMacBuche VinceMacBuche marked this pull request as draft July 5, 2023 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants