Skip to content

Avoid duplicate bundle exec command prefixes - #143

Open
OskarEichler wants to merge 1 commit into
capistrano:masterfrom
OskarEichler:codex/idempotent-command-prefixes
Open

Avoid duplicate bundle exec command prefixes#143
OskarEichler wants to merge 1 commit into
capistrano:masterfrom
OskarEichler:codex/idempotent-command-prefixes

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Make bundler:map_bins idempotent while preserving existing command prefixes and their order.

Reproduction and verification

Set bundle_bins to ['rake', 'rake', 'custom'] and invoke the task twice with Rake reenable. Baseline adds four bundle exec prefixes for rake and two for custom. The candidate adds one each. A separate case preserves a preceding rbenv exec prefix across ten invocations.

The combined installed-release candidate passes 44 focused command checks and 501 generated path/prefix cases. Five additional scenarios use real Capistrano 3.20.1, Rake and SSHKit 1.25.1 with an Abstract recording backend, including installation failure propagation. The backend records commands and performs no SSH or shell execution.

The repository contains no automated test suite or lint configuration. Its default rake task is a no-op and succeeds through rbenv; runtime syntax and package checks pass. Official/candidate packages retain 2.2.0, all 17 paths and metadata/dependencies; only lib/capistrano/tasks/bundler.cap changes. All Ruby verification uses rbenv Ruby 4.0.6. No tests were added or modified under the consuming repository's policy.

Compatibility and limitations

Only identical bundle exec entries are deduplicated during insertion. Existing prefixes are retained in order; no command map replacement or global reset is introduced.

No deployment or production changes. Legacy Bundler command generation is checked, but old Ruby/Bundler installations and remote servers were not executed. The existing Bundler 4 default-change proposal #140 is not included.

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