Skip to content

feat: add deployment promote and rollback commands#91

Draft
Ruari-Phipps wants to merge 12 commits intomainfrom
ruari/feat/deployments_promote_rollback
Draft

feat: add deployment promote and rollback commands#91
Ruari-Phipps wants to merge 12 commits intomainfrom
ruari/feat/deployments_promote_rollback

Conversation

@Ruari-Phipps
Copy link
Copy Markdown
Collaborator

@Ruari-Phipps Ruari-Phipps commented Apr 20, 2026

Summary

Adds poly deployments promote and poly deployments rollback subcommands, allowing users to promote a deployment to a target environment (pre-release or live) and rollback sandbox to a previous deployment version.

Motivation

Enables deployment lifecycle management directly from the CLI, removing the need to use the Agent Studio UI for promotions and rollbacks.

Changes

  • Add poly deployments promote --from <id> --to <env> command with optional --message and --force flags
  • Add poly deployments rollback --to <id> command with optional --message and --force flags
  • Add promote_deployment and rollback_deployment methods to AgentStudioProject, AgentStudioInterface, and PlatformAPIHandler
  • Refactor API URL constants: move /adk/v1 prefix from base URLs into individual route constants
  • Add new PROMOTE_URL and ROLLBACK_URL endpoint constants
  • Remove headers from debug log output

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes
  • No breaking changes to the poly CLI interface (or migration path documented)
  • Commit messages follow conventional commits

Screenshots / Logs

Screenshot 2026-04-20 at 14 41 17 Screenshot 2026-04-20 at 14 41 43

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

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 deployment lifecycle management to ADK by introducing CLI subcommands to promote deployments across environments and rollback sandbox to a previous deployment, wiring these through the project/interface/platform API layers.

Changes:

  • Add poly deployments promote and poly deployments rollback CLI subcommands (with --message, --force, --debug).
  • Add promote/rollback methods to AgentStudioProject, AgentStudioInterface, and PlatformAPIHandler.
  • Refactor Platform API URL construction to move /adk/v1 from base URLs into route constants and add promote/rollback endpoints.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 15 comments.

File Description
src/poly/project.py Adds promote_deployment / rollback_deployment methods on the project wrapper.
src/poly/handlers/platform_api.py Refactors URL prefix handling; adds promote/rollback endpoints and request methods; removes headers from debug logs.
src/poly/handlers/interface.py Exposes promote/rollback through the higher-level interface.
src/poly/cli.py Adds new deployments promote / deployments rollback CLI commands and execution paths.

Comment thread src/poly/handlers/platform_api.py
Comment thread src/poly/handlers/platform_api.py
Comment thread src/poly/project.py
Comment thread src/poly/handlers/platform_api.py
Comment thread src/poly/project.py
Comment thread src/poly/cli.py Outdated
Comment thread src/poly/cli.py Outdated
Comment thread src/poly/cli.py Outdated
Comment thread src/poly/project.py
Comment thread src/poly/cli.py Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
72.3% 72.5% +0.1% ✅

Changed file coverage

File Coverage Change
poly/handlers/platform_api.py 35.0% +1.4% ✅
poly/handlers/interface.py 55.1% +0.8% ✅
poly/cli.py 55.5% +2.8% ✅
poly/project.py 69.0% -0.3% ⚠️
poly/output/json_output.py 87.5% +25.0% ✅

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.

2 participants