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

Refactoring #125

Closed movitto closed 9 years ago

movitto commented 9 years ago

Refactoring of codebase so as to consolidate functionality and simplify modules. Components are now more or less independent of each other save specified integration points and are better organized.

coveralls commented 9 years ago

Coverage Status

Coverage decreased (-1.65%) when pulling 8aef4ed7d6f167fdd3ed3f71c006967f073be26d on movitto:refactoring1 into 2a0c00ae6760cf7a9de1f3c2ff49676f3afb9b93 on ManageIQ:master.

jrafanie commented 9 years ago

@movitto Looks like the Polisher::RPM::AUTHOR constant is missing, causing the specs to fail.

This PR is enormous, which is not necessarily a bad thing, just hard to follow. From a high level, what is this PR achieving? Do you have an example before/after code snippet showing how this PR improves client code? Thanks for digging into this, refactoring is good, I'm just trying to understand it.

:cookie:

movitto commented 9 years ago

@jrafanie updated, split up the changes. Mostly structural / heirarchical, not too many changes to the external api but this makes things more modular and maintainable. Should be able to base additional changes to target functionality easier from here on out.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.46%) when pulling 806506b59e94091ded7f041acdcbf220154bc24c on movitto:refactoring1 into 2a0c00ae6760cf7a9de1f3c2ff49676f3afb9b93 on ManageIQ:master.

jrafanie commented 9 years ago

@movitto Can you address the following cops (where appropriate): DeprecatedClassMethods UnusedMethodArgument UselessAssignment Semicolon NonNilCheck HandleExceptions Blocks MultilineBlockChain

Some of these cops are worth looking at regardless if it's just a move.

I can't really follow what's going on here even with the split up commits. I think there just too many refactoring/reorganizing going on. Probably would be more readable if you did it in small units of change.

It seems a bit better organized so there's that. I'm fine with it, just can't say anything useful as I don't understand the design changes.

movitto commented 9 years ago

@jrafanie updated for style. Left some of the items as-is where I felt things flowed better and skipped over some of the trivial ones on the list.

Regarding the split up commits, it's probably not worth the effort atm, especially since builder only uses one callpath and that's largely unchanged. This changeset mostly serves to organize the file list which was under lib/polisher into subdirs according to generic intent and to split large classes into mixin modules (with functionality remaining the same). There are a few small changes / fixes but we can take some time to tighten things down before the next release.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.45%) when pulling 2faab9c0396161edc167032d9a9f69129d5bb4af on movitto:refactoring1 into 2a0c00ae6760cf7a9de1f3c2ff49676f3afb9b93 on ManageIQ:master.

miq-bot commented 9 years ago

Checked commits https://github.com/movitto/polisher-1/commit/8969080f952bb90206fbbc769c623acc3f48417f .. https://github.com/movitto/polisher-1/commit/fc29ad612f901252171633758d9e510210ebb20d with rubocop 0.27.1 89 files checked, 136 offenses detected

lib/polisher/adaptors/version_checker.rb

lib/polisher/gem/diff.rb

lib/polisher/gem/files.rb

lib/polisher/gem/parser.rb

lib/polisher/gem/state.rb

lib/polisher/gem/versions.rb

lib/polisher/gemfile/deps.rb

lib/polisher/gemfile/parser.rb

lib/polisher/git/pkg/builder.rb

lib/polisher/git/pkg/repo.rb

lib/polisher/git/pkg/versions.rb

lib/polisher/mixins/vendored_deps.rb

lib/polisher/rpm.rb

lib/polisher/rpm/requirement/comparison.rb

lib/polisher/rpm/requirement/gem_reference.rb

lib/polisher/rpm/requirement/parser.rb

lib/polisher/rpm/spec/check.rb

lib/polisher/rpm/spec/comparison.rb

lib/polisher/rpm/spec/gem_requirements.rb

lib/polisher/rpm/spec/parser.rb

lib/polisher/rpm/spec/subpackages.rb

lib/polisher/rpm/spec/updater.rb

lib/polisher/targets/bodhi.rb

lib/polisher/targets/fedora.rb

lib/polisher/targets/koji/builder.rb

lib/polisher/targets/koji/diff.rb

lib/polisher/targets/koji/versions.rb

lib/polisher/targets/yum.rb

lib/polisher/util/conf_helpers.rb

lib/polisher/util/core_ext.rb

spec/git/pkg_spec.rb

spec/git/repo_spec.rb

spec/mixins/versioned_dependencies_spec.rb

spec/targets/fedora_spec.rb

spec/targets/koji_spec.rb

spec/targets/yum_spec.rb

spec/util/component_spec.rb

spec/util/core_ext_spec.rb

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.45%) when pulling fc29ad612f901252171633758d9e510210ebb20d on movitto:refactoring1 into 2a0c00ae6760cf7a9de1f3c2ff49676f3afb9b93 on ManageIQ:master.

movitto commented 9 years ago

@jrafanie any objections to merging this? Since most changes are to internal layout / style, I'd suggest we get this in / iron additional things out via the spec suite (see followup pr's). The overall codebase should be fairly stable after this point as most things are now componentized / compartmentalized.

jrafanie commented 9 years ago

Sure @movitto, I haven't been spending too much time in this area, so feel free to do multi-step restructuring, we can bump the version to 0.11.0 when you're done to shake out any thing that breaks.

My only suggestion is to keep your eye on the rubocop warnings and code climate/coveralls scores... they're good general guidelines... Let's drop complexity where we can to make small objects that do one thing well.