Skip to content

fix(overlay): sync --unattended --dry-run plans the scheduled run and writes nothing - #697

Merged
mboiman merged 1 commit into
bks-lab:mainfrom
mboiman:fix/overlay-unattended-dry-run
Nov 18, 2026
Merged

mboiman merged 1 commit into
bks-lab:mainfrom
mboiman:fix/overlay-unattended-dry-run

Conversation

@mboiman

@mboiman mboiman commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Why

sync --dry-run is the documented way to preview a sync. Combined with --unattended the flag was ignored: the run applied, advanced the lock pin and recorded its outcome for status, exactly like the scheduled job. Found on 2026-11-18 while testing materialize.unattended_accept (#696) on a live instance: the "preview" wrote 9 files and moved the pin. A preview that writes is worse than none, because its output reads as "nothing happened yet".

The cause predates #696: cmd_sync dispatches --unattended to cmd_sync_unattended before --dry-run is looked at, and that path had no dry mode.

What

  • sync --unattended --dry-run plans every due overlay the way the scheduled run would (interval, blockers, unattended_accept) and prints unattended <name>: would apply (...) or would hold (...), naming what it would accept and leave pending.
  • It writes no file, keeps the lock pin, and records no outcome in .bridge/overlay-unattended.yaml, so status is unchanged. A closing line says [dry-run] no files written, nothing recorded.
  • The scheduled run itself is unchanged; overlay-autosync.sh never passes --dry-run.
  • docs/org-overlays.md documents the preview.

Tests

Test first: new section 32 in scripts/tests/test-overlay.sh.

  • Red against main (new test, old code): 435 passed, 7 failed (files written, pin moved, lock changed, outcome recorded, no "would apply").
  • Green with the fix: 442 passed, 0 failed.
  • python3 scripts/check-all.py: 27 green.
  • Live instance: dry run through the plan path reports would apply; checksums of the lock, the unattended state and every overlay-managed file are identical before and after.

🤖 Generated with Claude Code

… writes nothing

With --unattended the --dry-run flag was ignored: the run applied,
advanced the lock pin and recorded its outcome, the same as the
scheduled job. It now plans every due overlay the same way, prints
"would apply" or "would hold" with what it would accept and leave
pending, and writes no file, no lock and no recorded outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: mboiman <mboiman@gmail.com>
@mboiman
mboiman merged commit a6dd96b into bks-lab:main Nov 18, 2026
21 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.

1 participant