kindredgroup / puppet-forge-server

Private Puppet forge server supports local files and both v1 and v3 API proxies
69 stars 44 forks source link

Fix compatibility with librarian-puppet 2.2.1 #26

Closed c10l closed 9 years ago

c10l commented 9 years ago

librarian-puppet 2.2.1 calls #deleted_at for each release of a module. See commit for more information:

https://github.com/rodjek/librarian-puppet/commit/88efacffccdc26768542d7598f9721de2bc892cd

Without this fix, librarian-puppet crashes with this error:

/usr/local/share/gems/gems/her-0.6.8/lib/her/model/attributes.rb:76:in `method_missing': undefined method `deleted_at' for #<PuppetForge::V3::Release:0x00000001e8eff8> (NoMethodError)
    from /usr/local/share/gems/gems/activemodel-4.2.3/lib/active_model/attribute_methods.rb:433:in `method_missing'
    from /usr/local/share/gems/gems/puppet_forge-1.0.5/lib/her/lazy_accessors.rb:71:in `method_missing'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/source/forge/repo_v3.rb:21:in `block in get_versions'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/source/forge/repo_v3.rb:20:in `map'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/source/forge/repo_v3.rb:20:in `get_versions'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/source/forge/repo.rb:15:in `versions'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/source/forge/repo.rb:42:in `manifests'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/source/forge.rb:152:in `manifests'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/dependency.rb:155:in `cache_manifests!'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/dependency.rb:151:in `manifests'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:159:in `block in resolving_dependency_map_find_manifests'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:172:in `block (2 levels) in scope_resolving_dependency'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:186:in `block in scope_checking_manifests'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:230:in `scope'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:185:in `scope_checking_manifests'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:171:in `block in scope_resolving_dependency'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:230:in `scope'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:170:in `scope_resolving_dependency'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:158:in `resolving_dependency_map_find_manifests'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:65:in `do_resolve'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver/implementation.rb:50:in `resolve'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/resolver.rb:23:in `resolve'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/action/resolve.rb:31:in `run'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/action/resolve.rb:10:in `run'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/cli.rb:104:in `resolve!'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/cli.rb:113:in `update'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/lib/librarian/puppet/cli.rb:76:in `update'
    from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/share/gems/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/cli.rb:31:in `returning_status'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/cli.rb:26:in `block in bin!'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/cli.rb:47:in `with_environment'
    from /usr/local/share/gems/gems/librarianp-0.6.3/lib/librarian/cli.rb:26:in `bin!'
    from /usr/local/share/gems/gems/librarian-puppet-2.2.1/bin/librarian-puppet:7:in `<top (required)>'
    from /usr/local/bin/librarian-puppet:23:in `load'
    from /usr/local/bin/librarian-puppet:23:in `<main>'
i11 commented 9 years ago

Thanks! Would you mind extending the backend classes as well? In that case the value will be accurate if it was set in puppet forge.

c10l commented 9 years ago

This seems to do the trick. I tested with V3 and V1, it serves well both proxied and directory-based modules. Any other tips?

i11 commented 9 years ago

I think that covers it. Thanks a lot!

i11 commented 9 years ago

Released 1.7.4

c10l commented 9 years ago

Awesome! Thanks! :smiley: :beer: