Disable self-upgrade and version check for package-manager installs#887
Disable self-upgrade and version check for package-manager installs#887gvnnn wants to merge 2 commits into
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
WalkthroughManaged install detection is added to osdctl. A new ChangesManaged Install Detection and Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gvnnn The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
When osdctl is installed via COPR or Homebrew, the self-upgrade command would overwrite a file owned by the package manager and the version-check nag is unhelpful. This adds a build-time InstallMethod variable (set via ldflags) that disables both behaviors and directs users to their package manager instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/upgrade.go`:
- Around line 29-33: When utils.IsManagedInstall() is true, the current message
may print an empty command if utils.UpgradeInstruction() returns an
unmapped/non-empty InstallMethod but no instruction; update the branch around
utils.IsManagedInstall() so you compute a non-empty fallback before formatting:
call utils.UpgradeInstruction(), and if it returns an empty string, set a
fallback string that uses utils.InstallMethod (e.g., "use your system package
manager or contact your administrator for upgrade instructions for
<InstallMethod>") and then pass that fallback into fmt.Fprintf so the user never
sees an empty upgrade instruction; adjust the code that currently references
utils.InstallMethod and utils.UpgradeInstruction() accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: bb223b60-1a67-4d0f-af45-de88075fe7ed
📒 Files selected for processing (8)
cmd/cmd.gocmd/upgrade.gocmd/upgrade_test.gocmd/version.gohack/copr.shhack/osdctl.specpkg/utils/version.gopkg/utils/version_test.go
UpgradeInstruction() now returns an error for unrecognized InstallMethod values, surfacing build misconfigurations instead of printing an empty upgrade instruction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@gvnnn: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
When osdctl is installed via COPR or Homebrew, the self-upgrade command would overwrite a file owned by the package manager and the version-check nag is unhelpful. This adds a build-time InstallMethod variable (set via ldflags) that disables both behaviors and directs users to their package manager instead.