Add value equality to Proxy::Run#1818
Open
teal-bauer wants to merge 1 commit intobasecamp:mainfrom
Open
Conversation
When multiple roles share a host and the global proxy run config gets merged into role-specific proxy configs, ensure_no_conflicting_proxy_runs raises ConfigurationError even though the configs are identical. The Run class didn't implement ==/eql?/hash, so Array#uniq compared by object identity. Two Run objects created from the same merged config were always treated as different.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical issue where the ensure_no_conflicting_proxy_runs validation incorrectly reports conflicts when multiple roles share the same host and inherit proxy run configuration via deep_merge. The problem was that Proxy::Run objects lacked proper value equality methods, causing Array#uniq to compare by object identity rather than configuration content.
Changes:
- Implemented
==,eql?, andhashmethods inProxy::Runclass based onrun_confighash comparison - Added comprehensive test suite covering identical/different configurations and the multi-role-same-host scenario
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/kamal/configuration/proxy/run.rb | Added value equality implementation (==, eql?, hash) to enable proper comparison of Run objects by configuration content |
| test/configuration/proxy/run_test.rb | Added three test cases: value equality with identical configs, inequality with different configs, and integration test for the multi-role scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 7, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When multiple roles share a host, the global
proxy.runconfig gets merged into each role's proxy config viadeep_merge. This creates separateRunobjects with identicalrun_confighashes.ensure_no_conflicting_proxy_runsusesArray#uniqto detect conflicts, butRundoesn't implement==/eql?/hash, souniqcompares by object identity. The check always fails when two or more roles with proxy config exist on the same host, even if the merged run configs are identical.Changes
==,eql?, andhashtoProxy::Runbased onrun_configReproduction