Comparing prod and staging config
One line: flatten both files to the same key paths and compare with values masked; the real differences stand out and nothing leaks.
Why structural
A text diff treats a reordered line as a change. YAML flips on indentation, JSON on key order, and the result is noise.
A structural comparison flattens both files to key paths (db.host, servers[0].url) and compares value and type. Reordering disappears; real differences remain.
Compare with values masked
Prod and staging passwords naturally differ. Putting the raw values side by side exposes them in a screen share or screenshot.
The compare tab masks before comparing. Partial masking keeps the last characters, so a changed value is visible while the original stays hidden. Hash mode shows only same or different.
Differences that matter
Check these before a deploy.
| Type | Example | What to check |
|---|---|---|
| Changed | API_BASE_URL | that a staging URL did not reach production |
| Added | CACHE_TTL | a flag that exists only in staging |
| Removed | LOG_LEVEL | whether production now runs on a default |
| Retyped | replicas: 1 → "3" | a string that disables scaling |
| Secret | DB_PASSWORD | that two environments did not swap keys |
Limits of flattening
Arrays are compared by index. Inserting an item at the top makes every later index look changed. Check ordered lists separately.
YAML anchors and aliases are compared expanded, and comments are not part of the comparison.
Pre-deploy check
When you paste the result into a pull request, keep keys and changes, not values.
- every added key is needed in production
- every removed key has a safe default
- no key changed type
- environment URLs, buckets and project IDs are not mixed
Questions
Can I compare encrypted values?
Ciphertext differs even when the plaintext matches, so a diff tells you nothing. Compare at the plaintext stage and do not share the result.
Can I compare more than two files?
The workbench compares two. With more files, pair them by environment and compare in order.
Sources
Every example here can be pasted into the workbench as it is.
Open the workbench