Skip to content

feat(init): Preview planned file changes before initialization writes - #4312

Open
darion-yaphet wants to merge 1 commit into
github:mainfrom
darion-yaphet:feat/init-dry-run
Open

feat(init): Preview planned file changes before initialization writes#4312
darion-yaphet wants to merge 1 commit into
github:mainfrom
darion-yaphet:feat/init-dry-run

Conversation

@darion-yaphet

Copy link
Copy Markdown
Contributor

Description

Closes #4311.

Adds specify init --dry-run to preview initialization changes without writing to the requested project.

The command stages the target in a temporary directory, invokes the normal specify init path there, then reports create, overwrite, preserve, and conflict actions. --json emits machine-readable output for CI/tooling. URL extensions are reported as unresolved and are not downloaded during preview.

Also fixes the bundle initializer鈥檚 direct callback invocation so it explicitly disables the new dry-run flags.

Testing

  • Tested locally with .venv/bin/specify init --help
  • Ran the full suite with .venv/bin/python -m pytest
    7145 passed, 180 skipped
  • Tested disposable project scenarios through tests/test_init_dry_run.py
    7 passed

Additional validation:

  • git diff --check
  • .venv/bin/python -m compileall -q src/specify_cli
  • Bundle initialization regression test passed.
  • Ruff installed and run; the repository has existing lint violations, so this PR does not claim a clean Ruff baseline.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance

Dry-run stages the target and invokes the public initializer in an isolated
child process, then reports create, overwrite, and preserve actions without
writing to the requested project. This keeps previews aligned with
integration-specific installation behavior.
@darion-yaphet
darion-yaphet requested a review from mnriem as a code owner August 25, 2026 12:11
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.

[Feature]: Add specify init --dry-run preview

1 participant