Skip to content

Conversation

@nickanderson
Copy link
Member

Ticket: ENT-13495

This change exposes variables for configuring evaluation_order in body common
control of the main policy (promises.cf) and in body agent control of both the
main and update policies (promises.cf, update.cf).

Ticket: ENT-13495
Changelog: Title
…control

It doesn't work in the way that other control variables work.
@nickanderson
Copy link
Member Author

Note, I initially implemented this for both common control and agent control, but in my testing overriding the variable via def.json would not result in a change in value for common control. However, it did work for body agent control.

Comment on lines +193 to +195
# The order in which promises are evaluated (top_down|classic)
evaluation_order => "$(default:def.control_agent_update_evaluation_order)";

Copy link
Member

Choose a reason for hiding this comment

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

@nickanderson you'll need to guard this with a minimum version macro.

Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

needs some work but basically good!


### Configure the evaluation order for cf-agent evaluated promises for update policy

By default CFEngine processes promises in "Normal Order". Configure `default:def.control_agent_evaluation_order` to control the default promise evaluation order for `cf-agent` during the execution of the update policy. This variable is used to set `evaluation_order` in `body agent control` in `update.cf`
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe include link to Normal Order around that phrase.

Why is this augment named without any reference to update policy?

Copy link
Contributor

Choose a reason for hiding this comment

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

In this update section you should be talking about control_agent_update_evaluation_order and not control_agent_evaluation_order as you have done right? I noticed this difference as I looked at the actual policy below.

MPF.md Outdated

- Introduced in 3.27.0.

**See also:** [Configure the evaluation order of cf-agent for main policy](#Configure the evaluation order of cf-agent for main policy), [Configure the evaluation order of cf-agent for main policy](#Configure the evaluation order of cf-agent for main policy), [`evaluation_order` in `body agent control`][cf-agent#evaluation_order], [Policy style guide on promise ordering][Policy style guide#Promise ordering]
Copy link
Contributor

Choose a reason for hiding this comment

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

you repeat "main policy" twice. I think you meant to mention "main" and then "update", two separate things.

MPF.md Outdated

- Introduced in 3.27.0.

**See also:** [Configure the evaluation order of all components for main policy](#Configure the evaluation order of all components for main policy), [Configure cf-agent promise evaluation order for update policy](#Configure the evaluation order for cf-agent evaluated promises for update policy), [`evaluation_order` in `body common control`][Components#evaluation_order], [Policy style guide on promise ordering][Policy style guide#Promise ordering]
Copy link
Contributor

Choose a reason for hiding this comment

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

here this looks OK where you mention main policy and update policy

# the promise was verified before it is checked again.

ifelapsed => "1";
ifelapsed => "1";
Copy link
Contributor

Choose a reason for hiding this comment

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

why the whitespace change? comments two-spaces indent, then attribute 2 from that?

any::

# The order in which promises are evaluated (top_down|classic)
evaluation_order => "$(default:def.control_agent_evaluation_order)";
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this evaluation_order interact with those in update.cf and promises.cf? It would seem you need to document that behavior from a binary point of view. I see that if you set all three augments, the update/main augments would be evaluated first as they are in the entry-points. After that, the agent evaluation order would be evaluated as the controls policy was read in via inputs attributes in body common control in update.cf and promises.cf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants