Skip to content

Made evaluation_order in body common control configurable via Augments#3192

Open
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:ENT-13495-common/master
Open

Made evaluation_order in body common control configurable via Augments#3192
nickanderson wants to merge 1 commit into
cfengine:masterfrom
nickanderson:ENT-13495-common/master

Conversation

@nickanderson

@nickanderson nickanderson commented Jul 13, 2026

Copy link
Copy Markdown
Member

What

Makes evaluation_order in body common control of the main policy
(promises.cf) configurable via augments through
default:def.control_common_evaluation_order. This sets the default promise
evaluation order for all components (cf-agent, cf-serverd, cf-execd,
cf-monitord).

This is a follow-up to #3068 / #3077 (which made body agent control
configurable). The control_common_evaluation_order variable was already
present in controls/def.cf but was not wired into any control body.

Why it wasn't a one-line change

cf-agent gives body agent control priority over body common control when
deciding evaluation order (core EvalContextIsClassicOrder). Because the MPF
previously set evaluation_order in body agent control unconditionally
(defaulting to classic), that default masked any value coming from
body common control for cf-agent.

To make control_common_evaluation_order a meaningful "change it everywhere"
setting, body agent control now sets evaluation_order only when
default:def.control_agent_evaluation_order is explicitly configured (to a
valid value) via augments. When it is not set, cf-agent inherits the order
from body common control.

Resulting behavior

control_common_evaluation_order control_agent_evaluation_order cf-agent serverd/execd/monitord
(unset) (unset) classic classic
top_down (unset) top_down (inherited) top_down
(unset) top_down top_down classic
classic top_down top_down classic
top_down classic classic top_down

A specific file can still override both via evaluation_order in
body file control.

Changes

  • promises.cf.inbody common control sets evaluation_order from
    default:def.control_common_evaluation_order (guarded by
    minimum_version(3.27.0)).
  • controls/cf_agent.cfevaluation_order in body agent control is now
    class-gated behind control_agent_evaluation_order_configured.
  • controls/def.cfcontrol_agent_evaluation_order now defaults to empty and
    a control_agent_evaluation_order_configured class detects a valid, explicitly
    configured value (mirrors the existing control_agent_agentfacility_configured
    idiom).
  • MPF.md — documents control_common_evaluation_order, notes that cf-agent
    inherits it, and fixes a typo (control_agent_evalution_order).

Testing

Adds two acceptance tests under tests/acceptance/00_basics/def.json/:

  • control_common_evaluation_order.cf — sets only the common augment and
    asserts cf-agent inherits top_down.
  • control_agent_evaluation_order.cf — sets only the agent augment and asserts
    the cf-agent override applies.

Both use a report-order discriminator run against the built promises.cf and
pass locally, along with the existing control_common_bundlesequence_end.cf.

Scope

Limited to the main policy (promises.cf). The update policy (update.cf)
already exposes control_agent_update_evaluation_order from #3077 and is left
as-is; extending body common control there can be a follow-up.

Ticket: ENT-13495

@nickanderson nickanderson force-pushed the ENT-13495-common/master branch 2 times, most recently from 3deddeb to bf19577 Compare July 13, 2026 19:25
This exposes evaluation_order in body common control of the main policy
(promises.cf) via default:def.control_common_evaluation_order, which sets the
default promise evaluation order for all components (cf-agent, cf-serverd,
cf-execd, cf-monitord).

body agent control now only sets evaluation_order for cf-agent when it is
explicitly configured via augments, so cf-agent inherits the evaluation order
from body common control unless overridden. This keeps the existing
default:def.control_agent_evaluation_order override working while letting
body common control act as the base default.

Acceptance tests exercise both the common control default (inherited by
cf-agent) and the cf-agent specific override against the built promises.cf.

Ticket: ENT-13495
Changelog: Title
@nickanderson nickanderson force-pushed the ENT-13495-common/master branch from bf19577 to b9e48b6 Compare July 13, 2026 21:15
@nickanderson

Copy link
Copy Markdown
Member Author

The failure here seems to be the result of installing the ubuntu 26 package on ubuntu 22?

Preparing to unpack .../cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu26_amd64.deb ...
ERROR: this package was built on ubuntu 26, and this seems to be ubuntu 22.
This combination is not compatible. To override this check, export non-empty IGNORE_VERSION_CHECK variable.
dpkg: error processing archive /home/runner/.cache/cfengine/cf-remote/packages/cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu26_amd64.deb (--install):
 new cfengine-nova package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /home/runner/.cache/cfengine/cf-remote/packages/cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu26_amd64.deb

Interesting, cf-remote --version master list ubuntu does show results for ubuntu22 agent package, but only for arm.

cf-remote --version master list ubuntu
Available releases: master, 3.28.0, 3.27.x, 3.27.1, 3.27.0, 3.24.x, 3.24.4, 3.24.3, 3.24.2, 3.24.1, 3.24.0
Using master:
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_HUB_x86_64_linux_ubuntu_22/cfengine-nova-hub_3.29.0a.f33c0eccb~2194.ubuntu22_amd64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_HUB_arm_64_linux_ubuntu_22/cfengine-nova-hub_3.29.0a.f33c0eccb~2207.ubuntu22_arm64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_HUB_arm_64_linux_ubuntu_24/cfengine-nova-hub_3.29.0a.f33c0eccb~2207.ubuntu24_arm64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_HUB_x86_64_linux_ubuntu_26/cfengine-nova-hub_3.29.0a.f33c0eccb~2207.ubuntu26_amd64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_HUB_arm_64_linux_ubuntu_26/cfengine-nova-hub_3.29.0a.f33c0eccb~2207.ubuntu26_arm64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_x86_64_linux_ubuntu_20/cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu20_amd64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_arm_64_linux_ubuntu_22/cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu22_arm64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_arm_64_linux_ubuntu_24/cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu24_arm64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_arm_64_linux_ubuntu_26/cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu26_arm64.deb
http://buildcache.cfengine.com/packages/testing-pr/jenkins-master-nightly-pipeline-421/PACKAGES_x86_64_linux_ubuntu_26/cfengine-nova_3.29.0a.f33c0eccb~2207.ubuntu26_amd64.deb

@nickanderson nickanderson requested a review from olehermanse July 13, 2026 21:30
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.

1 participant