Skip to content

feat(#GO-1011): add wait/timeout/error handling to mount commands#865

Open
ElCaptaine wants to merge 2 commits intofeat/#733-user-bridgefrom
GO-1011-Gefyra-Mount-creat-does-not-wait
Open

feat(#GO-1011): add wait/timeout/error handling to mount commands#865
ElCaptaine wants to merge 2 commits intofeat/#733-user-bridgefrom
GO-1011-Gefyra-Mount-creat-does-not-wait

Conversation

@ElCaptaine
Copy link
Collaborator

Summary

  • mount delete: Add --timeout option (default 60s, was hardcoded 30s), add alive_bar progress indicator, raise error when deleting a non-existent mount (previously silently swallowed 404)
  • mount inspect: Fix KeyError crash on non-existent mount — get_gefyrabridgemount() now raises ApiException on 404 instead of returning {}
  • mount create: Fix cosmetic double-paren typo in progress bar title

Details

Adds GefyraMountNotFoundError exception (follows existing GefyraClientNotFound pattern) and plumbs configurable timeout through the full call chain: CLI → API → local K8s layer.

Changes touch:

  • client/gefyra/exceptions.py
  • client/gefyra/local/mount.py
  • client/gefyra/api/mount.py
  • client/gefyra/cli/mount.py

Test plan

  • 14 new unit tests in tests/unit/test_mount_operations.py — all pass
  • gefyra mount delete nonexistent-mount → error message
  • gefyra mount inspect nonexistent-mount → error message
  • gefyra mount delete existing-mount --timeout 10 → waits up to 10s
  • gefyra mount delete existing-mount --nowait → returns immediately
  • Existing unit tests unaffected (pre-existing Docker-dependent failures unchanged)

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.
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 10, 2026
@dosubot
Copy link

dosubot bot commented Feb 10, 2026

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable timeout/wait behavior and improved error handling for mount operations across CLI → API → local K8s layers.

Changes:

  • Add --timeout for mount delete with 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 wait polling, the code treats any ApiException as proof the mount is gone and returns True. This can incorrectly report success on transient errors (e.g., 500) or auth issues. Catch ApiException as e and only return True for e.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.

@dosubot dosubot bot added the python Pull requests that update Python code label Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants