Skip to content

feat: hot-reload pipeline files alongside rules#68

Merged
mostafa merged 2 commits into
mainfrom
feat/pipeline-hot-reload
May 4, 2026
Merged

feat: hot-reload pipeline files alongside rules#68
mostafa merged 2 commits into
mainfrom
feat/pipeline-hot-reload

Conversation

@mostafa
Copy link
Copy Markdown
Member

@mostafa mostafa commented May 4, 2026

Summary

  • Store pipeline file paths in RuntimeEngine so that load_rules() re-reads pipeline YAML from disk before rebuilding the engine, instead of carrying over stale in-memory pipelines.
  • Extend the notify file watcher to also watch individual pipeline files (in addition to the rules directory). Any YAML change triggers the same debounced reload signal.
  • If any pipeline file fails to parse during reload, the entire reload aborts and the old engine stays active (same fail-safe pattern as rule reload errors).

Changes

File What
rsigma-runtime/src/engine.rs pipeline_paths field, set_pipeline_paths(), pipeline_paths(), reload_pipelines() helper
rsigma-runtime/src/processor.rs reload_rules() carries pipeline_paths through to the new engine; 2 new tests
rsigma-cli/src/daemon/reload.rs spawn_file_watcher() accepts and watches additional pipeline file paths
rsigma-cli/src/daemon/server.rs DaemonConfig.pipeline_paths, engine setup, watcher setup, updated log messages
rsigma-cli/src/main.rs Pass pipeline_paths into DaemonConfig

Test plan

  • reload_re_reads_pipelines_from_disk: verifies field mapping changes take effect after reload
  • reload_with_broken_pipeline_keeps_old_engine: verifies failed reload leaves old engine active
  • Existing reload_rules_preserves_engine still passes
  • Full workspace test suite passes (cargo test --workspace, zero failures)
  • cargo clippy --workspace --all-features -- -D warnings clean

mostafa added 2 commits May 5, 2026 00:09
Store pipeline file paths in RuntimeEngine so that load_rules() re-reads
pipeline YAML from disk before rebuilding the engine. Extend the notify
file watcher to also watch individual pipeline files. If any pipeline
file fails to parse during reload, the entire reload aborts and the old
engine stays active.

- RuntimeEngine: add pipeline_paths field, set_pipeline_paths(),
  pipeline_paths(), and reload_pipelines() helper
- LogProcessor::reload_rules(): carry pipeline_paths through to new engine
- spawn_file_watcher(): accept and watch additional pipeline file paths
- DaemonConfig: add pipeline_paths field, wire through from CLI
- 2 new tests: reload_re_reads_pipelines_from_disk,
  reload_with_broken_pipeline_keeps_old_engine
Mention that pipeline files passed via -p are also watched for changes
in daemon mode, and that rules + pipelines are re-read together on any
reload trigger.
@mostafa mostafa merged commit f30b97e into main May 4, 2026
9 checks passed
@mostafa mostafa deleted the feat/pipeline-hot-reload branch May 4, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant