Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

Summary

Adds --wait flag support to Cloud subscription operations, building on the foundation from #191.

Fixes #192
Part of #175

What's Changed

  • ✅ Added AsyncOperationArgs to subscription Create, Update, and Delete commands
  • ✅ Updated command handlers to pass async_ops parameter through the call chain
  • ✅ Modified subscription_impl functions to use handle_async_response() from async_utils
  • ✅ All three operations now support --wait, --wait-timeout, and --wait-interval flags

Implementation Details

This PR follows the exact same pattern established in #191:

  1. Add AsyncOperationArgs via #[command(flatten)] to the CLI enum
  2. Pass the parameter through command handlers
  3. Replace manual task ID handling with handle_async_response() call

Testing

  • Compiles successfully
  • Clippy passes with no warnings
  • Help text shows new flags correctly
  • Manual testing with real API (requires credentials)

Example Usage

# Create subscription and wait for completion
redisctl cloud subscription create --data @config.json --wait

# Update subscription with custom timeout
redisctl cloud subscription update 123 --data @update.json --wait --wait-timeout 600

# Delete subscription with confirmation and wait
redisctl cloud subscription delete 456 --force --wait

Next Steps

After this PR, the remaining commands to update are:

- Add AsyncOperationArgs to Create, Update, and Delete subscription commands
- Update command handlers to pass async_ops parameter through
- Modify subscription_impl functions to use handle_async_response()
- Reuse async_utils module from #191 for consistent behavior

All three subscription operations now support --wait, --wait-timeout,
and --wait-interval flags for synchronous operation completion.

Fixes #192
Part of #175
@joshrotenberg joshrotenberg self-assigned this Sep 7, 2025
@joshrotenberg joshrotenberg merged commit 0065c65 into main Sep 7, 2025
9 checks passed
@joshrotenberg joshrotenberg deleted the feat/subscription-wait-flag branch September 7, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cloud): add --wait flag to subscription commands

2 participants