Skip to content

feat: add --install-name flag with back-compat symlink - #24

Closed
donatello wants to merge 1 commit into
mainfrom
aistor-rename-symlink
Closed

feat: add --install-name flag with back-compat symlink#24
donatello wants to merge 1 commit into
mainfrom
aistor-rename-symlink

Conversation

@donatello

@donatello donatello commented Jul 14, 2026

Copy link
Copy Markdown
Member

What

Adds an opt-in --install-name <name> flag that overrides the name the binary
is installed as under /usr/local/bin (default: the package name — no behavior
change 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 minioaistor: with --install-name aistor, deb/rpm/apk install /usr/local/bin/aistor plus /usr/local/bin/minio -> aistor. minio.service is shipped unchanged (it execs /usr/local/bin/minio,
which resolves through the symlink), so existing units and the minio command
keep 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

  • Unit tests: rename + symlink + service with the flag; regression tests proving
    no rename/symlink without it (default output is byte-identical to before).
  • End-to-end with real packages across deb/rpm/apk (debian:12, rockylinux:9,
    alpine:3.20): fresh install, upgrade (file→symlink), downgrade (symlink→file),
    and an older-style package over a renamed install — all clean, exit 0,
    minio runnable throughout.

Scope

Packages only; the dl.min.io binary, goreleaser artifact, docker, and Homebrew
stay minio. Consumers activate by passing --install-name aistor and bumping
their pinned pkger version.

Summary by CodeRabbit

  • New Features

    • Added an --install-name option to customize the installed command name.
    • Preserves compatibility by providing a symlink from the package’s traditional name when the installation name changes.
  • Bug Fixes

    • Improved package generation for enterprise and community variants, including correct binary paths and service configuration.
  • Tests

    • Added coverage validating customized installation names, compatibility symlinks, binary destinations, and service inclusion.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@donatello, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 432652d8-a451-4166-a1d7-408656f0e65e

📥 Commits

Reviewing files that changed from the base of the PR and between 8c3dcf7 and d598f8d.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • .github/workflows/vulncheck.yml
  • go.mod
  • main.go
  • main_test.go
📝 Walkthrough

Walkthrough

The CLI adds an --install-name override, centralizes package and binary name resolution, and updates nfpm templates to install the selected name with an optional compatibility symlink. Tests validate enterprise and default package rendering behavior.

Changes

Install name packaging

Layer / File(s) Summary
Naming resolution and packaging wiring
main.go
The install-name flag flows into doPackage, which uses helpers to resolve package, source binary, and final installation names.
nfpm binary and symlink template
main.go
The template installs the binary at /usr/local/bin/{{ .BinName }} and adds a package-name symlink when the names differ.
Rendered package template tests
main_test.go
Tests parse rendered YAML and cover enterprise renaming, default naming, symlink behavior, binary sources, and service inclusion.

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
Loading

Suggested reviewers: harshavardhana

Poem

A rabbit hops where binaries gleam,
Naming each package a tidy dream.
One path for the tool, one link for the past,
Tests guard the mapping so changes hold fast.
Hop, hop—clean releases at last!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding an --install-name flag with compatibility symlink behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@donatello
donatello requested a review from harshavardhana July 14, 2026 23:24
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.
@donatello
donatello force-pushed the aistor-rename-symlink branch from 8c3dcf7 to d598f8d Compare July 14, 2026 23:31
@donatello
donatello marked this pull request as draft July 14, 2026 23:41
@donatello
donatello removed the request for review from harshavardhana July 14, 2026 23:42
@donatello

Copy link
Copy Markdown
Member Author

Still iterating on this.

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