The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Refactor #11260

tool should generate code using the actual module name as the directory instead of username-modulename

Added by Garrett Honeycutt over 4 years ago. Updated over 2 years ago.

Status:Needs DecisionStart date:12/07/2011
Priority:NormalDue date:
Assignee:Ryan Coleman% Done:

0%

Category:-Spent time:-
Target version:-
Keywords:UX Affected URL:
Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket is now tracked at: https://tickets.puppetlabs.com/browse/FORGE-36


Description

This is what currently happens

[root@puppet modules]# puppet-module generate ghoneycutt-apache
=====================================================================
Generating module at /etc/puppetlabs/puppet/modules/ghoneycutt-apache
---------------------------------------------------------------------
ghoneycutt-apache
ghoneycutt-apache/Modulefile
ghoneycutt-apache/tests
ghoneycutt-apache/tests/init.pp
ghoneycutt-apache/README
ghoneycutt-apache/manifests
ghoneycutt-apache/manifests/init.pp
ghoneycutt-apache/metadata.json
ghoneycutt-apache/spec
ghoneycutt-apache/spec/spec.opts
ghoneycutt-apache/spec/spec_helper.rb

This is what should happen.

[root@puppet modules]# puppet-module generate ghoneycutt-apache
=====================================================================
Generating module at /etc/puppetlabs/puppet/modules/apache
---------------------------------------------------------------------
apache
apache/Modulefile
apache/tests
apache/tests/init.pp
apache/README
apache/manifests
apache/manifests/init.pp
apache/metadata.json
apache/spec
apache/spec/spec.opts
apache/spec/spec_helper.rb

People actually use the tool by doing the following, which one should not have to do.

# puppet-module generate ghoneycutt-apache && mv ghoneycutt-apache apache

Related issues

Related to Puppet Forge - Refactor #15544: The PMT generate command needs refactor and UX improvements Investigating 07/16/2012

History

#1 Updated by Anonymous over 4 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Anonymous

Randall, I think this needs a UX decision.

#2 Updated by Anonymous over 4 years ago

I’ll get back with a decision on this soon.

#3 Updated by Anonymous over 4 years ago

  • Assignee changed from Anonymous to Anonymous

#4 Updated by Garrett Honeycutt over 4 years ago

When using the install action, it already does what I proposed for the generate function. So this request will aid in consistency.

[root@puppet]# puppet-module install ghoneycutt-syslog_ng
Installed "ghoneycutt-syslog_ng-1.0.0" into directory: syslog_ng

#5 Updated by Nick Fagerlund about 4 years ago

Nudge!

I think Garrett’s suggestion is the right one. Scaffolding a new module in one command is useful, we should be able to teach users this shortcut in the docs, and the current behavior is a bit embarrassing.

Is there ever an actual use case for creating a module folder with the fully qualified name? Why would one do that?

#6 Updated by Anonymous about 4 years ago

Part of the problem is that the generate command is very restrictive about the name of the module you’re generating. I’m working to drive Puppet modules towards a single name system, in which case the module name ‘ghoneycutt-syslog_ng’ would live in the directory ‘ghoneycutt-syslog_ng’, would be installed as ‘ghoneycutt-syslog_ng’, would be indexed on the Forge as ‘ghoneycutt-syslog_ng’, etc… (In this world, modules will eventually lose their author prefixes as well, but that’s a separate discussion…)

In the meantime, we have a world where the module ‘apache’ is “qualified” as ‘puppetlabs-apache’, lives in the ‘apache’ directory', but is referred to everyone as ‘puppetlabs-apache’ (or ‘puppetlabs/apache’). From a utilitarian perspective, generating a module into it fully qualified directory name is (presently) of limited use; you can’t actually use the module without renaming the directory. From a user perspective, there is a little sense to it: the user asked to generate ‘ghoneycutt-syslog_ng’, the created directory has the same name – they don’t need to know all of our internal rules about how qualified module names get decomposed.

The easiest thing to do (from a code-perspective) is to do nothing until the module namespace gets flattened. Having said that, I can make no promise of that happening before Puppet 3.0.0. At the very least, this is not scheduled to change as a part of Geordi v1.

#7 Updated by Gary Larizza about 4 years ago

Is there any possibility to adding an argument to ‘help’ this for experienced users? Something like: “—full-namespacing false” or “—namespacing false”? This would make the tool much more useful from a training and module development perspective RIGHT NOW, and would still work fine when the namespace is flattened?

#8 Updated by Ken Barber almost 4 years ago

  • Project changed from Puppet Forge to Puppet

#9 Updated by Ken Barber almost 4 years ago

  • Category set to module tool
  • Target version set to 3.x

#10 Updated by Nigel Kersten over 3 years ago

  • Project changed from Puppet to Puppet Forge
  • Category deleted (module tool)
  • Assignee changed from Anonymous to Ryan Coleman
  • Target version deleted (3.x)

#11 Updated by Anonymous over 2 years ago

Redmine Issue #11260 has been migrated to JIRA:

https://tickets.puppetlabs.com/browse/FORGE-36

Also available in: Atom PDF