Closed movitto closed 10 years ago
@jvlcek first draft of workflow
@jrafanie agree on shortening the method, trying to get general workflow down before optimizing though.
git ls-remote could work but would need to be integrated into the base git classes. Feel free to send a PR. ;-)
Git::Pkg#fetch is implemented here, essentially clones repo if not already, switches to specified (or default) branch, resets the working tree, and pulls in the latest changes.
https://github.com/ManageIQ/polisher/blob/master/lib/polisher/git/pkg.rb#L104
Updated the workflow diagram and reworked the ordering of operations / algorithm a bit. Still some bits left to be flushed out, but general gist is there.
Am out today, will finish up on Monday.
Mo, Can you please add a description/example of the API calls Builder would use to leverage these improvements?
Checked commits https://github.com/ManageIQ/polisher/commit/ec6ada836d14f461deac1cce93d95497fb440d34 .. https://github.com/ManageIQ/polisher/commit/a090682ebc1df287ba7022609dda37b4a1084371 with rubocop 0.21.0 10 files checked, 9 offenses detected
lib/polisher/gem_state.rb
tag
. If it's necessary, use _
or _tag
as an argument name to indicate that it won't be used.version
. If it's necessary, use _
or _version
as an argument name to indicate that it won't be used.return
detected.return
detected.return
detected.lib/polisher/git/pkg.rb
alias_method
instead of alias
.@jrafanie @jvlcek reworked logic to cleanup / simplify code + add helpers. Not as efficient as original workflow (various targets in distgit will be checked needlessly in certain cases), but can see readability being more desirable here.
The :check parameter is the actual Gemfile::Dependency extracted using bunder. The bundler#match? method is used to compare the koji/distgit versions to the dep
@movitto We can clean up the rest later. I think this is a much better starting place for refactoring as the main methods are more readable.
Work In Progress.
Currently implements