r/devops • u/Many_Location3380 • 16d ago
Tools I built an open-source tool to solve polyrepo config drift without clobbering local overrides
Hey r/devops!
If you maintain multiple repositories (microservices, polyrepos, or SDKs), you probably know the pain of keeping shared configuration files in sync:
.github/workflows/*.yml.editorconfigCargo.toml/package.json
Existing file-copying bots usually clobber legitimate repo-specific overrides.
I built driftsync, an open-source CLI engine in Rust that solves this using stateful 3-way structural merging:
- Tracks baseline ancestors in
.driftsync.lock - Structural merging for TOML (via
toml_edit, preserving comments and formatting), JSON, and YAML blocks - Preserves local customizations while pulling upstream updates
- Git automation: checks out branches, commits per repo, and opens PRs
- Secret scanner to prevent accidental token leaks during template sync
You can install it directly via Cargo: cargo install driftsync
GitHub: https://github.com/liqttt/driftsync Crates.io: https://crates.io/crates/driftsync
Feedback, critique, and feature suggestions are very welcome!
1
u/MongooseWonderful198 15d ago
In
evaluate_file, a missing target hits(_, None) => Createbefore the strategy check. That includes a file recorded in.driftsync.lockthat someone deliberately deleted locally, even withKeepLocal. With the file still mapped in the manifest,apply_workspace(..., write=true)recreates it from upstream.If local deletion should count as an override,
(Some(base), None)needs a separate decision from a file that never existed, such as preserving the deletion or reporting a conflict. This is from reading the source; I haven't run the CLI.1
u/Steel_half2 13d ago
Does the lock file actually distinguish a tracked deletion from a file that just never existed?