Skip to content

CFE-4681: document timer_policy attribute on classes: promises#3682

Merged
nickanderson merged 2 commits into
cfengine:masterfrom
nickanderson:CFE-4681/master
Jul 8, 2026
Merged

CFE-4681: document timer_policy attribute on classes: promises#3682
nickanderson merged 2 commits into
cfengine:masterfrom
nickanderson:CFE-4681/master

Conversation

@nickanderson

@nickanderson nickanderson commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Documents the new timer_policy attribute on classes: promises in the promise-type reference (CFE-4681).

timer_policy controls whether a persistent class restarts its timer when rediscovered:

  • reset — re-evaluates the promise and restarts the timer, so the class keeps persisting while the policy runs and the expression stays true.
  • absolute — preserves the original expiry; the promise is skipped while the class is already defined.

This brings the classes: promise type to parity with the classes body, which has long had a timer_policy attribute.

Version-specific default

The new section documents the default as reset (master → 3.28.0) and a History note records that the attribute is also available on 3.24.5 and 3.27.2, where the default is absolute (preserving the historical behavior).

Notes

  • Added under ### timer_policy in content/reference/promise-types/classes.markdown, right after ### persistence.
  • Cross-references use the auto-generated heading anchors ([classes#persistence], [Promise types#timer_policy], [Promise types#persist_time]); no _references.md change needed.
  • prettier --check passes; no inline .markdown links introduced.

Related

Once this looks right on master, it should be cherry-picked to the 3.24 and 3.27 doc branches with the Default value and the History note adjusted to absolute for those streams.

Merge with cfengine/core#6174

@nickanderson nickanderson force-pushed the CFE-4681/master branch 2 times, most recently from c4ca509 to 0cbe104 Compare June 11, 2026 18:11
@nickanderson

Copy link
Copy Markdown
Member Author

Failing attribute check until cfengine/core#6174 is merged.

@nickanderson nickanderson requested a review from olehermanse June 11, 2026 18:54

@olehermanse olehermanse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes look good but please don't merge until green in GH Actions.

Comment thread content/reference/promise-types/classes.markdown
@nickanderson

Copy link
Copy Markdown
Member Author

@cf-bottom jenkins with cfengine/core#6174 please

Documents the timer_policy attribute on classes: promises (CFE-4681),
which controls whether a persistent class restarts its timer when
rediscovered. The default is reset on master (3.28.0); the attribute is
also available on 3.24.5 and 3.27.2, where the default is absolute.

Ticket: CFE-4681
cfengine dev format-docs now reformats cf3 code blocks (cfengine CLI
0.18.0), and expects a blank line between the classes: and insert_lines:
promise types in the example. Add it so the Lint and format check passes.
@nickanderson nickanderson merged commit c7c07dc into cfengine:master Jul 8, 2026
2 checks passed
nickanderson added a commit that referenced this pull request Jul 8, 2026
cfengine CLI 0.18.0 ships a syntax-description.json that includes timer_policy on classes: promises, so the example no longer needs the {skip TODO} fence to pass cfengine dev lint-docs. Dropping it means the example is syntax-checked like the others. Follow-up to #3682 (merged with the fence).
nickanderson added a commit that referenced this pull request Jul 8, 2026
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