fix: write default backup to cwd and print saved path#688
Merged
miparnisari merged 1 commit intoauthzed:mainfrom May 4, 2026
Merged
fix: write default backup to cwd and print saved path#688miparnisari merged 1 commit intoauthzed:mainfrom
miparnisari merged 1 commit intoauthzed:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #688 +/- ##
==========================================
- Coverage 43.67% 43.60% -0.08%
==========================================
Files 38 38
Lines 6152 6178 +26
==========================================
+ Hits 2687 2694 +7
- Misses 3188 3204 +16
- Partials 277 280 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
miparnisari
approved these changes
May 4, 2026
Contributor
miparnisari
left a comment
There was a problem hiding this comment.
Thank you! Tested locally and works great.
Signed-off-by: ivanauth <ivan@authzed.com>
b95898f to
35f6a24
Compare
miparnisari
reviewed
May 4, 2026
| // printBackupFileLocation prints the absolute path of the backup file to stderr, | ||
| // unless the destination is stdout (i.e. "-"). | ||
| func printBackupFileLocation(filename string) { | ||
| if filename == "-" { |
Contributor
There was a problem hiding this comment.
TIL. Could you add tests for this? It was introduced in https://github.com/authzed/zed/pull/285/files and I think at some point we broke it, because I get
$ ./zed backup create - --log-level trace
12:13PM DBG configured logging async=false format=auto log_level=trace provider=zerolog
12:13PM TRC context={"APIToken":"super-secret-key","CACert":null,"Endpoint":"localhost:50051","HostnameOverride":"","Insecure":true,"Name":"local","NoVerifyCA":false} context-override-via-cli=false
12:13PM WRN not calling a released version of SpiceDB version=97811cf1455d-dirty
12:13PM TRC parsed trailers trailers={"io.spicedb.debug.version":["97811cf1455d-dirty"],"io.spicedb.respmeta.cachedoperationscount":["0"],"io.spicedb.respmeta.dispatchedoperationscount":["1"],"x-request-id":["7ac1f5c6-92b2-42b2-926f-ae5192c9dd38"]}
12:13PM DBG extracted response dispatch metadata cached=0 dispatch=1
// ommitted for brevity
412:13PM ERR terminated with errors error="failed to store cursor in lockfile: cannot create temp file: open /dev/stdout.lock343325193: operation not permitted\nsync /dev/stdout: inappropriate ioctl for device"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #679.
zed backup create(with no filename arg) now writes the.zedbackupto the current working directory instead of the directory of thezedbinary.zed backup createandzed backup redactnow printBackup written to <abs-path>on stderr after a successful close, so users can see where the file ended up.backupRedactCmdFuncswitched to a named return(err error)so the existingdefer CloseAndJoin(&err, ...)calls actually propagate close errors to the caller (they were previously mutating a shadowed local).