ManageIQ / polisher

Polisher is a Ruby module and set of utilities aimed to assisting the post-publishing packaging process for Ruby gems and applications.
MIT License
14 stars 14 forks source link

VersionChecker#missing_dependencies and #dependencies_satisfied? #121

Closed movitto closed 10 years ago

movitto commented 10 years ago

Implements a few methods to perform extended upstream / downstream cross-analysis and detection, comparing the specific requirements in a gemfile to those in the configured build targets

miq-bot commented 10 years ago

Checked commit https://github.com/movitto/polisher-1/commit/7dad029a051b83e5574016850261f90fb50ac122 with rubocop 0.21.0 2 files checked, 1 offense detected

spec/versioned_dependencies_spec.rb

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-0.2%) when pulling 7dad029a051b83e5574016850261f90fb50ac122 on movitto:missing_deps into 44186483b21ff6572529622243a11af764f04da9 on ManageIQ:master.

jrafanie commented 10 years ago

@movitto Looks good, I ran this against the manageiq repo and it reports the missing gems:

require 'pathname'
repo    = Pathname.new("~/Code/manageiq")
gemfile = repo.join("vmdb/Gemfile").expand_path

require 'polisher/gemfile'
targets = [:koji]
Polisher::VersionChecker.check(targets)

require 'polisher/koji'
Polisher::Koji.koji_tag 'our_koji_tag'
Polisher::Koji.koji_url 'koji_url'
Polisher::Koji.package_prefix "ruby193-rubygem-"

gemfile = ::Polisher::Gemfile.parse(gemfile)

require 'pp'
pp gemfile.missing_dependencies

It outputs some recent Gemfile merges that haven't been packaged yet:

["rspec", "sprockets-sass", "vcr", "rspec-rails"]

Questions: 1) the method is missing_dependencies, should it return the version constraint that wasn't matched too? I mean, it's useful to have the missing dependency names AND what version you searched for. [ ["rspec", "~>2.14.0"], ["sprockets-sass", "~> 1.2.3"] ]

2) Using the manageiq Gemfile, I count 89 requests to koji, it took a few minutes to run. This should be enabled for batch mode where we make a single request for all gems for a koji tag and we can parse the results to figure out what gem dependencies are missing. I did this internally and the request went from 2-3 minutes to 10-15 seconds. I can work on this following this merge if you think this sounds reasonable.

This can be follow up issues/pull requests, just thought they would be good to reiterate.

movitto commented 10 years ago

@jrafanie yes both are good points, lets just get this in then file follow on issues / pr's