agiledivider / vagrant-hostsupdater

MIT License
1.15k stars 130 forks source link

`gem` installs an outdated version #170

Open kamazee opened 5 years ago

kamazee commented 5 years ago

Gem with spec version 1.1.1.160 actually contains version 1.0.2 of the plugin. Here's how to see the difference:

gem fetch vagrant-hostsupdater
gem unpack vagrant-hostsupdater-1.1.1.160.gem
curl -L -O https://github.com/cogitatio/vagrant-hostsupdater/releases/download/1.1.1/vagrant-hostsupdater.gem
gem unpack vagrant-hostsupdater.gem

The snippet above produces 2 directories:

.
├── vagrant-hostsupdater # From github
└── vagrant-hostsupdater-1.1.1.160 # gem fetch 

diff.txt is a difference between the two (diff -r vagrant-hostsupdater vagrant-hostsupdater-1.1.1.160; left side is github version, right side is from rubygems).

I expected that 1.1.1 from rubygems would match 1.1.1 from github. Could you update the gem on ruygems?

kamazee commented 5 years ago

ping @cogitatio @cgsmith 🙄 Could you slap rubygems.org to make it distribute a correct version?

cgsmith commented 5 years ago

1.1.1.160 is the correct version

kamazee commented 5 years ago

@cgsmith it is; the thing is that what rubygems.org distributes as 1.1.1.160 appears to be 1.0.2. Please check the diff above between 1.1.1 from github and 1.1.1.160 from rubygems. Is that expected?

cgsmith commented 5 years ago

That is strange.... It shows 1.1.1.160 on the rubygems interface

kamazee commented 5 years ago

Indeed: looks like something went wrong when building the gem that was pushed to rubygems.org. Version in gemspec is correct but actual content is outdated. Gem in releases on github is correct, though, and it would be cool if someone with permissions replaced one that is on rubygems.org with one from github.

kamazee commented 5 years ago

@cgsmith sorry to disturb you again but could you push gem that is published on releases page of github to rubygems.org so they are the same? It's a pity that vagrant (that uses rubygems.org) installs an outdated version: we wanted to use new structure of aliases in our team but we failed because even though rubygems thinks in distributes 1.1.1.160 but actually installs 1.0.2, and things like the following just fail:

config.hostsupdater.aliases = {
    '10.0.0.1' => ['foo.com', 'bar.com'],
    '10.0.0.2' => ['baz.com', 'bat.com']
}

Well, we can always install plugin manually but hey, it would be nicer to make the latest code easily accessible to everyone :)

benbor commented 5 years ago

Hi guys. The problem reproduces on my env:

> gem --version
2.7.6
> ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
kamazee commented 5 years ago

@cogitatio @cgsmith could you please re-publish the latest release to rubygems (or cut a new one) to make it distribute the correct version of the plugin? I'd be really grateful; just using vagrant plugin is way more convenient than installing it manually and instructing people around to do so :)

Thanks for maintaining this great plugin!

kamazee commented 5 years ago

@cgsmith I've just stumbled upon https://github.com/cogitatio/vagrant-hostsupdater/issues/160#issuecomment-378456755 which revealed that 1.1.1.160 was an intentional retag of 1.0.2 to get rid of 1.1.1 that hadn't worked on Windows. I thought it was just a mistake. Sorry for the noise, then. I guess the only option to have 1.1.1 back is to fix Windows 10 issue; I'll see if I can do something with it.

Could you please confirm or deny that if Windows 10 issue is fixed, 1.1.1 will appear on rubygems.org (e.g. as 1.1.2)?

Enchiridion commented 5 years ago

@kamazee This probably explains why I can't get the example for setting up multiple adapters with separate IPs working:

config.hostsupdater.aliases = {
    '10.0.0.1' => ['foo.com', 'bar.com'],
    '10.0.0.2' => ['baz.com', 'bat.com']
}

I keep getting this error /.vagrant.d/gems/2.4.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/HostsUpdater.rb:22:in 'concat': no implicit conversion of Hash into Array (TypeError). I think I saw somewhere this support was added in 1.1.1.

kamazee commented 5 years ago

@Enchiridion yes, right. I created this issue after debugging the very same symptom you're experiencing. At the end of the day, I built a custom version (based on 1.1.1 with changes from #173 ), published it in a corporate gems repository and pointed vagrant to the custom private repository I pushed the plugin into.

I hope to get rid of the custom version one day, though.

cgsmith commented 5 years ago

I have repo access to write to the repo but would like to open this plugin up to be able to be managed by more in the community. Unfortunately @cogitatio is not responding to those requests.

I am thinking of creating a plugin and deprecating this plugin's URL and would like your feed back on this.

I don't want anyone to have custom versions and as many issues as have been popping up - that was the whole point why I wanted maintainer access to the repo.

kamazee commented 5 years ago

I am thinking of creating a plugin and deprecating this plugin's URL and would like your feed back on this

Do you basically mean forking it? Well, if @cogitatio doesn't respond to any requests related to this plugin, this might be the only option.

However, I don't think I follow the rest of the idea: what do you mean by "open this plugin up to be able to be managed by more in the community"?

As I see it, the project need people who are ready to review/merge pull requests and someone (or something) to publish releases on RubyGems (as I understand it's done manually at the moment but it's probably fairly easy to automate so likely having the former would be sufficient).

cgsmith commented 5 years ago

Automating would be great. @cogitatio is the only one who can add people for reviewing/merging pull requests right now.

I'll fork it and start a transition to use a different path. I want to give enough notice to other users and companies that use vagrant-hostsupdater

kamazee commented 5 years ago

@cgsmith actually, forking should go smoothly as the gem should be installed from rubygems, and it doesn't seem to care where a gem being pushed originates from; you listed as an owner there, so you have permissions to push. Basically, you can just fork this, change url on rubygems so people go the new place when they want to discover the source and that's it. Are you still interested? If so, I can offer a hand if needed.

alnorth commented 4 years ago

What's the current status on this? I've been trying to use the new aliases functionality from 1.1.0 and get the error message no implicit conversion of Hash into Array. I'm using 1.1.1.160.

If it's not supported by the version that's installed by vagrant plugin install vagrant-hostsupdater then maybe you should remove it from the readme as it's very confusing.

kamazee commented 4 years ago

@alnorth , 1.1.1.160 is actuallly a 1.0.2, not 1.1.x. You can find reasons above in the thread; a maintainer (either current or a new one who's willing to fork it and maintain the fork) has to step in to resolve the issue.

alnorth commented 4 years ago

@kamazee Can this be highlighted in the readme without a maintainer stepping in? It's very frustrating to read about something in the docs and then not be able to use it on the version that's installed using the recommended installation method.

kamazee commented 4 years ago

I don't think so: even if one submits a pull request that removes the feature from the description or submits a fix that makes releasing of 1.1.x possible again, maintainer has to merge them. Yeah, it took me some debugging to understand what was going on but there's barely anything I can do.

jstnbr commented 4 years ago

The alias array feature does not work for me either. It would be a very useful feature — especially considering that it's already in the documentation. Is this still priority and is there anything that can be done? Thanks!