feat: add --install-name flag with back-compat symlink - #24
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe CLI adds an ChangesInstall name packaging
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant doPackage
participant NamingHelpers
participant nfpm
CLI->>doPackage: pass --install-name
doPackage->>NamingHelpers: resolve package and binary names
NamingHelpers-->>doPackage: return App, Binary, BinName
doPackage->>nfpm: render package contents
nfpm-->>doPackage: create package with binary and optional symlink
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
Add an opt-in --install-name flag that overrides the name the binary is
installed as under /usr/local/bin (default: the package name, i.e. current
behavior). When the install name differs from the package name, the template
also emits a back-compat symlink at the package name pointing to it.
This is for the AIStor server rename minio -> aistor: callers pass
--install-name aistor so the deb/rpm/apk packages install /usr/local/bin/aistor
and /usr/local/bin/minio -> aistor. The shipped minio.service (which execs
/usr/local/bin/minio) keeps working through the symlink, and existing
deployments keep the minio command.
Keeping this behind a flag (rather than hardcoding it for minio-enterprise)
decouples the rename from the pkger version: bumping pkger for unrelated
reasons no longer implies a rename, activation is explicit per release, and it
can be reverted from the caller without a new pkger release. The flag is
generic, so other packages can reuse it.
Refactors the previously inlined per-app name logic into helpers:
- pkgName - nfpm package name ("name:"); unchanged
- binarySrcName - artifact read from the release dir; unchanged
- resolveBinName - install path; = package name unless --install-name is set
Default output (no flag) is byte-identical to before for every app. minio.service
is shipped unchanged; package name is unchanged, so upgrades are in-place with
no Conflicts/Replaces.
Validated: with --install-name aistor the file<->symlink transition is clean in
both directions on deb (dpkg), rpm, and apk, including the case of an
older-style package (real minio file) landing over a renamed install.
Also bump the Go toolchain to 1.26.5 and go-git to v5.19.1 (GO-2026-5496,
GO-2026-4910, GO-2026-4909) to fix the failing VulnCheck CI.
8c3dcf7 to
d598f8d
Compare
|
Still iterating on this. |
What
Adds an opt-in
--install-name <name>flag that overrides the name the binaryis installed as under
/usr/local/bin(default: the package name — no behaviorchange unless a caller passes it). When the install name differs from the
package name, a back-compat symlink at the package name is also emitted.
Motivating use — the AIStor rename
minio→aistor: with--install-name aistor, deb/rpm/apk install/usr/local/bin/aistorplus/usr/local/bin/minio -> aistor.minio.serviceis shipped unchanged (it execs/usr/local/bin/minio,which resolves through the symlink), so existing units and the
miniocommandkeep working. Package name is unchanged, so upgrades stay in-place.
Why a flag
Decouples the rename from the pkger version: bumping pkger for unrelated reasons
no longer implies a rename, activation is explicit per release, and it's
revertible from the caller without a new pkger release. It's generic, so other
packages can reuse it.
Testing
no rename/symlink without it (default output is byte-identical to before).
alpine:3.20): fresh install, upgrade (file→symlink), downgrade (symlink→file),
and an older-style package over a renamed install — all clean, exit 0,
miniorunnable throughout.Scope
Packages only; the dl.min.io binary, goreleaser artifact, docker, and Homebrew
stay
minio. Consumers activate by passing--install-name aistorand bumpingtheir pinned pkger version.
Summary by CodeRabbit
New Features
--install-nameoption to customize the installed command name.Bug Fixes
Tests