Separate concerns: remove creation logic from brev start command#247
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
Separate concerns: remove creation logic from brev start command#247devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
- Remove creation-related flags (--name, --cpu, --gpu, --setup-script, --setup-repo, --setup-path, --org, --empty) - Keep only --detached flag for non-blocking start operations - Remove creation functions: maybeStartEmpty, maybeStartFromGitURL, maybeStartWithLocalPath - Keep only maybeStartStoppedOrJoin for starting existing workspaces - Simplify StartStore interface to remove creation-related methods - Update command description and examples to reflect start-only functionality - Add helpful error messages directing users to 'brev create' for new workspaces - Fix profile.go dependency by implementing makeGitRepoFromURL function Co-Authored-By: Alec Fong <alecsanf@usc.edu>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…'instance_name' placeholder - Change startLong from 'Brev machine' to 'Brev instance' - Change startExample placeholder from 'existing_ws_name' to 'instance_name' - Maintain consistent instance-themed terminology throughout help text Co-Authored-By: Alec Fong <alecsanf@usc.edu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Separate concerns: remove creation logic from brev start command
Summary
This PR refactors the
brev startcommand to focus solely on starting existing Brev instances, removing all workspace creation functionality. This separates concerns betweenbrev start(for starting existing instances) andbrev create(for creating new instances).Key Changes:
--name,--cpu,--gpu,--setup-script,--setup-repo,--setup-path,--org,--empty--detachedflag for non-blocking start operationsmaybeStartEmpty,maybeStartFromGitURL,maybeStartWithLocalPath,createEmptyWorkspace,createNewWorkspaceFromGit,MakeNewWorkspaceFromURL, and related creation logicStartStoreto remove creation-related methodsinstance_nameplaceholdermakeGitRepoFromURLinprofile.goto replace dependency on removedstart.MakeNewWorkspaceFromURLThis is a breaking change - users attempting to create workspaces with
brev startwill now receive error messages directing them to usebrev create.Review & Testing Checklist for Human
brev start <existing_instance_name>still works correctly for stopped instancesbrev start <non_existent_instance>andbrev startwith no args to confirm error messages are helpful and direct users tobrev createbrev start <instance> --detachedworks and doesn't block the shellbrev createcommand still works properly for workspace creationMakeNewWorkspaceFromURL,maybeStartEmpty, etc.Recommended test plan: Create a test instance with
brev create, stop it, then start it withbrev startto verify the full workflow still works end-to-end.Diagram
%%{ init : { "theme" : "default" }}%% graph TD StartCmd["pkg/cmd/start/start.go<br/>NewCmdStart()"]:::major-edit StartStore["StartStore interface"]:::major-edit RunStart["runStartWorkspace()"]:::major-edit MaybeStart["maybeStartStoppedOrJoin()"]:::context StartTest["pkg/cmd/start/start_test.go"]:::minor-edit ProfileCmd["pkg/cmd/profile/profile.go"]:::minor-edit CreateCmd["pkg/cmd/create/create.go"]:::context StartCmd --> StartStore StartCmd --> RunStart RunStart --> MaybeStart StartTest -.-> StartCmd ProfileCmd -.-> StartCmd subgraph "Removed Functions" RemovedFuncs["maybeStartEmpty()<br/>maybeStartFromGitURL()<br/>createEmptyWorkspace()<br/>MakeNewWorkspaceFromURL()"]:::removed end StartCmd -.->|"removed dependencies"| RemovedFuncs ProfileCmd -.->|"replaced with<br/>makeGitRepoFromURL()"| RemovedFuncs subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context L4[Removed]:::removed end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFF classDef removed fill:#FFB6C1Notes
brev startfunctionality while removing the creation aspect--detachedflag behavior is preserved for non-blocking operationsbrev createfor workspace creationLink to Devin run: https://app.devin.ai/sessions/8102944e41954c7b86d9860ea4b8adc4
Requested by: @theFong