Skip to content

Migration path from .dual.toml to .dual/settings.json #148

@jeevanpillay

Description

@jeevanpillay

Summary

Provide a smooth upgrade path for users with existing .dual.toml files. Detect the old format and either auto-migrate or guide the user.

Behavior

When load_hints() or dual init detects .dual.toml exists but .dual/settings.json doesn't:

  1. Log a warning: "Found .dual.toml (deprecated). Run dual init to migrate to .dual/settings.json"
  2. Fallback: still load from .dual.toml if .dual/settings.json is missing (graceful degradation)
  3. dual init in a repo with .dual.toml:
    • Read existing values (extra_commands, anonymous_volumes, shared)
    • Pre-populate the init wizard with these values
    • Write .dual/settings.json
    • Prompt: "Remove old .dual.toml? [Y/n]"

Implementation

  1. load_hints() fallback — if .dual/settings.json missing but .dual.toml exists, load from TOML with deprecation warning
  2. cmd_init() migration — detect .dual.toml, read its values, use as defaults for new config
  3. Keep TOML parsing temporarilytoml crate stays as dependency until migration period ends

Tests

  • .dual.toml only → loads with warning
  • .dual/settings.json present → .dual.toml ignored
  • Migration populates settings.json from .dual.toml values

Metadata

Metadata

Assignees

Labels

DXcoreCore functionality

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions