Skip to content

fix: remove deprecated --hard flag and all references#371

Open
nisolanki1209 wants to merge 1 commit intomainfrom
BREV-9066/remove-deprecated-hard-flag
Open

fix: remove deprecated --hard flag and all references#371
nisolanki1209 wants to merge 1 commit intomainfrom
BREV-9066/remove-deprecated-hard-flag

Conversation

@nisolanki1209
Copy link
Copy Markdown
Contributor

Description

This PR removes the deprecated --hard flag from the brev reset command along with all associated logic, references, and messaging across the CLI and documentation. It ensures the flag is fully eliminated and aligns the codebase with the intended deprecation.

Solution

  • Removed --hard flag and all related logic from reset.go
  • Deleted unused helper functions and simplified reset implementation
  • Refactored recreate command for consistency and clarity
  • Updated documentation to reflect current behavior without --hard flag

@nisolanki1209 nisolanki1209 requested a review from a team as a code owner April 28, 2026 18:25
Copilot AI review requested due to automatic review settings April 28, 2026 18:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the deprecated --hard flag from brev reset and consolidates “hard reset” behavior under the brev recreate command, updating related CLI messaging and documentation.

Changes:

  • Removed --hard flag support and deleted the associated hard-reset implementation from pkg/cmd/reset/reset.go.
  • Renamed “hard reset” functions/wording in the recreate command to be recreate* for clarity.
  • Updated CLI/docs messaging to eliminate --hard references.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
pkg/cmd/reset/reset.go Drops the deprecated --hard flag and removes hard-reset helper logic from the reset command.
pkg/cmd/recreate/recreate.go Renames hard-reset functions/flow to recreate* naming for consistency.
pkg/cmd/recreate/doc.md Updates example output text to align with updated recreate messaging.
pkg/cmd/ls/ls.go Removes --hard guidance from the “reset breadcrumb” help output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/cmd/ls/ls.go
@@ -425,7 +425,7 @@ func displayLsResetBreadCrumb(t *terminal.Terminal, workspaces []entity.Workspac
}
}
if foundAResettableWorkspace {
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reset breadcrumb now prints only a blank line when a resettable instance is found. Since --hard was removed, this would be a good place to replace the old guidance with an actionable next step (e.g., suggest brev recreate <name> if brev reset doesn’t resolve the issue) rather than emitting an empty line.

Suggested change
if foundAResettableWorkspace {
if foundAResettableWorkspace {
t.Vprintf("%s", t.Green("If reset doesn't resolve the issue, recreate the instance:\n"))
for _, w := range workspaces {
if w.Status == entity.Failure || getWorkspaceDisplayStatus(w) == entity.Unhealthy {
t.Vprintf("%s", t.Yellow(fmt.Sprintf("\tbrev recreate %s\n", w.Name)))
}
}

Copilot uses AI. Check for mistakes.
Comment thread pkg/cmd/recreate/doc.md
Comment on lines 27 to +31
$ brev recreate payments-frontend
Starting hard reset 🤙 This can take a couple of minutes.
recreating 🤙 This can take a couple of minutes.
Deleting workspace - naive-pubsub.
Workspace is starting. This can take up to 2 minutes the first time.
Deleting instance - naive-pubsub.
Instance is starting. This can take up to 2 minutes the first time.
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recreate example is inconsistent: it runs brev recreate payments-frontend but the output references naive-pubsub. Update the command and output to use the same workspace/instance name throughout the example to avoid confusing users.

Copilot uses AI. Check for mistakes.
Comment thread pkg/cmd/ls/ls.go
Comment on lines 427 to +428
if foundAResettableWorkspace {
t.Vprintf("%s", t.Yellow("If this problem persists, run the command again with the --hard flag (warning: the --hard flag will not preserve uncommitted files!) \n\n"))
t.Vprintf("\n")
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters the user-facing help text emitted by displayLsResetBreadCrumb, but there doesn’t appear to be any test asserting the breadcrumb output for unhealthy/failed instances in ls_test.go. Adding a focused test that captures the printed guidance would help prevent future regressions in CLI output.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants