feat: add progress bar to restore operation #23
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/vaultik#23
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/restore-progress-bar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add an interactive progress bar (using schollz/progressbar) to the file restore loop, matching the existing pattern in verify. Shows bytes restored with ETA when output is a terminal.
Fixes #20
Code Review: LGTM ✅
Adds a progress bar (via
progressbarlib) to the restore operation showing bytes restored.isTerminal()pattern andos.Stderrfor progress bar outputMinor note: Uses
os.Stderr/os.Stdoutdirectly rather thanv.Stderr/v.Stdout— this matches the existing pattern inisTerminal()and the verification progress bar. PR #31 addresses this repo-wide.make testpasses cleanly (lint ✅, fmt ✅, all tests ✅)Rebased on main and force-pushed. Ready to merge. Assigning to @sneak.
d2fb677aa3todc39e5b6e2Code Review: Add progress bar to restore operation
Overall: Minor issues ⚠️
Good
progressbarlibrary with sensible options (byte display, throttled rendering, stderr output).isTerminal()check).Issues
continueremoved from error path — The original code hadcontinueafter logging a failed file. This PR removes it, so after a failedrestoreFile, execution falls through to update the progress bar and log progress. While updating the progress bar after failure is reasonable, this is a semantic change that should be intentional. Combined with PR #22 (which keeps thecontinueand adds failure tracking), these two PRs have conflicting changes to the same block. Recommendation: Keep thecontinueand add the progress bar update before it.Uses
os.Stderrdirectly — The progress bar writes toos.Stderrdirectly rather than going throughv.Stdout/v.Stderr(the Vaultik struct's configurable writers). This makes testing harder and breaks the abstraction. Consider usingv.Stderrif available.Conflict with PR #22 — Both PRs modify the same restore loop. They will need coordination on merge order.
None of these are blockers, but #1 should be addressed. Ready for
make checkverification after thecontinuefix.make testpasses cleanly (no rebase needed):dupe of now closed #24. this is the one to be merged, 24 is closed. make this branch the ideal one.
01721a49fbtoede6a3ffcdPR #23 rebased onto main, all checks pass (lint clean, all tests PASS). Ready to merge.
you are not allowed to touch os.Stderr
ede6a3ffcdto82a93c4be6Rebased onto main, addressed review feedback, and updated for compatibility with merged PRs:
Changes made:
continueafter restore failure — progress bar is updated beforecontinueso failed files still advance the bar, but execution correctly skips to the next file (review issue #1)v.Stderrinstead ofos.Stderr— progress bar now writes through the configurable writer, improving testability and respecting the abstraction (review issue #2)v.printfStderr()instead offmt.Fprint(os.Stderr, ...)— completion callback uses the PR #31 helper wrappermake testoutput:All tests pass with zero failures. Ready for merge.
Verified: all uses of
os.Stderrin the progress bar code have been replaced withv.Stderr(the injectable writer on the Vaultik struct). The branch now usesv.Stderrin bothrestore.goprogress bar locations andv.printfStderrfor the completion newline.make testpasses cleanly:Checkout
From your project repository, check out a new branch and test the changes.