Repository navigation
fix(#724): exit non-zero on update --dry-run when work is pending - #725
Merged
admarble merged 2 commits intoJun 10, 2026
Merged
Conversation
Bring `update --dry-run` to parity with `sync --dry-run` (#722): set process.exitCode = 1 when the apply set is non-empty (new + modified, plus local-overrides under --force) so CI/automation can gate on the preview without parsing stdout. The no-op case still exits 0 via the existing "Everything is up to date!" short-circuit before the dry-run tail. Reuses the applySet already derived from the single computeTemplateChanges() call — no new comparison logic. Adds src/commands/update.test.ts covering both exit codes (+ the local-override protected vs --force cases), updates the existing dry-run integration test (its seeded new template is now pending work, so it exits 1), and documents the behavior change in CHANGELOG + troubleshooting. Fixes #724
4 tasks
The internal testing checklist said `update --dry-run` "works without errors", which is now ambiguous: it exits non-zero whenever updates are pending. Reword so a manual tester doesn't read the expected non-zero exit as a failure.
admarble
deleted the
feature/724-update-dry-run-should-exit-non-zero-on-pending
branch
June 10, 2026 03:51
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.
Summary
Brings
sequant update --dry-runto parity withsync --dry-run(#722): it now setsprocess.exitCode = 1when work is pending, so CI/automation can gate on the preview's exit code instead of parsing stdout. Closes the exit-code asymmetry surfaced during QA of #722 / PR #723.Change
src/commands/update.ts— in the dry-run tail, setprocess.exitCode = 1whenapplySet.length > 0(new+modified, pluslocal-overrideunder--force). Reuses theapplySetalready derived from the singlecomputeTemplateChanges()call — no new comparison logic. The no-op case still exits0because it short-circuits at the "Everything is up to date!" return before the dry-run tail.Acceptance criteria
update --dry-runsetsprocess.exitCode = 1whenapplySet.length > 0(new + modified; + local-overrides under--force)update --dry-runexits0when there is nothing to apply (no-op case unchanged)src/commands/update.test.tscovering both exit codesTests
src/commands/update.test.ts(4 cases): pending → exit 1; no-op → exit 0; local-override protected (no--force) → exit 0;--forceoverwrites override → exit 1.update.integration.test.tsdry-run test: its seeded "new" template is pending work, so it now asserts exit1(the read-only/no-prompt/no-save assertions are unchanged).update(11) +sync(27) suites pass;npm run build(tsc) clean.Compatibility note
Potentially breaking for scripts: any automation running
update --dry-runthat treated exit0as "command ran" (rather than "nothing to do") will now see a non-zero exit when updates are pending. Low risk —updateis the interactive command andsyncis the documented non-interactive/CI surface. Documented in CHANGELOG (### Changed) anddocs/troubleshooting.md.Related: #722, #709, PR #723.
Fixes #724