feat: multi-environment support for tower deploy#248
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Support deploying to specific environments or all environments at once: - `tower deploy` (default, unchanged behavior) - `tower deploy --environment=production` / `tower deploy -e staging` - `tower deploy --all` The flags are mutually exclusive. The environment is passed as a query parameter on the deploy API endpoint.
41b4aa6 to
665e5b9
Compare
There was a problem hiding this comment.
Pull request overview
Adds multi-environment targeting support to tower deploy, aligning the CLI with backend changes that accept an explicit environment selection or an “all environments” deployment.
Changes:
- Adds
--environment/-eand--allflags to thedeploycommand, preserving default behavior when neither is provided. - Threads a new
DeployTargetthrough deploy flow to drive request parameters and user-facing success messaging. - Updates MCP
tower_deploytool to call the newdeploy_from_dirsignature.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
crates/tower-cmd/src/util/deploy.rs |
Extends deploy request helper to include environment/all-environments targeting via query parameters. |
crates/tower-cmd/src/mcp.rs |
Updates MCP deployment tool to use the new deploy function signature. |
crates/tower-cmd/src/deploy.rs |
Adds CLI flags, introduces DeployTarget, updates deploy flow messaging, and adds CLI parsing tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let encoded_environment = urlencode(env); | ||
| format!("{}/apps/{}/deploy?environment={}", base_url, app_name, encoded_environment) |
There was a problem hiding this comment.
could this lead to some environments that are impossible to use via the CLI as we don't url encode them on the other side? (or do we url_decode the env name?)
| /// | ||
| /// - `--all` → `DeployTarget::All` | ||
| /// - `--environment <name>` → `DeployTarget::Environment(name)` | ||
| /// - neither → `DeployTarget::Default` |
There was a problem hiding this comment.
I don't see a DeployTarget::Default?
socksy
left a comment
There was a problem hiding this comment.
Apart from the apparently wrong doc string looks good to me.
Updates
tower deployto support the backend changes for targeting specific environments.Adds:
--environment=<name>(-e) to target a specific environment--allto deploy to all available environments