feat(cmd): rename upgrade command to self-update#192
Conversation
Free the `upgrade` verb for devcontainer feature upgrades by renaming the CLI self-update command from `upgrade` to `self-update`.
✅ Deploy Preview for devsydev canceled.
|
📝 WalkthroughWalkthroughThe PR renames the CLI's upgrade command to self-update by changing the exported command struct and constructor function from ChangesSelf-Update Command Rename
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
e2e/tests/selfupdate/selfupdate.go (1)
20-23: 💤 Low valuePrefer
filepath.Joinover string concatenation for path construction.
initialDir + "/bin"works on Linux/macOS, butfilepath.Joinis idiomatic Go and portable.♻️ Proposed refactor
import ( "context" "os" + "path/filepath" "runtime" "strings" ... ) -f := framework.NewDefaultFramework(initialDir + "/bin") +f := framework.NewDefaultFramework(filepath.Join(initialDir, "bin"))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@e2e/tests/selfupdate/selfupdate.go` around lines 20 - 23, Replace the string-concatenated path initialDir + "/bin" with a portable filepath.Join(initialDir, "bin") when constructing the argument to framework.NewDefaultFramework; update the imports to include "path/filepath" if missing and pass filepath.Join(initialDir, "bin") to NewDefaultFramework so path construction is platform-independent (refer to the initialDir variable and NewDefaultFramework call).cmd/root.go (1)
128-128: Consider surfacing a migration hint for users of the oldupgradecommand.Since
devsy upgradeis being removed with no Cobra alias, any user script or CI pipeline that callsdevsy upgradewill now receive a generic "unknown command" error with no guidance. Given theupgradeverb can't be aliased (it's being reserved for a future subcommand), a brief note in release notes or the command'sLongdescription pointing to the rename would improve the upgrade experience.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmd/root.go` at line 128, Add a brief migration hint for users of the removed "upgrade" command by updating the Long help text for the new self-update command (NewSelfUpdateCmd) or the rootCmd description: mention that "devsy upgrade" was renamed to "devsy self-update" (or whichever new verb is provided), provide a short migration note or link to release notes, and ensure the hint appears in CLI help output so scripts/CI users seeing "unknown command" can find the rename; modify the Long field returned by NewSelfUpdateCmd (or the rootCmd help string) accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@cmd/root.go`:
- Line 128: Add a brief migration hint for users of the removed "upgrade"
command by updating the Long help text for the new self-update command
(NewSelfUpdateCmd) or the rootCmd description: mention that "devsy upgrade" was
renamed to "devsy self-update" (or whichever new verb is provided), provide a
short migration note or link to release notes, and ensure the hint appears in
CLI help output so scripts/CI users seeing "unknown command" can find the
rename; modify the Long field returned by NewSelfUpdateCmd (or the rootCmd help
string) accordingly.
In `@e2e/tests/selfupdate/selfupdate.go`:
- Around line 20-23: Replace the string-concatenated path initialDir + "/bin"
with a portable filepath.Join(initialDir, "bin") when constructing the argument
to framework.NewDefaultFramework; update the imports to include "path/filepath"
if missing and pass filepath.Join(initialDir, "bin") to NewDefaultFramework so
path construction is platform-independent (refer to the initialDir variable and
NewDefaultFramework call).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 586eea18-2e3b-4d50-8034-340e6ca4c505
📒 Files selected for processing (6)
cmd/root.gocmd/self_update.gocmd/self_update_test.goe2e/e2e_suite_test.goe2e/tests/selfupdate/selfupdate.goe2e/tests/upgrade/upgrade.go
💤 Files with no reviewable changes (1)
- e2e/tests/upgrade/upgrade.go
Summary
Renames the CLI self-update command from
upgradetoself-updateto free theupgradeverb for devcontainer feature upgrades (per spec alignment). Adds unit tests verifying the command name, flags, and argument constraints. Renames the E2E test directory and updates all imports accordingly. The internalpkg/upgrade/package is unchanged — only user-facing command naming is affected.Summary by CodeRabbit
New Features
Tests