Skip to content

[Bug] Project Template Initialization Not Idempotent - Can't Re-run Setup #376

@anshul23102

Description

@anshul23102

Description

Project template initialization is not idempotent. Running initialization twice causes errors or data corruption. Users cannot safely re-run setup to fix issues or update templates.

Steps to Reproduce

  1. Run: devshell init template-name
  2. Project initialized successfully
  3. Run: devshell init template-name again
  4. Initialization fails with "file already exists" errors
  5. User cannot re-run to fix issues

Environment Information

  • Template system: File-based templates
  • Initialization: Copying/creating files
  • Idempotency: Not implemented
  • Error handling: Fails on existing files

Expected Behavior

  • Second run detects existing setup
  • Updates/validates without errors
  • No data loss
  • Clear indication of already-initialized project

Actual Behavior

  • Second run fails with file conflict errors
  • Cannot safely re-run
  • User must manually fix setup

Code Reference

  • File: src/devshell/template.py
  • Method: init_template() - not idempotent
  • Missing: Existence checks
  • Missing: Update logic

Additional Context

Level 2 reliability issue. Fix requires:

  • Adding idempotency to init logic
  • Checking for existing files
  • Implementing update operations
  • Clear feedback to user

Suggested Labels

bug, initialization, idempotency, reliability, template-system

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions