Skip to content

fix: gate self-upgrade for package-managed installs#27

Merged
alexandreafj merged 2 commits into
masterfrom
feat/upgrade-install-source-gating
May 2, 2026
Merged

fix: gate self-upgrade for package-managed installs#27
alexandreafj merged 2 commits into
masterfrom
feat/upgrade-install-source-gating

Conversation

@alexandreafj
Copy link
Copy Markdown
Owner

Summary

  • detect install channel from the executable path and route Homebrew/Scoop installs away from gitm upgrade with actionable guidance (brew upgrade --cask gitm / scoop update gitm)
  • disable self-upgrade on Windows and keep command visibility consistent by hiding upgrade for package-managed installs while preserving manual macOS/Linux behavior
  • add targeted tests for install-channel detection, visibility/guard behavior, and blocked-run messages; update README upgrade docs to match package-manager workflows

Validation

  • rtk go test ./internal/cli -v -race -timeout 60s
  • rtk make test
  • rtk make lint

Copilot AI review requested due to automatic review settings May 2, 2026 04:57
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

✅ All checks passed (Go 1.26)

Coverage: 68.4%

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

This PR gates gitm upgrade based on install channel so package-managed installs (Homebrew/Scoop) are directed to their package manager update flow, while keeping self-upgrade available for manual installs.

Changes:

  • Add install-channel detection from executable path and block self-upgrade with actionable messages.
  • Hide the upgrade command from help output for package-managed installs.
  • Add tests for detection/hide/block behavior and update README upgrade documentation.

Reviewed changes

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

File Description
internal/cli/upgrade.go Adds install-channel detection, command hiding, and blocked-run messaging for upgrade.
internal/cli/upgrade_test.go Adds unit tests covering channel detection, hide behavior, and blocked-run errors.
README.md Updates upgrade docs to distinguish manual installs vs package-managed installs.

Comment thread internal/cli/upgrade.go
Comment thread internal/cli/upgrade.go
Comment thread README.md
Comment thread internal/cli/upgrade_test.go
Comment thread README.md
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

✅ All checks passed (Go 1.26)

Coverage: 68.4%

@alexandreafj alexandreafj merged commit 29a7582 into master May 2, 2026
1 check passed
@alexandreafj alexandreafj deleted the feat/upgrade-install-source-gating branch May 2, 2026 05:22
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