Skip to content

feat: add deployments show subcommand - #125

Merged
Ruari-Phipps merged 7 commits into
mainfrom
ruari/feat/deployments_view
May 8, 2026
Merged

feat: add deployments show subcommand#125
Ruari-Phipps merged 7 commits into
mainfrom
ruari/feat/deployments_view

Conversation

@Ruari-Phipps

@Ruari-Phipps Ruari-Phipps commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds poly deployments show <hash> subcommand to display detailed metadata for a specific deployment and the sandbox deployments included since the previous version in the given environment.

Motivation

When reviewing deployment history, users need to drill into a specific version to see its full metadata (deployment ID, artifact version, lambda version, message, etc.) and understand which sandbox deployments were bundled into a promotion to pre-release or live.

Changes

  • Add show subparser under deployments with hash positional arg and --env flag (sandbox/pre-release/live)
  • Add deployments_show() and _resolve_included_deployments() methods to AgentStudioCLI
  • Add print_deployment_show() rich console output function
  • Add comprehensive tests covering error cases, JSON output, cross-env resolution, hash prefix matching, and rich output path

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

Default sandbox:
Screenshot 2026-05-01 at 16 23 20
Live push:
Screenshot 2026-05-01 at 16 23 13

@Ruari-Phipps
Ruari-Phipps requested a review from a team May 1, 2026 15:15
@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.

Copilot AI left a comment

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.

Pull request overview

Adds a new poly deployments show <hash> CLI subcommand to inspect a single deployment’s full metadata and compute the sandbox deployments included since the prior deployment in the selected environment (sandbox/pre-release/live).

Changes:

  • Added deployments show argparse subcommand with positional hash and --env selector.
  • Implemented AgentStudioCLI.deployments_show() plus shared _resolve_included_deployments() slicing logic for included/rollback determination.
  • Added Rich console rendering via print_deployment_show() and comprehensive CLI tests for JSON/rich output and cross-environment inclusion resolution.

Reviewed changes

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

File Description
src/poly/cli.py Adds the deployments show subcommand, routing in _run_command, and the deployments_show() / _resolve_included_deployments() implementations.
src/poly/output/console.py Adds Rich output helper print_deployment_show() to render a deployment plus its included deployments.
src/poly/tests/cli_test.py Adds DeploymentsShowTest coverage for error cases, JSON structure, env routing, hash-prefix matching, and rich output invocation.

Comment thread src/poly/cli.py Outdated
Comment on lines +518 to +526
version_hash = deployment.get("version_hash")
deployment_type = meta.get("deployment_type")
deployment_message = meta.get("deployment_message") or "-"
created_at = deployment.get("created_at", "")
created_by = deployment.get("created_by", "")
deployment_id = deployment.get("id")
client_env = deployment.get("client_env")
artifact_version = deployment.get("artifact_version")
lambda_deployment_version = deployment.get("function_deployment_version")
Comment thread src/poly/cli.py Outdated

@oeisenberg oeisenberg left a comment

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.

might want to review the Copilot comments

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
71.7% 71.4% -0.3% ⚠️

Changed file coverage

File Coverage Change
poly/output/console.py 31.2% -3.6% ⚠️
poly/cli.py 53.2% +0.5% ✅

@Ruari-Phipps
Ruari-Phipps merged commit 6cfd07d into main May 8, 2026
5 checks passed
@Ruari-Phipps
Ruari-Phipps deleted the ruari/feat/deployments_view branch May 8, 2026 13:52
AaronForinton added a commit that referenced this pull request May 14, 2026
## Summary

This work relates to PR #125 

## Motivation

<!-- Why is this change needed? Link to an issue if applicable. -->

Closes #<!-- issue number -->

## Changes

<!-- Bullet list of the key changes. Focus on *what* changed, not *how*.
-->

-

## Test strategy

<!-- How did you verify this works? Check all that apply. -->

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

## Checklist

- [ ] `ruff check .` and `ruff format --check .` pass
- [ ] `pytest` passes
- [x] No breaking changes to the `poly` CLI interface (or migration path
documented)
- [ ] Commit messages follow [conventional
commits](https://www.conventionalcommits.org/)

## Screenshots / Logs

<!-- Optional: paste terminal output, screenshots, or before/after diffs
if helpful. -->

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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