feat(#GO-1011): add wait/timeout/error handling to mount commands#865
Open
ElCaptaine wants to merge 2 commits intofeat/#733-user-bridgefrom
Open
feat(#GO-1011): add wait/timeout/error handling to mount commands#865ElCaptaine wants to merge 2 commits intofeat/#733-user-bridgefrom
ElCaptaine wants to merge 2 commits intofeat/#733-user-bridgefrom
Conversation
mount delete: add --timeout option (default 60s, was hardcoded 30s),
add alive_bar progress indicator, raise error when deleting a
non-existent mount (was silently swallowed).
mount inspect: fix KeyError crash on non-existent mount by raising
ApiException on 404 in get_gefyrabridgemount() instead of returning {}.
mount create: fix cosmetic double-paren typo in progress bar title.
Add GefyraMountNotFoundError exception and 14 unit tests covering
the new error paths, timeout plumbing, and wait behavior.
There was a problem hiding this comment.
Pull request overview
Adds configurable timeout/wait behavior and improved error handling for mount operations across CLI → API → local K8s layers.
Changes:
- Add
--timeoutformount deletewith progress feedback and propagate timeout through API/local handler. - Make missing mounts fail loudly:
get_gefyrabridgemount()raises on 404; delete now raises a dedicated not-found error. - Add unit tests covering 404 handling, wait/timeout behavior, and timeout propagation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| client/tests/unit/test_mount_operations.py | Adds unit tests for 404 behavior, deletion wait/timeout semantics, and API parameter plumbing. |
| client/gefyra/local/mount.py | Adds timeout parameter to delete handler and raises a typed not-found error; removes 404 “return {}” behavior. |
| client/gefyra/exceptions.py | Introduces GefyraMountNotFoundError for mount-specific not-found cases. |
| client/gefyra/cli/mount.py | Adds --timeout to mount delete, progress bar output, and updated success/timeout messaging. |
| client/gefyra/api/mount.py | Adds timeout propagation to delete; converts mount-get 404 into a user-friendly error; adds retry/timeout logic during create wait loop. |
Comments suppressed due to low confidence (1)
client/gefyra/local/mount.py:71
- During
waitpolling, the code treats anyApiExceptionas proof the mount is gone and returnsTrue. This can incorrectly report success on transient errors (e.g., 500) or auth issues. CatchApiException as eand only returnTruefore.status == 404; re-raise other statuses.
while counter < timeout:
try:
get_gefyrabridgemount(config=config, name=name)
except ApiException:
return True
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
mount delete: Add--timeoutoption (default 60s, was hardcoded 30s), addalive_barprogress indicator, raise error when deleting a non-existent mount (previously silently swallowed 404)mount inspect: FixKeyErrorcrash on non-existent mount —get_gefyrabridgemount()now raisesApiExceptionon 404 instead of returning{}mount create: Fix cosmetic double-paren typo in progress bar titleDetails
Adds
GefyraMountNotFoundErrorexception (follows existingGefyraClientNotFoundpattern) and plumbs configurabletimeoutthrough the full call chain: CLI → API → local K8s layer.Changes touch:
client/gefyra/exceptions.pyclient/gefyra/local/mount.pyclient/gefyra/api/mount.pyclient/gefyra/cli/mount.pyTest plan
tests/unit/test_mount_operations.py— all passgefyra mount delete nonexistent-mount→ error messagegefyra mount inspect nonexistent-mount→ error messagegefyra mount delete existing-mount --timeout 10→ waits up to 10sgefyra mount delete existing-mount --nowait→ returns immediately