Add deployment history view #48

Open
opened 2026-01-03 23:45:57 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-01-03 23:45:57 +00:00 (Migrated from github.com)

User Story

As a developer, I want to view deployment history so I can see what versions were deployed, when, and by whom.

Design

Command Interface

# View last 10 deployments
qrun history --app orders-service --env prod

# View more history
qrun history --app orders-service --env prod --limit 50

# Filter by date range
qrun history --app orders-service --env prod --since 7d

# JSON output
qrun history --app orders-service --env prod --output json

# Show details for specific deployment
qrun history --app orders-service --env prod --deployment dep-abc123

Output Format

Deployment History: orders-service (prod)

ID          Version  Status    Deployed At           Deployed By    Duration
dep-abc123  1.2.3    success   2024-01-15 10:30:00   james.maes     45s
dep-def456  1.2.2    success   2024-01-14 15:20:00   ci-pipeline    52s
dep-ghi789  1.2.1    failed    2024-01-14 14:00:00   james.maes     2m 30s
dep-jkl012  1.2.0    success   2024-01-13 09:15:00   ci-pipeline    38s

Showing 4 of 23 deployments. Use --limit to see more.

Voyage API Integration

GET /v1/apps/{app}/deployments?env={env}&limit=10&since=7d

Response:
{
  "app": "orders-service",
  "environment": "prod",
  "deployments": [
    {
      "id": "dep-abc123",
      "version": "1.2.3",
      "status": "success",
      "deployedAt": "2024-01-15T10:30:00Z",
      "deployedBy": "james.maes",
      "duration": 45,
      "rollbackOf": null
    }
  ],
  "total": 23
}

Files to Create/Modify

File Action Purpose
qctl-qrun/src/main/java/io/qrun/qctl/qrun/HistoryCommand.java Create Main history command
qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/Deployment.java Create Deployment model
qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/DeploymentHistory.java Create History response model
qctl-qrun/src/main/java/io/qrun/qctl/qrun/client/VoyageClient.java Modify Add getDeploymentHistory()
qctl-qrun/src/main/java/io/qrun/qctl/qrun/format/HistoryFormatter.java Create History table formatting

Implementation Tasks

  • Create HistoryCommand with Picocli annotations
  • Add --app, --env, --limit, --since, --output, --deployment options
  • Create Deployment and DeploymentHistory models
  • Implement VoyageClient.getDeploymentHistory() method
  • Create HistoryFormatter for table output
  • Parse --since duration (7d, 30d, 1y formats)
  • Add color coding for status (green=success, red=failed)
  • Show rollback indicator when applicable
  • Support detailed view for single deployment
  • Write unit tests for HistoryCommand

Acceptance Criteria

  • qrun history --app <app> --env <env> shows recent deployments
  • --limit controls number of deployments shown
  • --since filters by date range
  • --output json produces valid JSON
  • --deployment shows details for specific deployment
  • Failed deployments highlighted in red
  • Rollbacks clearly indicated
  • Works with Voyage mock API
## User Story As a developer, I want to view deployment history so I can see what versions were deployed, when, and by whom. ## Design ### Command Interface ```bash # View last 10 deployments qrun history --app orders-service --env prod # View more history qrun history --app orders-service --env prod --limit 50 # Filter by date range qrun history --app orders-service --env prod --since 7d # JSON output qrun history --app orders-service --env prod --output json # Show details for specific deployment qrun history --app orders-service --env prod --deployment dep-abc123 ``` ### Output Format ``` Deployment History: orders-service (prod) ID Version Status Deployed At Deployed By Duration dep-abc123 1.2.3 success 2024-01-15 10:30:00 james.maes 45s dep-def456 1.2.2 success 2024-01-14 15:20:00 ci-pipeline 52s dep-ghi789 1.2.1 failed 2024-01-14 14:00:00 james.maes 2m 30s dep-jkl012 1.2.0 success 2024-01-13 09:15:00 ci-pipeline 38s Showing 4 of 23 deployments. Use --limit to see more. ``` ### Voyage API Integration ``` GET /v1/apps/{app}/deployments?env={env}&limit=10&since=7d Response: { "app": "orders-service", "environment": "prod", "deployments": [ { "id": "dep-abc123", "version": "1.2.3", "status": "success", "deployedAt": "2024-01-15T10:30:00Z", "deployedBy": "james.maes", "duration": 45, "rollbackOf": null } ], "total": 23 } ``` ## Files to Create/Modify | File | Action | Purpose | |------|--------|---------| | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/HistoryCommand.java` | Create | Main history command | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/Deployment.java` | Create | Deployment model | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/DeploymentHistory.java` | Create | History response model | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/client/VoyageClient.java` | Modify | Add getDeploymentHistory() | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/format/HistoryFormatter.java` | Create | History table formatting | ## Implementation Tasks - [ ] Create HistoryCommand with Picocli annotations - [ ] Add --app, --env, --limit, --since, --output, --deployment options - [ ] Create Deployment and DeploymentHistory models - [ ] Implement VoyageClient.getDeploymentHistory() method - [ ] Create HistoryFormatter for table output - [ ] Parse --since duration (7d, 30d, 1y formats) - [ ] Add color coding for status (green=success, red=failed) - [ ] Show rollback indicator when applicable - [ ] Support detailed view for single deployment - [ ] Write unit tests for HistoryCommand ## Acceptance Criteria - [ ] `qrun history --app <app> --env <env>` shows recent deployments - [ ] `--limit` controls number of deployments shown - [ ] `--since` filters by date range - [ ] `--output json` produces valid JSON - [ ] `--deployment` shows details for specific deployment - [ ] Failed deployments highlighted in red - [ ] Rollbacks clearly indicated - [ ] Works with Voyage mock API
Sign in to join this conversation.