Implement qrun start command #46

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

User Story

As a developer, I want to start a stopped application so I can bring it back online after maintenance or when needed.

Design

Command Interface

# Start application
qrun start --app orders-service --env prod

# Start with specific version
qrun start --app orders-service --env prod --version 1.2.3

# Start with specific replica count
qrun start --app orders-service --env prod --replicas 5

Output Format

Starting orders-service in prod...
  Version: 1.2.3 (latest)
  Target replicas: 3
  
  Starting instances...
    orders-service-abc12  Starting...  Ready
    orders-service-def34  Starting...  Ready
    orders-service-ghi56  Starting...  Ready

Application orders-service started. (3/3 ready)
Status: qrun status --app orders-service --env prod

Voyage API Integration

POST /v1/apps/{app}/start
Content-Type: application/json

{
  "environment": "prod",
  "version": "1.2.3",
  "replicas": 3
}

Response:
{
  "status": "starting",
  "version": "1.2.3",
  "targetReplicas": 3,
  "message": "Application start initiated"
}

Files to Create/Modify

File Action Purpose
qctl-qrun/src/main/java/io/qrun/qctl/qrun/StartCommand.java Create Main start command
qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/StartResult.java Create Start response model
qctl-qrun/src/main/java/io/qrun/qctl/qrun/client/VoyageClient.java Modify Add startApp()

Implementation Tasks

  • Create StartCommand with Picocli annotations
  • Add --app, --env, --version, --replicas options
  • Create StartResult model class
  • Implement VoyageClient.startApp() method
  • Default to latest deployed version if not specified
  • Show startup progress with instance status
  • Wait for readiness (with timeout)
  • Display helpful status command on completion
  • Write unit tests for StartCommand

Acceptance Criteria

  • qrun start --app <app> --env <env> starts the application
  • --version allows starting specific version
  • --replicas overrides default replica count
  • Shows progress as instances start
  • Waits for instances to be ready
  • Clear error message if already running
  • Works with Voyage mock API
## User Story As a developer, I want to start a stopped application so I can bring it back online after maintenance or when needed. ## Design ### Command Interface ```bash # Start application qrun start --app orders-service --env prod # Start with specific version qrun start --app orders-service --env prod --version 1.2.3 # Start with specific replica count qrun start --app orders-service --env prod --replicas 5 ``` ### Output Format ``` Starting orders-service in prod... Version: 1.2.3 (latest) Target replicas: 3 Starting instances... orders-service-abc12 Starting... Ready orders-service-def34 Starting... Ready orders-service-ghi56 Starting... Ready Application orders-service started. (3/3 ready) Status: qrun status --app orders-service --env prod ``` ### Voyage API Integration ``` POST /v1/apps/{app}/start Content-Type: application/json { "environment": "prod", "version": "1.2.3", "replicas": 3 } Response: { "status": "starting", "version": "1.2.3", "targetReplicas": 3, "message": "Application start initiated" } ``` ## Files to Create/Modify | File | Action | Purpose | |------|--------|---------| | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/StartCommand.java` | Create | Main start command | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/model/StartResult.java` | Create | Start response model | | `qctl-qrun/src/main/java/io/qrun/qctl/qrun/client/VoyageClient.java` | Modify | Add startApp() | ## Implementation Tasks - [ ] Create StartCommand with Picocli annotations - [ ] Add --app, --env, --version, --replicas options - [ ] Create StartResult model class - [ ] Implement VoyageClient.startApp() method - [ ] Default to latest deployed version if not specified - [ ] Show startup progress with instance status - [ ] Wait for readiness (with timeout) - [ ] Display helpful status command on completion - [ ] Write unit tests for StartCommand ## Acceptance Criteria - [ ] `qrun start --app <app> --env <env>` starts the application - [ ] `--version` allows starting specific version - [ ] `--replicas` overrides default replica count - [ ] Shows progress as instances start - [ ] Waits for instances to be ready - [ ] Clear error message if already running - [ ] Works with Voyage mock API
Sign in to join this conversation.