Skip to content
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

Add a dependency solver based on the Ruby Solve library #6

Merged
merged 2 commits into from
Apr 10, 2017

Conversation

oranenj
Copy link
Contributor

@oranenj oranenj commented Apr 1, 2017

I implemented a dependency solver for Puppetfiles that's rather much faster than Librarian at least as far as I can tell. The limiting factor is how slowly the Forge API returns release metadata.

I've tested, and it works for me at least. I'm now looking for feedback on what the task should actually do (I kind of want it to output an updated Puppetfile, but it's useful enough as is). It supports both git and Forge modules

The solver uses YAML::Store to cache release metadata, so subsequent
runs will be somewhat faster, but it still only fetches the three most recent releases for each dependency.

@oranenj oranenj force-pushed the solver branch 2 times, most recently from 7b05101 to 0aeb0a3 Compare April 2, 2017 13:31
@oranenj oranenj requested a review from tampakrap April 2, 2017 13:32
@oranenj
Copy link
Contributor Author

oranenj commented Apr 2, 2017

It seems Semverse requires a newer ruby, so merging this means having to drop support for <2.1.0. Is that okay?

I did some refactoring and added an option to allow/disallow major updates from the resolution.

@tampakrap
Copy link
Contributor

Thanks! I also tested it briefly and it works fine for me as well. It is absolutely no problem for me to support ruby >=2.2. Add some documentation at the README please and I'll merge it

@oranenj
Copy link
Contributor Author

oranenj commented Apr 9, 2017

@tampakrap I did a few final cleanups as well. It should now handle missing metadata in git modules a bit better.

@tampakrap
Copy link
Contributor

I tried to run it, I get NameError: uninitialized constant Ra10ke::Solve::Graph in lib/ra10ke.rb:96 Also can you make pry an optional development only dependency?

@oranenj
Copy link
Contributor Author

oranenj commented Apr 10, 2017

hmm? the code shouldn't have any references to pry anymore. Maybe I accidentally committed some debug code...

@oranenj
Copy link
Contributor Author

oranenj commented Apr 10, 2017

Eugh, I think I've gotten it somehow mixed up when rebasing. Let me try to untangle it...

oranenj and others added 2 commits April 10, 2017 19:11
The solver uses YAML::Store to cache release metadata, so subsequent
runs will be somewhat faster

By default, the resolver disallows major updates, but this can be
turned off.
@oranenj
Copy link
Contributor Author

oranenj commented Apr 10, 2017

@tampakrap The PR should no longer contain anything extra. All of the new code is now in lib/solve.rb

@tampakrap tampakrap merged commit 9f60818 into voxpupuli:master Apr 10, 2017
@tampakrap
Copy link
Contributor

thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants