Skip to content

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

Merged
patelspratik merged 3 commits intomainfrom
BREV-9066/remove-deprecated-hard-flag
Apr 30, 2026
Merged

fix: remove deprecated --hard flag and all references#371
patelspratik merged 3 commits 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 Outdated
@@ -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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Intentionally left blank. The prior --hard breadcrumb caused a production incident (nemoclaw-f4a386 / BREV-9066 / the thread in #ep-brev-support) because an AI coding agent auto-executed the destructive suggestion. brev recreate is equally destructive (delete + create), so suggesting it from ls output re-introduces the same vector. Users who need a recreate can discover it via brev --help or docs, which requires a deliberate action rather than reading ls output.

Comment thread pkg/cmd/recreate/doc.md Outdated
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pushed a new commit to address this.

Comment thread pkg/cmd/ls/ls.go Outdated
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same reason as #1 — the line was kept empty on purpose to avoid any CLI output that could confuse the user or be auto-executed by an agent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we just remove the print statement altogether? what's the value in printing a new line?

Copy link
Copy Markdown
Contributor

@arush070 arush070 Apr 30, 2026

Choose a reason for hiding this comment

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

Done, bare newline removed. Can we get a review and approval after the new push?
@patelspratik @stephahart

@arush070 arush070 self-assigned this Apr 29, 2026
stephahart
stephahart previously approved these changes Apr 29, 2026
@patelspratik patelspratik merged commit 2d876de into main Apr 30, 2026
9 checks passed
@patelspratik patelspratik deleted the BREV-9066/remove-deprecated-hard-flag branch April 30, 2026 03:03
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.

5 participants