Skip to content

Migrate configuration from JSON to TOML (closes #58)#306

Merged
SimmerV merged 5 commits intoMeshAddicts:developfrom
SimmerV:TOML
Mar 7, 2026
Merged

Migrate configuration from JSON to TOML (closes #58)#306
SimmerV merged 5 commits intoMeshAddicts:developfrom
SimmerV:TOML

Conversation

@SimmerV
Copy link
Collaborator

@SimmerV SimmerV commented Mar 6, 2026

Summary

  • Added config.toml.sample as the new primary config format, using Python's built-in tomllib (no new dependencies)
  • Updated config.py to load config.toml first with automatic fallback to config.json + deprecation warning
  • Updated Docker volume mounts, backup logic, migration script, .gitignore, tests, and docs (README, POSTGRES.md)

Notes

  • Existing config.json deployments continue to work — they'll see a deprecation warning in logs

@SimmerV SimmerV self-assigned this Mar 6, 2026
@SimmerV SimmerV added this to meshinfo Mar 6, 2026
@SimmerV SimmerV added enhancement New feature or request docker Pull requests that update Docker code labels Mar 6, 2026
@github-project-automation github-project-automation bot moved this to Backlog in meshinfo Mar 6, 2026
@SimmerV SimmerV linked an issue Mar 6, 2026 that may be closed by this pull request
@SimmerV SimmerV moved this from Backlog to In review in meshinfo Mar 6, 2026
@daviesgeek daviesgeek requested a review from Copilot March 7, 2026 02:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates MeshInfo’s primary configuration format from JSON to TOML while preserving legacy config.json support via fallback loading and deprecation warnings.

Changes:

  • Added config.toml.sample and updated tests to validate the new sample while keeping config.json.sample valid.
  • Updated Config.load() to prefer config.toml, fall back to config.json with a deprecation warning, and adjusted related error/help messaging.
  • Updated Docker compose mounts, backup behavior, migration-script messaging, .gitignore, and docs to reference TOML.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
config.py Implements TOML-first config loading with JSON fallback and updates related messaging/helpers.
config.toml.sample Adds the canonical sample configuration in TOML format.
docker-compose.yml Mounts config.toml into the container instead of config.json.
docker-compose-dev.yml Mounts config.toml into the dev container instead of config.json.
memory_data_store.py Updates backup routine to include config.toml when present (else config.json).
scripts/migrate_json_to_postgres.py Updates user-facing log messages to reflect TOML/JSON config support.
tests/test_config_sample_is_valid_json.py Adds TOML sample validation and keeps legacy JSON sample validation.
tests/test_assets_present.py Ensures config.toml.sample is treated as a required repo asset.
README.md Updates setup instructions to prefer TOML (with legacy JSON mention).
POSTGRES.md Updates PostgreSQL configuration examples/instructions to TOML.
.gitignore Ignores config.toml in addition to config.json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SimmerV SimmerV merged commit 04165ee into MeshAddicts:develop Mar 7, 2026
5 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in meshinfo Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Pull requests that update Docker code enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Enhancement: Convert config.json to INI

2 participants