Skip to content

CFE-4686: Document the classes promise cancel attribute#3683

Merged
nickanderson merged 2 commits into
cfengine:masterfrom
nickanderson:CFE-4686/classes-cancel-attribute
Jun 19, 2026
Merged

CFE-4686: Document the classes promise cancel attribute#3683
nickanderson merged 2 commits into
cfengine:masterfrom
nickanderson:CFE-4686/classes-cancel-attribute

Conversation

@nickanderson

Copy link
Copy Markdown
Member

Summary

Documents the new cancel attribute of classes promises (CFE-4686), which
undefines the promiser class when its class expression evaluates to true.

Adds a ### cancel reference section to
content/reference/promise-types/classes.markdown covering:

  • semantics (inverse of expression)
  • that it is evaluated even when the class is already defined (the whole point)
  • hard-class protection
  • mutual exclusion with the class-defining attributes
  • the convergence caveat (a later pass may redefine the class)

**History:** notes it as introduced in CFEngine 3.28.0 (not backported).

Companion

Core implementation PR: cfengine/core#6175

Ticket: https://northerntech.atlassian.net/browse/CFE-4686

Verification

  • prettier --check clean on the edited page.
  • No .markdown-extension inline links introduced.
  • Cross-references use auto-generated anchors ([classes#expression],
    [Promise types#cancel_kept]) consistent with the existing page.

🤖 Generated with Claude Code

@nickanderson

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins please

Added a reference section for the new 'cancel' attribute of classes
promises, which undefines the promiser class when its class expression
evaluates to true. Notes the evaluation-when-already-defined behaviour,
hard-class protection, and mutual exclusion with the class-defining
attributes.

Ticket: CFE-4686

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nickanderson

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins please

`and`, `or`, `not`, `xor`, `dist`, `select_class`) — combining them is an
`Irreconcilable constraints` error — and also with the class-modifier
attributes (`persistence`, `scope`, `timer_policy`), which only affect how a
class is defined and are rejected alongside `cancel`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

by "rejected" do you mean also causing an error to be logged?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, disallowed, mutually exclusive.

`and`, `or`, `not`, `xor`, `dist`, `select_class`) — combining them is an
`Irreconcilable constraints` error — and also with the class-modifier
attributes (`persistence`, `scope`, `timer_policy`), which only affect how a
class is defined and are rejected alongside `cancel`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe ... "which only affect how a class is defined and will cause an error as well when combined with cancel."

Address Craig's review on PR cfengine#3683.

Signed-off-by: Nick Anderson <nick@cmdln.org>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nickanderson nickanderson merged commit 9af8d68 into cfengine:master Jun 19, 2026
2 checks passed
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