-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
(MODULES-1637) Major refactor #103
Conversation
|
@skpy This incorporates your previous PR on parameterizing package names slightly differently, so you may wish to comment as well. |
|
I'll check if this work on OpenBSD instead of FreeBSD as I've never done any work on this module for FreeBSD. |
|
@jasperla My mistake. I have just pushed through another commit. Can you confirm that the default npm path is correct on OpenBSD? |
|
|
||
| Debian users may want to use apt::pin to pin package installation priority on squeeze. See [puppetlabs-apt](https://github.com/puppetlabs/puppetlabs-apt) for more information. | ||
| ```puppet | ||
| nodejs::npm { 'express|/opt/packages': |
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.
Describe the 'express|/opt/packages' string format.
|
@juniorsysadmin, that looks like it would make my PR 102 irrelevant (not that I'm complaining). |
|
@juniorsysadmin indeed that would do it. +1 ty! |
|
@juniorsysadmin I think the nodejs::npm docs at the top look better and it doesn't feel too verbose to me, just enough. |
|
Rebased. Does anyone have any more feedback to add? |
|
Rebased. Optimistic proposed version number changed to 0.8.0. |
| @@ -1,3 +1,26 @@ | |||
| ##2015-01-21 0.8.0 | |||
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.
That date's a little optimistic, as a release date. ;)
|
Rebased and some changes made based on feedback. |
NodeSource have released Fedora 21 binaries today on their repository. |
|
general comments: i remain unhappy with |
|
I tend to agree with @igalic that the syntax used to hack in composite namvars is startling and my initial reaction to it is negative. That being said, composite namevars have always been a 'maybe next year' so hacking it in with pipes in the node module, hey why not. The more I look at it, the more excited about the prospect I get. I haven't been able to review the entire patch despite several attempts. This patch is super huge which is a problem for any reviewer. I hate to be "that guy" but could this be broken up into a few logical chunks? This seems like it is the best way forward for a real future for this module. @juniorsysadmin do you anticipate being able to take on primary ownership for this module going forward? To respond directly to the conversation starters:
|
| $package_string = $npm_package | ||
| } | ||
| elsif $ensure == 'absent' { | ||
| $package_string = $npm_package |
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.
these two branches can be collapsed.
I could try and do this, but it's going to be really, really hard - the provider is the only code part that escaped unscathed, and that's because I don't have very strong knowledge of Puppet provider types.
What my convoluted sentence was trying to say was:
I can try - my knowledge of Puppet providers is not great though. The current version looks like an absolute nightmare for anyone who needs to merge PRs, I would think this version would make things a lot easier for whoever needs to merge PRs in future. |
| $package_string = "${npm_package}@${npm_tag}" | ||
| } | ||
| elsif $ensure == 'latest' { | ||
| $package_string = "${npm_package}@latest" |
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.
if that was the case, we could, again, collapse these two branches, i.e.: if ensure matches latest, or a version string, just append it.
in that case, it would make sense to make this the default, last case. i.e.: present, absent, etc.. have already been handled, now we just give up and decide it's a version number (or latest)
|
@hlindberg courtesy ping so you can look at the '|' namevar syntax. |
|
@nibalizer From a language perspective, the title is any valid string and it is up to the type to do what it pleases with it. From a resource perspective it has to be unique. In practice, there are several types where a compound namevar is wanted and it would be a shame if it is done differently in different types. My natural tendency would be to use URI syntax for this sort of thing - i.e a path within a domain. Protocol is not needed since that is really the type. |
|
Based on feedback (especially about the namevar ugliness), the last commit:
When ensure => latest is set, the installcheck will always fail and run npm install package@latest - I am not sure if there is much that can be done about this without using a Custom Type. Longer term, a better direction for this defined type is probably a wrapper which calls a Custom Type, similar to the what is done in puppetlabs-mysql etc. |
|
Alignment issues in the RSpec files of the last commit have been fixed. |
|
👍 for merge |
|
When are you planning on merging this? we would like support for updated node |
|
@cyberious, @mhaskel: ping |
|
ya lets merge this +1 |
This set of patches includes multiple changes and is not backward-compatible. In summary this code: - Supercedes PR 99 (MODULES-1075), 97, 96, 94, 93, 85, 82, 80, 79, 51, 69, 66 and 102 - Explicitly makes Debian Squeeze unsupported - Makes nodejs, nodejs-dev and nodejs-debug package names parameters - Defaults to using the NodeSource repositories where possible, but allows native packages to be installed when appropriate parameters are set - Introduces a parameter repo_class, which allows one to use alternative repositories like EPEL for the Node.js packages. - Adds Windows installation support via Chocolatey - Adds FreeBSD and OpenBSD support - Changes the format of the nodejs::npm defined type to be module|path rather than path:module for the name - Attempts to support all of the npm install <package> forms, except for version ranges. Tags are supported with a separate parameter, and the version parameter has been removed (Version numbers can be passed to the ensure parameter instead) - Adds a defined type nodejs::npm::global_config_entry, which allows one to set and delete global npm config options. The proxy parameter in nodejs:npm has been removed since this can now be done with global_config_entry. - Adds a number of RSpec unit tests - Adds a Beaker acceptance test skeleton
|
I have fixed two major issues in nodejs::npm - ensure => absent should now work properly, and default npm paths are now correct on Windows. (The commits have been squashed). I have also done a fair bit of testing of the npm defined type on Linux and Windows, so I'm reasonably satisfied that it works as advertised. |
This shouldn't really be needed. All it takes is to drop one file, the key file, in the right directory: |
|
\o/ |
|
it's done! thank you everyone for reviewing, and thank you so much @juniorsysadmin! |
|
Thank you @juniorsysadmin! |
As mentioned in the Changelog and commit log, this Pull Request if commited will break a few things since major changes have been made to the API.
The code could probably be a bit better, so I have created this PR to get some feedback before I create a some acceptance tests.
@x3dfxjunkie - this PR potentially supercedes PR 102
@b4ldr - this PR potentially supercedes PR 99
@menssen - this PR potentially supercedes PR 96
@CpuID - this PR potentially supercedes PR 94
@aebm - this PR potentially supercedes PR 93
@wassimsalib - this might make your PR 89 redundant
@einyx - this PR potentially supercedes your PR 85
@jurgenweber, @brentax - this PR potentially supercedes PR 82
@jasperla - this PR potentially supercedes PR 80 - Are you perhaps able to check that it works nicely on FreeBSD?
@jlambert121 - this PR potentially supercedes PR 79 - Travis Puppet 2.7 tests have been removed, and I have attempted to use modulesync
@wenlock, @wknapik - this might make PR 70 redundant
@emonty, @rchrd2, @atrepca - this PR potentially supercedes PR 69
@mpdude - this PR potentially supercedes PR 66 - Are you perhaps able to confirm that the MacPorts default npm path is correct?
A few starting points of discussion:
not seem to make sense for this module. Any strong objections?
There is a need for the npm_path parameter since Windows, Darwin and possibly others default to installing npm in various places. The npm defined types have been modified to accommodate this, but the provider has not.
tag on the master will need to be updated as well. This is rather optimistic, so I am happy to reverse these changes.