Skip to content

feat: multi-environment support for tower deploy#248

Merged
bradhe merged 4 commits into
developfrom
bradhe/tow-1538-deploy-environment-flag
Apr 20, 2026
Merged

feat: multi-environment support for tower deploy#248
bradhe merged 4 commits into
developfrom
bradhe/tow-1538-deploy-environment-flag

Conversation

@bradhe
Copy link
Copy Markdown
Contributor

@bradhe bradhe commented Apr 14, 2026

Updates tower deploy to support the backend changes for targeting specific environments.

Adds:

  • --environment=<name> (-e) to target a specific environment
  • --all to deploy to all available environments
  • Preserves the previous behavior (deploy to default) when no flag is provided

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ebcffe53-4a80-4cc2-8f83-d5ae9e1153bd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bradhe/tow-1538-deploy-environment-flag

Comment @coderabbitai help to get the list of available commands and usage tips.

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.
@bradhe bradhe force-pushed the bradhe/tow-1538-deploy-environment-flag branch from 41b4aa6 to 665e5b9 Compare April 14, 2026 11:06
@bradhe bradhe changed the title feat: multi-environment support for tower deploy (TOW-1538) feat: multi-environment support for tower deploy Apr 14, 2026
Copy link
Copy Markdown
Contributor

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 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/-e and --all flags to the deploy command, preserving default behavior when neither is provided.
  • Threads a new DeployTarget through deploy flow to drive request parameters and user-facing success messaging.
  • Updates MCP tower_deploy tool to call the new deploy_from_dir signature.

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.

Comment thread crates/tower-cmd/src/util/deploy.rs
Comment thread crates/tower-cmd/src/util/deploy.rs
Comment thread crates/tower-cmd/src/deploy.rs
Comment on lines +125 to +126
let encoded_environment = urlencode(env);
format!("{}/apps/{}/deploy?environment={}", base_url, app_name, encoded_environment)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't see a DeployTarget::Default?

Copy link
Copy Markdown
Contributor

@socksy socksy left a comment

Choose a reason for hiding this comment

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

Apart from the apparently wrong doc string looks good to me.

@bradhe bradhe merged commit 49f0d52 into develop Apr 20, 2026
30 checks passed
@bradhe bradhe deleted the bradhe/tow-1538-deploy-environment-flag branch April 20, 2026 22:28
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.

3 participants