Skip to content

Add self update alias - #427

Merged
kindermax merged 1 commit into
masterfrom
agent/add-self-update-alias
Jul 30, 2026
Merged

Add self update alias#427
kindermax merged 1 commit into
masterfrom
agent/add-self-update-alias

Conversation

@kindermax

@kindermax kindermax commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add update as an alias for lets self upgrade
  • verify both command names invoke the same upgrader path
  • document the new alias in the changelog

Why

lets self update is a familiar spelling for updating a CLI. Making it a native alias preserves the existing upgrade implementation, flags, and error behavior without duplicating command logic.

User impact

Users can now run either lets self upgrade or lets self update. The --pre flag remains available through the alias.

Validation

  • lets test — 307 Go tests, 150 Bats tests, and 4 completion tests passed
  • lets lint — 0 issues
  • go run ./cmd/lets self update --help — alias resolves to the upgrade command and exposes --pre

Summary by Sourcery

Add a new update alias for the lets self upgrade command and ensure both names share the same upgrade behavior.

New Features:

  • Introduce update as an alias for the self upgrade CLI subcommand.

Documentation:

  • Document the new update alias for lets self upgrade in the changelog.

Tests:

  • Extend self command tests to verify both upgrade and update subcommands invoke the same upgrader path.

@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds an update alias for the lets self upgrade CLI subcommand, wires it through the existing upgrade command implementation, and extends tests and documentation to cover the alias.

Sequence diagram for self upgrade/update alias behavior

sequenceDiagram
    actor User
    participant CLI as lets
    participant UpgradeCommand
    participant Upgrader

    alt upgrade_or_update
        User ->> CLI: lets self upgrade
        CLI ->> UpgradeCommand: RunE
    else upgrade_or_update
        User ->> CLI: lets self update
        CLI ->> UpgradeCommand: RunE
    end

    UpgradeCommand ->> UpgradeCommand: initUpgradeCommandWith
    UpgradeCommand ->> Upgrader: createUpgrader
    Upgrader -->> UpgradeCommand: [upgrader ready]
    UpgradeCommand -->> User: [upgrade completes]
Loading

File-Level Changes

Change Details Files
Share the same upgrade implementation between self upgrade and the new self update alias.
  • Extend the upgrade command definition to declare update as an alias of upgrade.
  • Keep argument validation and execution logic unchanged so both names follow the same path and behavior.
internal/cmd/upgrade.go
Verify both self upgrade and self update invoke the upgrader through the same command path.
  • Refactor the self upgrade test to run as a table-style loop over both upgrade and update.
  • Ensure the mock upgrader is invoked regardless of which alias is used.
  • Maintain existing test setup for root and self commands while reusing it across both cases.
internal/cmd/root_test.go
Document the new update alias in the changelog.
  • Add an Unreleased changelog entry noting update as an alias for lets self upgrade.
  • Keep existing changelog entries and ordering intact.
docs/docs/changelog.md

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

@kindermax
kindermax marked this pull request as ready for review July 30, 2026 16:25
@kindermax
kindermax merged commit 7fdaf3a into master Jul 30, 2026
4 checks passed

@sourcery-ai sourcery-ai Bot left a comment

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.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant