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

Fix #91: Implement Gem#state #100

Closed movitto closed 10 years ago

movitto commented 10 years ago

Work In Progress.

Currently implements

movitto commented 10 years ago

@jvlcek first draft of workflow

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-1.75%) when pulling c56013b48d058f334a3cffba01a81c6905c15429 on gem_state into a1e04c6b4b343b919479b9175f2f7e68ba28f01f on master.

movitto commented 10 years ago

@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.

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-1.46%) when pulling 0a3f00d039ec693d850bc30d91f9da29117b246f on gem_state into a1e04c6b4b343b919479b9175f2f7e68ba28f01f on master.

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-2.2%) when pulling d52f288232fdb5e699298799431f4b86e871ca8d on gem_state into a1e04c6b4b343b919479b9175f2f7e68ba28f01f on master.

jvlcek commented 10 years ago

Mo, Can you please add a description/example of the API calls Builder would use to leverage these improvements?

miq-bot commented 10 years ago

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

lib/polisher/git/pkg.rb

movitto commented 10 years ago

@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

coveralls commented 10 years ago

Coverage Status

Coverage decreased (-2.08%) when pulling a090682ebc1df287ba7022609dda37b4a1084371 on gem_state into a1e04c6b4b343b919479b9175f2f7e68ba28f01f on master.

jrafanie commented 10 years ago

@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.