Skip to content

sync: keep crontab output on API failure, fix dry-run hint - #93

Merged
aflanagan merged 6 commits into
masterfrom
agent/sync-api-failure-stdout-326e
Nov 8, 2026
Merged

aflanagan merged 6 commits into
masterfrom
agent/sync-api-failure-stdout-326e

Conversation

@aflanagan

@aflanagan aflanagan commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

cronitor sync --auto file | crontab - installed an empty crontab when PutMonitors failed. fatal calls os.Exit, which skips the deferred print in finishSync. The API failure now follows the same path as a shell-wrapper or save failure: stderr gets the error, stdout gets the original crontab (not the planned rewrite), the file on disk is left unchanged, and the process exits 1.

--verbose logs for that single-file --auto run, including the "Reading config" line, go to stderr so they are not installed as part of the crontab.

The dry-run reminder no longer appends --auto --silent. Completing the run is the same command without --dry-run: cronitor sync after an interactive dry run, or cronitor sync --auto when --auto was already set (plus whatever file or other flags were already on the command).

--file import and Windows scheduled-task sync still call fatal; neither prints a crontab on stdout. --auto --silent still prints nothing, which is the documented behavior.

With several crontabs, or in interactive mode, an API failure no longer stops the run. Each remaining crontab is still tried, and the run exits 1 at the end. That matches the documented rule that sync exits 1 if any crontab fails, and it matches the shim and save failure paths.

Review follow-up

  1. A single named crontab that does not exist, cannot be read, or is not writable now exits 1 with the error on stderr. It no longer prints nothing and exits 0. If the file is readable but not writable, stdout is the original crontab, the same as an API, shim, or save failure. If the file does not exist or cannot be read, there is nothing to print. Scanning several crontabs is unchanged: a missing user crontab is still skipped, and a system crontab this user cannot write is still counted in the one sudo hint.

  2. A missing API key or an invalid --format still exits 1 before a plan exists. In --auto single-file mode, when that file is readable, sync prints it to stdout first. A missing or unreadable file prints nothing.

  3. The release note, README, and cronitor sync help no longer say set -o pipefail or checking the exit code keeps a pipe from installing a failed run. crontab - still runs and installs empty input. They say to capture first: out=$(cronitor sync --auto file) && printf '%s\n' "$out" | crontab -. A direct | crontab - pipe can still install an empty crontab if sync fails before it can read the file, for example when the file is missing or a flag is invalid. Once sync has read the file, a failure prints the original crontab and exits 1. --dry-run on a single named file that can't be written now exits 1.

  4. The dry-run reminder redacts an API key passed with -k or --api-key (-k X, -kX, -k=X, --api-key X, --api-key=X, and a short cluster such as -vkX or -vk=X) to <api-key>. It redacts a ping key passed with -p or --ping-api-key in the same forms to <ping-api-key>. A clustered = is kept, so -vk=X prints -vk=<api-key>.

Test results

cd web && npm ci && npm run build succeeded.

go build ./... && go test ./... passed:

  • cmd 17.0s
  • lib 0.6s

Re-ran cd web && npm ci && npm run build, then go build ./... && go test ./..., after this follow-up. Both succeeded (cmd 17.1s, lib cached).

GOOS=windows go test -c ./cmd compiled.

TestSyncAutoPrintsOriginalWhenAPIFails still checks that an API failure exits 1, stdout is the original crontab, the file is unchanged, and stderr is non-empty. It no longer asserts exact log strings.

TestSyncAutoExitsWhenCrontabMissingOrUnwritable checks that a missing file exits 1 with empty stdout, and that an unwritable file exits 1 with the original crontab on stdout and the file unchanged.

Dev-only checks

Not committed:

  • Interactive dry run of cronitor sync <file> --dry-run hints cronitor sync <file>, with no --auto, --silent, or --dry-run.
  • cronitor sync --auto --dry-run <file> hints cronitor sync --auto <file> on stderr, and the hint is not on stdout.
  • --auto --silent with the same API failure prints nothing, exits 1, and does not change the file.
  • Interactive --verbose still logs the API request on stdout.
  • Wording, checked with the built binary and not asserted in tests: a missing file prints <path> does not exist and nothing on stdout; a mode 000 file prints could not be read and nothing on stdout; a mode 0444 file prints is not writable. Run sync with sudo. and the original crontab on stdout. The file on disk does not change. Exit code is 1 in each case.
  • Redaction, checked with the built binary and not asserted in tests: --auto --dry-run with -k X, -kX, -k=X, --api-key=X, --api-key X, -vkX, and -vk=X shows <api-key> in the reminder and does not print the key. -vk=X keeps the =. Stdout stays the crontab.
  • Ping-key redaction, checked with the built binary and not asserted in tests: -p X, -pX, -p=X, --ping-api-key X, --ping-api-key=X, -vpX, -vp=X, and -vp X show <ping-api-key> and do not print the key.
  • A missing API key, and --format=nope, print the original crontab and exit 1 when the file is readable, and print nothing and exit 1 when it is missing.
  • --auto --silent on a missing or read-only file prints nothing and exits 1.
  • Interactive cronitor sync on a missing or read-only file exits 1 with the error on stderr and does not print Sync complete.
  • A directory with one unwritable crontab does not fail the run on its own; the sudo hint is still printed when the other file syncs. Not committed.
  • Capture-first, checked in bash against crontab and not committed: out=$(cronitor sync --auto file) && printf '%s\n' "$out" | crontab - leaves the crontab untouched when the file is missing (exit 1) and when a flag is invalid (exit 1, empty stdout). With a readable file that sync finishes, it installs that output. A direct sync --auto <missing> | crontab - still installs an empty crontab, including under set -o pipefail (pipeline status 1, crontab empty).
  • Skipped hint edge cases, not fixed, because they affect the printed hint only: -e -k /path treats the path as the API key (-e -k <api-key>), and -k after -- is still redacted as an API key.
  • Redaction unit tests were not added. They are not critical for this change.
  • The -e -k /path over-redaction was left as-is. It only hides too much in a printed hint.

CI follow-up

Discover includes custom notification-list and Discover omits 'notifications' now read stderr as well as stdout. On Linux, discover --auto prints the crontab on stdout and --verbose request logs on stderr. Windows still prints those logs on stdout (that job was already green), so the checks read both streams. The omit check passes its paths into bash -c, which does not inherit the test's variables. The capture-first snippet in the README, the 33.15 note, and cronitor sync help now says not to add --silent: --auto --silent prints no crontab, so the pipe would install an empty one.

Open in Web Open in Cursor 

PutMonitors called fatal, and os.Exit skipped the deferred crontab
print. `cronitor sync --auto file | crontab -` then installed an empty
crontab. Return that failure like a shim or save failure: print the
original crontab and exit 1. Verbose logs for that run go to stderr so
they are not part of the pipe.

The dry-run reminder no longer appends --auto --silent. Completing the
run is the same command without --dry-run.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Nov 8, 2026

Copy link
Copy Markdown

Opus 5.5 Medium review @ d45ac35: APPROVE

The fix is correct and narrow. I found no regressions and no new env vars, flags, or config (stdoutIsCrontab is internal). The findings below are pre-existing or minor. Please consider the first two for a follow-up, because the docs promise more than the code delivers.

What I verified:

  • Ran cd web && npm ci && npm run build, then go build ./... && go test ./...: all green. Also ran -run TestSync -shuffle=on -count=2 and ran the new test -count=5: stable.
  • Reverted each half of the fix in turn (put back fatal() in applyPlan, and removed the stderr routing in log()). The new test fails in both cases, so it covers both changes.
  • Ran the real binary against cronitor.io with an invalid key, using sync --auto c with and without --verbose. Result: exit 1, stdout is exactly the original crontab, the file is unchanged, and the config, Request: and Response: logs all go to stderr. With --config x.yaml --verbose, the .json error goes to stderr and stdout stays clean. --auto --dry-run --verbose exits 0, with the crontab alone on stdout and the summary and reminder on stderr.
  • Every status printer (printDoneText, printSuccessText, printWarningText, printErrorText) and lib's api.Logger go through log(), so the stdoutIsCrontab switch covers all of them. initConfig runs after ParseFlags and before the Args hook, so its early guess is safe: the CRONITOR_EXEC case only moves verbose text to stderr, and Run recomputes the flag anyway.
  • Windows: reserveStdoutForCrontab returns false there, and the Windows path prints no crontab, so the remaining fatal at discover_logic_windows.go:580 cannot corrupt a pipe.
  • --silent and multi-file runs print no crontab, so neither has a pipe to corrupt.

Findings

  • [non-blocking] cmd/discover.go:820-843: cronitor sync --auto <file> | crontab - still installs an EMPTY crontab and exits 0 when the file does not exist (for example a typo) or is not writable (for example a read-only mount). planCrontab returns nil, so there is nothing to print, and the warning only goes to log(). I reproduced both: stdout empty, stderr empty, exit 0. This is the worst remaining pipe hazard. A fix would print the file if it is readable and exit 1. Pre-existing.
  • [non-blocking] cmd/discover.go:220-225: a missing API key, or an invalid --format, calls fatal() before any plan exists. Result: exit 1 with empty stdout, so without pipefail the pipe installs an empty crontab. A missing CRONITOR_API_KEY in a script environment is a realistic case. Pre-existing.
  • [non-blocking] docs/releases/33.15.md:11 ("never installs an empty crontab") and README.md:110 ("is safe") are stronger than the code because of the two items above. The newly added sentence listing the failure cases (API call, shell wrapper, save) is accurate. Either soften "never" or fix the two items above.
  • [non-blocking] cmd/discover.go:1085-1094: behavior change outside single-file mode. In multi-file or system-wide --auto runs, and in interactive runs, an API failure no longer aborts the run: each remaining crontab still gets its own PutMonitors call and its own error line, and the run exits 1 at the end. I reproduced this with a directory of two crontabs: two errors, exit 1, files unchanged. This matches the documented "if any crontab fails to apply, sync exits 1" and the shim and save failure paths, so it is fine. It could be worth one line in the PR description.
  • [non-blocking] cmd/discover.go:317-333: the dry-run reminder echoes os.Args unredacted, so -k <api key> is printed in plain text on stderr. The old --auto --silent version did the same, so this is pre-existing, but redactSecrets could wrap it now that this line is being touched. The new hint text itself is correct: interactive cronitor sync --dry-run now suggests cronitor sync, and --auto --dry-run file suggests cronitor sync --auto file, matching the README and help.
  • [non-blocking] cmd/sync_rerun_test.go:636-661: the test is critical and worth keeping. It is somewhat brittle, though, because it asserts on exact log strings (Reading config, Request:, Error from) and needs viperUnset(varConfig) so the fixture config gets logged. The SHELL=/CRONITOR= check at :649 is redundant with the exact-equality check at :655. Optionally drop the stderr Reading config assertion and the redundant check.

A missing, unreadable, or unwritable file passed to sync used to print
nothing and exit 0, so a pipe could install an empty crontab. Fail those
runs, and print the original crontab when it is readable. Also print that
crontab before a missing API key or bad --format in --auto single-file
mode, and keep API keys out of the dry-run reminder.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Nov 8, 2026

Copy link
Copy Markdown

Opus 5.5 Medium review @ ebee7b9: REQUEST CHANGES

Reviewed d45ac35..ebee7b9 and the PR as a whole (7146817..ebee7b9). cd web && npm ci && npm run build, go build ./... and go test ./... all pass (cmd, lib ok).

The code is right. The one blocker is in the docs: the new set -o pipefail advice is wrong on exactly the path it is meant to protect.

Findings

[blocking] README.md:110, docs/releases/33.15.md:11, cmd/discover.go:256-257 (help): set -o pipefail does not stop | crontab - from installing a failed run.
pipefail only changes the pipeline's exit status. crontab - still runs, reads EOF, and installs an empty crontab. Checked in bash:

$ bash -c 'set -o pipefail; (exit 1) | ./record-stdin; echo status=$?'
record-stdin ran, installed 0 bytes
status=1

So "Use set -o pipefail (or check the exit code) so a pipe does not install output from a failed run" is false for the missing-file case the README names. "(or check the exit code)" can't help either: you can't check the exit code of the left side before the right side has consumed stdin. Suggested docs-only fix: recommend capture-then-install, for example
out=$(cronitor sync --auto file) && printf '%s\n' "$out" | crontab -
or cronitor sync --auto file > new.cron && crontab new.cron. Also say that a bare ... | crontab - installs an empty crontab whenever sync prints nothing.

The sentence "On any failure, sync exits 1 and prints the original crontab when it can read one" also overclaims. A cobra flag-parse error (cronitor sync --auto /tmp/ct --bogus) goes through Execute() → fatal (cmd/root.go:57-58) before Run. It exits 1 with 0 bytes on stdout even though the file is readable. Either scope the sentence to errors after flags are parsed, or rely on the capture-then-install advice above, which covers this too.

[non-blocking] cmd/discover.go:156 / :409: the dry-run hint still prints --ping-api-key / -p values.
cronitor sync --ping-api-key PINGKEY --dry-run echoes PINGKEY. The help text marks it as a secret, the same as --api-key. Consider redacting p / --ping-api-key too. The parsing already treats p as value-taking.

[non-blocking] cmd/discover.go:156: harmless over-redaction edge cases.
I checked every form listed in the doc comment: -k X, -kX, -k=X, --api-key X, --api-key=X, -vkX, -vk X. Each is redacted correctly. Values of -n/-e/-u/-l/-c/-p that contain a k (-nmyhostk, -e kill, -pPINGk) are left alone, and --notification-list=-kfoo is untouched. Two edge cases do get mangled: a -k token that is really another flag's value (-e -k /etc/crontab → -e -k <api-key>, which swallows the path) and a -k after --. -vk=X becomes -vk<api-key> (the = is dropped). All of this is cosmetic and only affects the printed hint.

[non-blocking] cmd/sync_rerun_test.go: the new helpers have no committed tests.
There is no test for redactAPIKeyArgs (it fixes a secret leak; a small table test of the forms above would lock it in) or for printOriginalCrontab on the missing-API-key and bad --format paths. I verified both paths by hand with the built binary: no key → exit 1 and the original on stdout; --silent → exit 1 and nothing on stdout. The new TestSyncAutoExitsWhenCrontabMissingOrUnwritable is good: exact stdout and exit-code assertions, and it stubs crontabWritable because root can open 0444 files, so it is not brittle. Loosening TestSyncAutoPrintsOriginalWhenAPIFails to "stderr non-empty" is fine, because the exact stdout equality already proves no log text reaches the pipe.

[non-blocking] cmd/discover.go:973-982: --dry-run on one named unwritable file now exits 1.
Before, it exited 0 (with no preview either way). That is consistent with the new rule, but you could argue a dry run should preview a readable file it would not write. Mention it in the release note or leave it as is.

Checked, no issue

  • Corruption paths: no fatal or os.Exit is left on the single-file --auto path after flag parsing. The only ones left in discover.go are the API-key/format checks, which now print the original first, and --file import, which doesn't touch the crontab. API, shim and save failures, plus unwritable files, print the original and exit 1. A missing or unreadable file prints nothing and exits 1 (verified: /tmp/nope does not exist, exit 1, 0 bytes). An empty file is still skipped with exit 0, and installing nothing in that case is equivalent.
  • Multi-crontab scans and the sudo hint: unusable is only set when !processingMultipleCrontabs. Scans still skip missing or empty crontabs and still add unwritable ones to jobsNeedingSudo. A single named file keeps the "Run sync with sudo" wording.
  • Windows: reserveStdoutForCrontab returns false, so printOriginalCrontab does nothing. planCrontab is not used on Windows.
  • --silent: neither printOriginalCrontab nor the finishSync print writes to stdout. The exit code is still 1.
  • Interactive mode: a named missing or unwritable file now reports an error and exits 1 instead of warning and exiting 0. That matches "If any crontab fails to apply, in any mode, sync exits 1."
  • New flags, env vars or config: none in the whole PR diff.

pipefail does not stop crontab - from installing empty input. Point the
README, release note, and sync help at a capture-first command, and
redact ping keys in the dry-run reminder.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Nov 8, 2026

Copy link
Copy Markdown

Opus 5.5 Medium review @ d9d2532: REQUEST CHANGES

Every finding from the earlier review at ebee7b9 is fixed. The verdict is REQUEST CHANGES only because the Linux CI job fails deterministically because of a change in this PR.

Previous findings: all fixed

  • Pipe-safety docs (the old blocker): fixed. README.md:110, docs/releases/33.15.md:11 and the sync help at cmd/discover.go:271-275 now say the same thing. I checked each claim against a built binary:
    • Missing file, with or without a key: exit 1, 0 bytes on stdout.
    • Unknown flag: exit 1, 0 bytes on stdout; cobra writes usage to stderr.
    • No key or an invalid key after the file is read: exit 1, and stdout is byte-identical to the original file.
    • cronitor sync --auto nofile | crontab -: the pipeline exits 0 and installs an empty crontab, which is exactly what the docs warn about.
    • The capture-first snippet installs nothing in all of these cases, in both bash and dash.
  • The snippet is correct. out=$(...) && ... takes the substitution's exit status in POSIX sh and bash. The '%s\n' single quotes sit inside backticks in markdown, so they are not nested in another quote. "$out" is quoted. $() strips every trailing newline and printf '%s\n' puts back exactly one: a\n\n\n becomes a\n, and a with no trailing newline becomes a\n. Only trailing blank lines are lost, and crontab gets the final newline it needs. Under --auto, status, done and warning text goes to stderr, so $out holds only the crontab.
  • -p / --ping-api-key redaction: fixed. I ran the following through redactAPIKeyArgs:
    • All forms of -k X, -kX, -k=X, --api-key X, --api-key=X, -vkX, -vk X and -vk=X, plus the same forms for -p and --ping-api-key. All are redacted.
    • -vk=X now gives -vk=<api-key>, so the = is kept.
    • These unrelated arguments are left unchanged: -nhost-kp, -ufoo,kp, -lp.log, -cconf.yaml, -ep, --hostname=p, --log k.log, -, -k as the last argument, and a positional file path.
    • Removing p from shortFlagTakesValue is right, because p is now handled the same way as k. Every other string shorthand (c, e, l, n, u) is still listed.
    • An end-to-end --auto --dry-run -vpSECRET -k=SECRETK run does not print the secrets on stdout or stderr.
  • Release note for --dry-run: fixed at docs/releases/33.15.md:12. I confirmed cronitor sync --dry-run <0444 file> prints "not writable" and exits 1.
  • No new env var, flag or config. The diff adds no new Flags() registration, Getenv, CRONITOR_* variable or viper key. crontabWritable and stdoutIsCrontab are internal variables.

Findings

  • [blocking] tests/test-discover.bats:90: "Discover includes custom notification-list" runs discover --auto -v crontab.txt ... --notification-list test-list-name | grep -q test-list-name. That grep depends on --verbose request logs reaching stdout. Commit d45ac35 sends log() to stderr whenever stdout is reserved for the crontab (cmd/root.go:493-498), so this grep can no longer match.
    • I reproduced this with the fake API from newRerunAPI: test-list-name appears on stderr and not on stdout.
    • "Run Linux tests", which is the BATS suite, has failed on all three PR commits (d45ac35, ebee7b9 and d9d2532). The Go test step in that job passed, and recent master runs are green.
    • I couldn't read the job log without auth, so whether line 90 is the only failing case is an inference. The cause is reproduced, though.
    • Fix: keep the behaviour and update the test, for example ... 2>&1 >/dev/null | grep -q test-list-name. Then re-run CI.
  • [non-blocking] tests/test-discover.bats:86: "Discover omits 'notifications'..." uses run -1 on a stdout grep of -v output. That output is now on stderr, so the test passes without checking anything. Redirect it the same way as line 90.
  • [non-blocking] cmd/discover.go:156-230: redactAPIKeyArgs and redactAPIKeyToken have no unit tests. A small table test covering the -k/-p forms above, -vk=X, and the unchanged cases (-nhost-kp, -lp.log) would guard this secret-hiding code.
  • [non-blocking] cmd/discover.go:164-169: the redactor doesn't skip the separate value of another flag that takes a value. For example, -e -pX becomes -e -p<ping-api-key>, and -e -k /etc/crontab hides the file path. pflag would read -pX as the -e value. This is contrived and errs toward hiding too much, so I'm noting it only.
  • [non-blocking] README.md:110 and docs/releases/33.15.md:11: with --auto --silent, "a failure prints the original crontab" is not true; stdout is empty and the exit code is 1. The snippet still installs nothing on failure, but if --silent is added to it, a successful run installs an empty crontab. docs/releases/33.15.md:14 does say --silent skips printing. A short "don't add --silent to this pipe" would close that gap.

What I ran

  • cd web && npm ci && npm run build: OK.
  • go build ./...: OK.
  • go test ./...: cmd and lib pass.
  • go vet ./cmd reports only the unkeyed-field warnings that already exist in cmd/root.go:359-398; none are from this PR.
  • CI at d9d2532: "Run stable Go tests" passed, "Run Linux tests" failed in the BATS step, and Windows was still running.

discover --auto prints the crontab on stdout, so --verbose request logs
go to stderr. The notification-list bats checks were still reading
stdout. Also warn that the capture-first snippet must not use --silent,
because --auto --silent prints no crontab.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor

cursor Bot commented Nov 8, 2026

Copy link
Copy Markdown

Opus 5.5 Medium review @ 04571a7: APPROVE

Re-review of 04571a7 against master. The previous blocker is fixed. I found nothing blocking. One verification item is only partly met: see the first finding.

Checks run

  • cd web && npm ci && npm run build passed. go build ./... && go test ./... passed (cmd 17.1s, lib 0.7s).
  • I couldn't run bats locally because there is no CRONITOR_API_KEY here. Linux CI on 04571a7 is green: ok 94 Discover omits 'notifications'… (0.9s) and ok 95 Discover includes custom notification-list both pass, and no discover test regressed. The Windows job was still pending when I checked.
  • I ran a throwaway Go test (not committed) through runSyncArgs with --auto --verbose against a fake API. The Request: payload is on stderr and stdout carries only the crontab. With --notification-list test-list-name, the payload contains "notify": ["test-list-name"]. With or without the flag, the output never contains the string notifications.

Findings

  1. [non-blocking] tests/test-discover.bats:91: the "omits" test now really runs: it passes in the env vars, uses 2>&1, and the 0.9s runtime shows it reaches the API. But it still can't fail. Sync sends the alert list as notify (lib/cronitor.go:64), never as notifications, so grep -q "notifications" never matches, even when a list is sent. To make it assert something, grep for '"notify"'. That fails if sync sends notify without --notification-list, and test 95 already shows the field shows up when a list is set. The needle predates this PR, but this is the item the follow-up was meant to fix.
  2. [non-blocking, pre-existing, out of scope] tests/test-discover.bats:82: "adds no-stdout flag when supplied" still has the original bash -c problem. $FIXTURES_DIR, $API_KEY and $CRONITOR_ARGS aren't visible inside it, so the command fails at once (0.04s in CI), and run -1 passes vacuously. Its assertion also looks inverted for the name it has. Worth a separate fix.
  3. [non-blocking, nit] README.md:110 and docs/releases/33.15.md:11: "Do not add --silent to that command" comes one sentence after the snippet, with the "monitors every new job" / "Use it for scripts" sentence in between, so "that command" is a little ambiguous. The sync help (cmd/discover.go:276) puts it right after the snippet. Moving the sentence to follow the snippet would make all three read the same. The content is accurate and matches in all three places: --auto --silent skips both the deferred print in finishSync and printOriginalCrontab, and the capture-first snippet would then install a single blank line.

Rest of the PR diff vs master

  • No new env var, flag or config. The only flag code added is the verbose reset in the test helpers.
  • | crontab - corruption paths: the PutMonitors failure now returns through reportError with plan.output = Original(). Shim and save failures print the original. An unwritable file prints the original and exits 1. A missing or unreadable file prints nothing and exits 1, and the docs now say so. A missing API key or bad --format prints the original when the file is readable. In single-file --auto mode on non-Windows, verbose and config-error output goes to stderr. A GetMonitors failure is still soft. The only fatal calls left in discover.go are --file import, which never prints a crontab. I found no remaining os.Exit before the deferred print on the single-crontab --auto path.
  • Exit codes: an unusable plan sets applyFailed, so exitFn(1) runs after the print. finishSync returning 0 in that case is harmless, because the deferred exit wins.
  • Intentional behavior changes are listed in the PR body: several crontabs keep going after an API failure and exit 1 at the end; interactive runs on a missing or unwritable single file now exit 1; --dry-run on an unwritable single file exits 1; the dry-run hint no longer adds --auto --silent and redacts keys. The known over-redaction of -e -k and the skipped redaction unit tests are recorded in the PR body with reasons. I agree neither blocks.

@aflanagan

Copy link
Copy Markdown
Contributor Author

Handled the Opus @ 04571a7 non-blocking notes in 9a27d87:

  1. tests/test-discover.bats:91: the needle is now "notify", which is the real field name (lib/cronitor.go:64, omitempty), so the omit test can actually fail.
  2. README and the 33.15 notes: the --silent warning now comes right after the snippet, matching the help text.

Skipped 2 (tests/test-discover.bats:82, the no-stdout test passing vacuously): it predates this PR and isn't related to the crontab-pipe fix. It's out of scope here and is noted for a follow-up.

@aflanagan

Copy link
Copy Markdown
Contributor Author

Reverted the needle change in cab37fa. CI showed that "notify" appears in the verbose logs even without --notification-list, because the logs include API responses for existing monitors. So that needle can't tell the cases apart. Skipping note 1: a real check would need to match the request body only, and that's out of scope for this fix. The test is the same as it was at 04571a7. The docs wording fix from 9a27d87 stays.

@aflanagan
aflanagan merged commit 412a048 into master Nov 8, 2026
4 checks passed
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.

2 participants