Skip to content

ENT-14192: Update parser with event driven cfengine syntax#6202

Merged
olehermanse merged 1 commit into
cfengine:masterfrom
victormlg:cf-watchd-parser
Jul 14, 2026
Merged

ENT-14192: Update parser with event driven cfengine syntax#6202
olehermanse merged 1 commit into
cfengine:masterfrom
victormlg:cf-watchd-parser

Conversation

@victormlg

@victormlg victormlg commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Depends on: #6186 (Edit: merged now).

This PR simply allows the new event promise type to be parsed, but is ignored by cf-agent. Test policy:


bundle agent main {
  reports:
    "Hello world";
}

body when file_deleted(filename)
{
  files_deleted => { "$(filename)" };
}

bundle agent create_file(filename)
{
  files:
    "$(filename)" create => "true";
}


bundle reactor event_handler {

  events:
    "Create /tmp/a"
      when => file_deleted("/tmp/a"),
      then => create_file("/tmp/a");

    "Create /tmp/b"
      when => file_deleted("/tmp/b"),
      then => create_file("/tmp/b");
}

The syntax here differs from the one defined in the ticket: event promises only take one single when body and one single then bundle. There is a ticket for this in the future.

@larsewi larsewi left a comment

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.

LGTM 🚀

Comment thread libpromises/mod_watch.c Outdated
Comment thread libpromises/mod_watch.h Outdated
@larsewi

larsewi commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Add a test please :)

@olehermanse olehermanse changed the title ENT-14192: Update parser with agent driven cfengine syntax ENT-14192: Update parser with event driven cfengine syntax Jul 1, 2026

@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.

Fix copyright year, add a minimal syntax test, and wait for release.

@victormlg victormlg force-pushed the cf-watchd-parser branch 2 times, most recently from 5e49c07 to 981cbfb Compare July 1, 2026 13:50

@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.

@victormlg please rebase

@olehermanse

Copy link
Copy Markdown
Member

@cf-bottom jenkins, please

@cf-bottom

Copy link
Copy Markdown

Ticket: ENT-14192
Changelog: Title
Signed-off-by: Victor Moene <victor.moene@northern.tech>
@olehermanse

Copy link
Copy Markdown
Member

@victormlg I rebased this one to get the latest master changes

@olehermanse

Copy link
Copy Markdown
Member

@cf-bottom jenkins, please

@cf-bottom

Copy link
Copy Markdown

@olehermanse olehermanse self-requested a review July 13, 2026 18:43
@olehermanse olehermanse merged commit 61225d9 into cfengine:master Jul 14, 2026
45 of 48 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.

4 participants