Repository navigation
v0.5.0
cfgit 0.5.0
New
cfg add/cfg rm: create records and delete them with a tombstone kept in history;cfg restore <record> @<seq>brings a deleted record back (#45).cfg promote --from dev --to prod: move a record, or every record with a tag, between envs through the target's own rules. Provenance is recorded andpromote_ignorepaths stay env-local (#47).- List edits in
cfg set:orgs+=x/orgs-=x, race-safe (#49). - Per-collection validation:
validate = { schema = ... }(JSON Schema, needscfgit[validate]) or{ python = "mod:fn" }. Runs on every write path;--no-validateis audited (#46). - History read contract:
cfg logentries carry field-levelchanges; new--since;last_changed_atin status; Python APIcfg.history()/cfg.heads()(docs/HISTORY_CONTRACT.md) (#48). - Notifications on writes (
[env.<name>.notify], webhook / Slack, field paths only by default), and code references incfg impactviacode_refs;cfg rmrefuses while code still reads the id (#50).
Fixed
- Datetimes, decimals, ObjectIds, binary and UUIDs keep their type through bulk commit,
cfg editand export → import. A write that would silently turn one into a string is refused (--allow-type-changeto override) (#51). - Secret scan: credential-looking names no longer block numeric, boolean, null or datetime values; strings and binary are still checked (#51).
- Ignored fields are never changed by a write. Previously a full-document commit, bulk, import, restore, promote or merge could overwrite or delete fields matched by
ignore_patterns/ignore_paths(Mongo), or any ignored field (Postgres), with nothing in the preview (#53). - Concurrent writes:
cfg set,cfg editandcfg promoterefuse withstale_baseinstead of overwriting a write that landed in between. MCPcfg_commitacceptsexpected_live_oidfor the same protection.
Upgrading from 0.4.x
No data migration: 0.5.0 reads everything 0.4.x wrote, and no command or flag was removed. These behaviour changes can surprise a script. Full guide: docs/UPGRADING.md.
- Upgrade both packages together:
pip install -U 'cfgit==0.5.0' 'cfgit-impact==0.5.0'. The 0.4.7 plugin pinscfgit<0.5. - Type changes are refused. A payload that would turn a live datetime, decimal, ObjectId, binary or UUID into a string (e.g. built with
json.dumps(..., default=str)) getsTypeChangeBlocked. Send Extended JSON ({"$date": ...}), or use--allow-type-changeif it's intended. - Old export files. 0.4.x exports (
version: 1, dates as strings) are refused by the same rule when imported over real datetimes. Re-export with 0.5, convert the dates, or use--allow-type-change. - New export files.
cfg exportnow writesversion: 2(Extended JSON). Don't import these with cfgit 0.4.x; it would store the{"$date": ...}wrappers literally. - Concurrent edits return
stale_base(exit 2).set,editandpromoterefuse instead of overwriting a write that landed in between. Rerun the same command. A refusedcfg editkeeps your edit in a temp file. - Ignored fields are never written. If something relied on a commit setting an ignored field (e.g.
updated_aton Postgres), that no longer happens. - Timestamps on Mongo in
log/status/cfg.historynow carry+00:00; previously they had no offset. - JSON output gains fields (
changes,last_changed_at, new states and summary counters). Existing fields are unchanged. - Rare: don't downgrade to 0.4.x after using
cfg rm(it doesn't understand tombstones). Custom storage adapters must honourApplyItem.delete_live.
Verification
- 279 tests, including live Mongo (replica set) and Postgres runs.
- A concurrent-writer race suite: 0 failures in 20 rounds at 16 writers.
- Two independent review passes, with all findings fixed.