Implement qbit update command #30

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

Part of #11

User Story

As a developer, I want to update qbit packages to their latest compatible versions so I can get bug fixes and new features.

Design

Command Interface

qctl qbit update [package]

# Examples:
qctl qbit update                    # Update all packages
qctl qbit update @qrun/auth-sso     # Update specific package
qctl qbit update --dry-run          # Show what would be updated

Output Format

Checking for updates...

Package              Current   Latest    Status
@qrun/auth-sso       2.0.1     2.1.0     update available
@qrun/reports        1.3.0     1.3.0     up to date
@qrun/data-import    0.9.0     1.0.0     major update (requires --major)

Updated 1 package:
  @qrun/auth-sso: 2.0.1 -> 2.1.0

Workflow

  1. Read current lockfile
  2. For each package (or specified package):
    • Fetch latest versions from registry
    • Find highest version matching original constraint
    • Compare with current installed version
  3. If --dry-run, print table and exit
  4. Download and verify new packages
  5. Update lockfile with new versions
  6. Print summary

Files to Create/Modify

File Action Description
qctl-qbit/src/main/java/io/qrun/qctl/qbit/UpdateCommand.java Create Picocli command for qbit update
qctl-qbit/src/main/java/io/qrun/qctl/qbit/QbitCommand.java Modify Register UpdateCommand

Flags

Flag Description
--dry-run Show what would be updated without making changes
--major Allow major version updates (breaking changes)

Implementation Tasks

  • Create UpdateCommand with Picocli annotations
  • Add optional package positional parameter
  • Implement --dry-run flag
  • Implement --major flag for major version updates
  • Fetch latest versions for installed packages
  • Compare versions and determine update eligibility
  • Reuse download/verify logic from AddCommand
  • Update lockfile atomically
  • Print formatted table with update status
  • Register UpdateCommand in QbitCommand.subcommands
  • Add unit tests for version comparison
  • Add integration test for update workflow

Acceptance Criteria

  • qbit update updates all packages to latest compatible
  • qbit update @qrun/auth-sso updates only that package
  • --dry-run shows updates without making changes
  • Major updates require --major flag
  • Lockfile is updated atomically
  • Clear output showing what was updated
Part of #11 ## User Story As a developer, I want to update qbit packages to their latest compatible versions so I can get bug fixes and new features. ## Design ### Command Interface ```bash qctl qbit update [package] # Examples: qctl qbit update # Update all packages qctl qbit update @qrun/auth-sso # Update specific package qctl qbit update --dry-run # Show what would be updated ``` ### Output Format ``` Checking for updates... Package Current Latest Status @qrun/auth-sso 2.0.1 2.1.0 update available @qrun/reports 1.3.0 1.3.0 up to date @qrun/data-import 0.9.0 1.0.0 major update (requires --major) Updated 1 package: @qrun/auth-sso: 2.0.1 -> 2.1.0 ``` ### Workflow 1. Read current lockfile 2. For each package (or specified package): - Fetch latest versions from registry - Find highest version matching original constraint - Compare with current installed version 3. If `--dry-run`, print table and exit 4. Download and verify new packages 5. Update lockfile with new versions 6. Print summary ### Files to Create/Modify | File | Action | Description | |------|--------|-------------| | `qctl-qbit/src/main/java/io/qrun/qctl/qbit/UpdateCommand.java` | Create | Picocli command for `qbit update` | | `qctl-qbit/src/main/java/io/qrun/qctl/qbit/QbitCommand.java` | Modify | Register `UpdateCommand` | ### Flags | Flag | Description | |------|-------------| | `--dry-run` | Show what would be updated without making changes | | `--major` | Allow major version updates (breaking changes) | ## Implementation Tasks - [ ] Create `UpdateCommand` with Picocli annotations - [ ] Add optional `package` positional parameter - [ ] Implement `--dry-run` flag - [ ] Implement `--major` flag for major version updates - [ ] Fetch latest versions for installed packages - [ ] Compare versions and determine update eligibility - [ ] Reuse download/verify logic from `AddCommand` - [ ] Update lockfile atomically - [ ] Print formatted table with update status - [ ] Register `UpdateCommand` in `QbitCommand.subcommands` - [ ] Add unit tests for version comparison - [ ] Add integration test for update workflow ## Acceptance Criteria - [ ] `qbit update` updates all packages to latest compatible - [ ] `qbit update @qrun/auth-sso` updates only that package - [ ] `--dry-run` shows updates without making changes - [ ] Major updates require `--major` flag - [ ] Lockfile is updated atomically - [ ] Clear output showing what was updated
Sign in to join this conversation.