Skip to content

ENT-14731: Unit tests and syntax validation for cf-reactor - #6416

Open
victormlg wants to merge 8 commits into
cfengine:masterfrom
victormlg:cf-reactor.SyntaxCheck
Open

victormlg wants to merge 8 commits into
cfengine:masterfrom
victormlg:cf-reactor.SyntaxCheck

Conversation

@victormlg

Copy link
Copy Markdown
Contributor

No description provided.

victormlg and others added 7 commits October 16, 2026 13:56
Ticket: ENT-14692
Signed-off-by: Victor Moene <victor.moene@northern.tech>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference check of a new watcher is now done by WatcherRegister(),
without holding the registry lock as it may block. If it fails, the
watcher is not registered and WatcherRegister() returns false, so that
the events promise fails.

Ticket: ENT-14692
Signed-off-by: Victor Moene <victor.moene@northern.tech>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WatcherRegister() now takes a pointer to the options, which include
the interval between two checks.

Ticket: ENT-14692
Signed-off-by: Victor Moene <victor.moene@northern.tech>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ticket: ENT-14692
Signed-off-by: Victor Moene <victor.moene@northern.tech>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It sets the seconds between two checks for the event, 1 by default.
The parser only checks it if it doesn't depend on variables or body
arguments, so it is checked again once expanded, and the events promise
fails if it is invalid.

Ticket: ENT-14692
Signed-off-by: Victor Moene <victor.moene@northern.tech>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moved from a hardcoded and single `file_deleted` event type, to
a table with all the event types and their necessary code, so
that cf-reactor can easily be extended with new event types.

Ticket: ENT-14692
Signed-off-by: Victor Moene <victor.moene@northern.tech>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Moved file_deleted event type test to file_watcher_test
- Added test coverage for watcher

Signed-off-by: Victor Moene <victor.moene@northern.tech>
Comment thread libpromises/mod_reactor.c Fixed
Comment thread libpromises/mod_reactor.c Fixed
Comment thread libpromises/mod_reactor.c Fixed
Signed-off-by: Victor Moene <victor.moene@northern.tech>
@victormlg
victormlg force-pushed the cf-reactor.SyntaxCheck branch from b9e9130 to d9e7491 Compare October 16, 2026 13:14
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.

2 participants