Skip to content

feat(daemon): sync daemon, receipt store, check-health#36

Merged
mdheller merged 1 commit into
mainfrom
feat/sync-daemon
Jun 16, 2026
Merged

feat(daemon): sync daemon, receipt store, check-health#36
mdheller merged 1 commit into
mainfrom
feat/sync-daemon

Conversation

@mdheller

Copy link
Copy Markdown
Contributor

Summary

  • ReceiptStore (receipt_store.py): persists SyncCycleReceipt JSON files to {store_root}/receipts/; tracks current-version state file so daemon knows what's already applied.
  • SyncDaemon (daemon.py): polls Katello on a configurable interval (default 300s); applies sync automatically when a new content view version is promoted to stable; exponential backoff on API errors; SIGTERM/SIGINT graceful shutdown.
  • CLI additions: sync daemon, sync check-health, receipts list, receipts last. sync apply now accepts --store-root to persist receipts.
  • daemon_from_env(): constructs daemon entirely from env vars for the systemd EnvironmentFile pattern.

Test plan

  • python3 -m pytest tests/ -q → 93 passed
  • sourceos-syncd sync daemon --from-env starts and polls (requires running Katello)
  • sourceos-syncd sync check-health{"healthy": true, ...}
  • sourceos-syncd receipts last → most recent receipt

- ReceiptStore: persists SyncCycleReceipts to disk; tracks current-version
  state file so daemon detects when a new CV version is available.
- SyncDaemon: poll loop (default 300s); applies sync on new CV version;
  exponential backoff on network/API error; SIGTERM/SIGINT safe.
- CLI: adds `sync daemon`, `sync check-health`, `receipts list`, `receipts last`.
- `sync apply` now optionally persists receipt and updates current-version
  when --store-root is passed.
- 93 tests passing.
@mdheller mdheller merged commit eea1c90 into main Jun 16, 2026
4 checks passed
@mdheller mdheller deleted the feat/sync-daemon branch June 16, 2026 16:30
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