Conversation
Add downgrade command to complement the existing upgrade command. Requires explicit --version/-v flag (no "latest" concept for downgrade). Handles 404/409/422 errors with user-friendly messages.
Change from generic "Proceed with upgrade?" to "Upgrade {name} to v{target}?"
matching the downgrade prompt pattern "Downgrade {name} to v{version}?".
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new downgrade command was added to the CLI for managing provider versions, with error handling for not-installed, already-on-version, and invalid-version-chain scenarios. The upgrade command's confirmation prompt was made provider-specific. Comprehensive tests cover success and error cases. Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as CLI Command
participant Auth as Auth Check
participant Prompt as User Prompt
participant Client as Client
participant API as API/Server
User->>CLI: downgrade provider v1.0.0
CLI->>Auth: _require_auth()
Auth-->>CLI: authenticated
CLI->>Prompt: "Upgrade {name} to v{target}?"
Prompt-->>User: confirmation needed
User-->>Prompt: yes/--yes flag
CLI->>Client: client.downgrade_provider(name, target_version)
Client->>API: POST downgrade request
alt Success
API-->>Client: 200 OK + new version
Client-->>CLI: success response
CLI-->>User: "Downgraded to v{version}"
else Not Installed (404)
API-->>Client: 404 Not Found
Client-->>CLI: error
CLI-->>User: exit 1, "not installed"
else Already on Version (409)
API-->>Client: 409 Conflict
Client-->>CLI: error
CLI-->>User: exit 1, "already on v{version}"
else Invalid Version Chain (422)
API-->>Client: 422 Unprocessable
Client-->>CLI: error
CLI-->>User: exit 1, "version chain" error + diagnostic
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Summary
pragma providers downgrade <provider> --version X.Y.Zcommand with confirmation promptDepends On
Test Plan
task test— 203 passedSummary by CodeRabbit