Repository navigation
v0.10.0: unattended operations - #15
Merged
Merged
Conversation
- draftcat doctor: read-only preflight of config, credentials, operator access, state store, listener ports and schedules, with --json. - Cron expressions and @daily-style schedules in a per-pipeline time zone, with optional catch_up for slots missed during downtime. - Interval schedules continue from the recorded run history. - One claim admits every run (timer, /run, Run-now, webhook). - pause_after_failures pauses a failing timer pipeline and notifies once. - SIGINT/SIGTERM drain within timeouts.shutdown_grace. - budgets.alert_at notifies at fractions of the daily caps. - Configured credentials are redacted from logs, notifications, stored errors, spans and OTLP exports. - Current-state Prometheus gauges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.10.0: unattended operations
Calendar schedules, a preflight, a clean shutdown, spend warnings and credentials that stay out of every log: the settings that matter once Draftcat runs as a service.
Changes, in review order
draftcat doctor: read-only preflight of config, credentials, operator access, state store, listener ports and schedules. Gives a fix for each finding, supports--json, and exits 1 on failuredraftcat doctor && systemctl restart draftcat)SIGINT/SIGTERMrefuses new runs, closes the webhook listener and waits up totimeouts.shutdown_grace(default 30s)[REDACTED:<VARIABLE>]in the log, operator notifications, stored run and webhook errors, JSON spans and OTLP exportspause_after_failures: a timer pipeline that fails N runs in a row is paused and the operator is told once. The streak is restored at start;/cron resumeclears it@hourly/@daily/@weekly/@monthlyin a per-pipelinetimezone, DST-aware, with optionalcatch_up24hpipeline keeps its cadence on machines that restart oftenbudgets.alert_at: one notification per threshold, cap and UTC day, persisted across restarts/metrics: running and paused pipelines, failure streaks, open approvals, today's tokens and spend against the caps/run, Run-now and webhook all go through the same atomic claim, so each pipeline has at most one run in progress/runwhile a run is in progress answersNot started (pipeline is already running)/cron setaccepts cron expressions;/cronshows full next and last run times. Validation covers schedules, time zones,pause_after_failures,alert_atandshutdown_grace. New guide: docs/operations.md.Compatibility
All new settings are optional. Configurations without them behave as before, except that interval pipelines continue from their last recorded run, shutdown waits up to 30s for running pipelines (
shutdown_grace: 0sexits at once), and/runof a pipeline that is already running is refused. Versions are synchronized to 0.10.0 inversion.go,package.jsonandpackage-lock.json.Verification
go build ./...,go vet ./...,gofmt: cleango test -short -count=1 ./...: 16 packages ok; 451 top-level tests pass (399 onmaster), 0 failuresgo test -short -tags voice -count=1 ./...: okgo test -race -count=1 ./...: okgolangci-lint run --new-from-rev=master(v2.5.0, repo config): 0 issuesgo run . validate: 0 errorsnpm test: 3/3 pass;npm pack --dry-run:draftcat-0.10.0.tgz, 5 filesdoctorexits 0 with the next cron run shown in its zone; the engine starts, a webhook trigger returns 202 and the run completes,SIGTERMexits cleanly, and no configured secret appears in the engine logNew tests cover cron parsing and DST, interval restore, catch-up, the claim (manual vs. timer vs. webhook, drain refusal), the auto-pause streak and restart restore, drain with a live listener and grace expiry, alert thresholds (once, highest-of-jump, persisted across a store reopen), gauges, redaction of the Telegram transport error, notices, spans and run errors, and doctor (ready, missing credentials, read-only store inspection, JSON, busy port).
Review notes
master@5986efa. No other open PRs.scheduler.go), engine start/stop (engine_lifecycle.go), budget ledger hook (budget_alerts.go), Telegram/relay notification text, obs span/OTLP writers and/metrics, validation, config structs.internal/schedule,internal/redact.model_policyfor holding drafts that contain credentials.