-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make append(DSL) ignore value which inserted before #1936
Conversation
Here's an example of a CHANGELOG.md entry (place it immediately under the * [#1936](https://github.com/capistrano/capistrano/pull/1936): Make append(DSL) ignore value which inserted before - [@riseshia](https://github.com/riseshia) Generated by 🚫 Danger |
Interesting idea. I can't think of a situation where I would want the array to include duplicates, but from my experience maintaining this project, the instant we make that not possible, someone else will come tell us about their workflow, which we just broke… |
I wonder whether we simply need to be more specific about how set(key, Array(fetch(key)).concat(values)) Which coerces into an array, and then adds a value. We may just want to only operate on arrays (or array-like things, like Other maintainers: thoughts? |
Another fix is to make This https://github.com/capistrano/rbenv/blob/master/lib/capistrano/tasks/rbenv.rake#L22 could be changed to uniq the array before iterating over it. Or maybe go further back and make |
Hmm. I don't think we should change Capistrano's behavior in this case. The method is called I think the responsibility lies in |
Alternatively we could define a new DSL method called |
Thanks to quick response. :)
I agree with proposed behavior may make misleading, however, for example, not only I don't say this proposal accepted, but we may need some way to keep uniqueness of enumerable. @will-in-wi 's ideas seems good to me, but It seems to be better that define new dsl for this. Explicit way makes better understanding how to use capistrano, but also makes it easy where to dig if we have problem related this. |
It seems to me that there is agreement that we shouldn't change Thank you for submitting this contribution and working to make Capistrano better! |
Summary
I propose
append
dsl makes array to be unique.This proposal makes below situations to be avoidable:
Please notice that command has duplicated
rbenv exec
.I think these kind of problem don't occur frequently but hard to find. and also, until
append
introduced, there is gems usedset
accidently (I believe).This problem may occur when a user tries to update gems which contains patch replacing
set
toappend
.One more, this makes plugin developer do not care about the other plugins, especially duplicated adding configuration variable.
Short checklist
bundle exec rubocop -a
to fix linter issues?Thanks to read this. Have a nice day :)