-
Notifications
You must be signed in to change notification settings - Fork 56
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
(GH-234) Remove PDK dependency #235
Conversation
e681610
to
e37741c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great to see this work started, it'll make the litmus install lighter and more robust.
What I'm unclear on: I thought we were talking about putting the ModuleBuilder in a external gem so it can be re-used by e.g. puppet-blacksmith. Not the least I'd also feel uncomfortable maintaining this code and its compatibility with the rest of the ecosystem. Did something change in that thinking?
PS: where does the |
Heya @DavidS TLDR; Prove the code and use-case in Litmus now, getting fast feedback. In preparation to make it a gem.
We still are, but the work is a while off, at least for the PDK maintainers team. Thinking is
I did consider this before I raised the PR, and it came down to balancing maintenance of somewhat duplicate code vs keeping the overhead of the PDK dependency for the sake of a one piece of functionality. What swayed me over was: As part of moving it out of PDK into, and eventually, it's own library is to reduce the scope of the classes/modules. The S in SOLID. So the idea is there should be even less maintenance than if it was in the PDK itself. The code in question hasn't had a bugfix since Jul 2019, and Oct 2018 before that. It's relatively stable. So in the short term (say, next 6 months) the maintenance overhead I expect would be practically zero. Happy to have a chat about in person if you wish. |
I think I originally got it from an Open Source project within Puppetlabs. Maybe the windows modules way back when. It denoted the issue came from GitHub instead of Jira (MODULES- PUPPET- PDK-) I think it pre-dated the |
Thanks for the in-depth response. All of that makes a lot of sense! Since litmus is still very experimental[tm] and I'm about to set up a new gem for a different thing, I'd be happy to take the code from here and release it as APL2.0 puppetlabs/puppet-module-builder 0.1.0 in the next few days. I even expect testing this code to be easier in a stand-alone repo. |
Okay! As you can see from the TODO I still need to add the unit tests for this class. I know the acceptance tests have "proved" the code works, but I'd still like to have them. Happy to work with you to put the code in the right spot! |
I'm fully with @DavidS on this and I've wanted a standalone gem for that part for some time, precisely for puppet-blacksmith. Also overall 👍 for dropping the PDK dependency in this gem. |
Created https://tickets.puppetlabs.com/browse/MODULES-10515 to get the infrastructure work scheduled in the team. might be a day or three until we get around to it. |
@DavidS Just chasing this up |
@glennsarti @sheenaajay started on MODULES-10515 (neé IAC-532) yesterday. |
Previously each spec file loaded and included individual test files, however this was not needed, and in some cases tests couldn't be run individually. This commit removes `load` commands as they're not required and moves the per-spec including to the spec_helper.
f3bd778
to
ef62b48
Compare
❤️ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #235 +/- ##
===========================================
- Coverage 55.63% 10.00% -45.64%
===========================================
Files 7 7
Lines 665 840 +175
===========================================
- Hits 370 84 -286
- Misses 295 756 +461 ☔ View full report in Codecov by Sentry. |
lib/puppet_litmus/rake_helper.rb
Outdated
# @option opts [String] :module_dir The path of the module to build. If missing defaults to Dir.pwd | ||
# @option opts [String] :target_dir The path the module will be built into. The default is <source_dir>/pkg | ||
# @return [String] The path to the built module | ||
def build_module(opts = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason you're using an option hash instead of explicit parameters? I think explicit parameters would make the code easier to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was probably taken out from the pdk: https://github.com/puppetlabs/pdk/blob/master/lib/pdk/module/build.rb#L13
I'm happy with it either way, but it would be easier to read with parameters.
f324df1
to
83ec12c
Compare
Previously Litmus depended on the entire PDK gem, however it only used the module building capability. This commit * Adds the puppet-modulebuilder gem into Litmus. * Modified the rake helper to call the new Module Builder * Modifies the gemspec to remove PDK and add the puppet-modulebuilder gem.
83ec12c
to
19add0b
Compare
Block on release of the puppet-modulebuilder gem
Previously Litmus depended on the entire PDK gem, however it only used the
module building capability. This commit
TODO
Drop thed DROP ME
commit which is only there for testing this PR