Skip to content

Fix create_be passing -e and the BE name as a single argument - #9

Merged
ericbsd merged 2 commits into
masterfrom
ghostbsd/issues#218
Sep 16, 2026
Merged

ericbsd merged 2 commits into
masterfrom
ghostbsd/issues#218

Conversation

@ericbsd

@ericbsd ericbsd commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

create_be built the command with f'-e {non_active_be}', so bectl received "-e name" as one argv element and the create failed whenever a source BE was given. Build the command left to right instead, in the same order as bectl's usage (create [-r] [-e nonActiveBe] newBeName), which also removes the index juggling and the unused option variable.

Also fix grammar in the docstrings and remove the leading whitespace on the .vscode/ and .idea/ entries in .gitignore so they actually match.

Resolves ghostbsd/issues#218

Claude-Session: https://claude.ai/code/session_01WRs35f97CmmkH3uEvB6FrX

Summary by Sourcery

Fix backend creation argument handling and tidy project metadata and documentation.

Bug Fixes:

  • Fix backend creation with a source BE by passing bectl options and names as separate arguments in the correct order.

Enhancements:

  • Correct grammar in BE management docstrings.
  • Bump the project version to 0.7.

Chores:

  • Fix IDE entries in .gitignore so they match correctly.

create_be built the command with f'-e {non_active_be}', so bectl
received "-e name" as one argv element and the create failed whenever
a source BE was given. Build the command left to right instead, in the
same order as bectl's usage (create [-r] [-e nonActiveBe] newBeName),
which also removes the index juggling and the unused option variable.

Also fix grammar in the docstrings and remove the leading whitespace
on the .vscode/ and .idea/ entries in .gitignore so they actually match.

Resolves ghostbsd/issues#218

Claude-Session: https://claude.ai/code/session_01WRs35f97CmmkH3uEvB6FrX
@ericbsd
ericbsd requested review from a team as code owners September 15, 2026 20:51
@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Fixes create_be to pass the source BE option and value as distinct arguments in the order expected by bectl, while simplifying command construction; also updates docstring grammar and repairs IDE-related .gitignore patterns.

Sequence diagram for corrected create_be command construction

sequenceDiagram
    participant Caller
    participant create_be
    participant bectl
    Caller->>create_be: create_be(new_be_name, non_active_be, recursive)
    create_be->>create_be: append -r when recursive
    create_be->>create_be: extend -e and non_active_be
    create_be->>create_be: append new_be_name
    create_be->>bectl: run(cmd_list)
    bectl-->>create_be: returncode 0
Loading

File-Level Changes

Change Details Files
Construct the bectl create argument vector as separate argv elements in usage order.
  • Start with bectl create and append -r when recursive creation is requested.
  • Append -e and the source BE as separate arguments when provided.
  • Append the new BE name last, eliminating the unused option variable and index-based insertion.
bectl.py
Correct grammar and terminology in BE operation docstrings.
  • Use third-person singular descriptions for activate, create, destroy, and list operations.
  • Hyphenate “non-active” in the create parameter documentation.
bectl.py
Correct ignore patterns for IDE metadata.
  • Remove leading whitespace from .vscode/ and .idea/ entries so Git applies the patterns.
.gitignore

Assessment against linked issues

Issue Objective Addressed Explanation
ghostbsd/issues#218 Ensure Backup Station creates a new boot environment from the selected source boot environment rather than implicitly using the currently booted environment. ✅

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. The change alters the arguments used to create a boot environment, so a defect could create the wrong environment or source it from the wrong one. Reverting the code would not remove an already-created environment, but the resulting state is bounded and can be inspected and deleted or recreated.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@ericbsd
ericbsd merged commit 37954e2 into master Sep 16, 2026
1 check passed
@ericbsd
ericbsd deleted the ghostbsd/issues#218 branch September 16, 2026 11:14
@github-project-automation github-project-automation Bot moved this from In Review to Done in Development Tracker Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Backup Station should create a BE from the selected BE instead of the booted one.

2 participants