Skip to content
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

Naming convention for supermarket #3

Closed
luishdez opened this issue May 27, 2015 · 17 comments
Closed

Naming convention for supermarket #3

luishdez opened this issue May 27, 2015 · 17 comments

Comments

@luishdez
Copy link

We've adopted the mongodb cookbook that uses "mongodb" as namespace in chef supermarket. Our repo name conflicts with the old one. We need to set a new name for the supermarket.

I think we should define a naming convention for this purpose.

I would go with brigade-mongodb and follow the pattern brigade-{name} Using brigade as namespace for other cookbooks

Eg:

  • Github: nginx-cookbook Supermarket: brigade-nginx
  • Github: varnish-cookbook Supermarket: brigade-varnish

Similar as grunt-contrib, This will prevent any conflict with other cookbooks

Any thoughts?

@thomas-riccardi
Copy link

👍

@josephholsten
Copy link
Contributor

honestly, I'd rather our mongodb replaced the existing mongodb cookbook. I'll bug @jamesonjlee to see if he can get us added to the existing one.

For situations where we can't get the un-namespaced spot, 👍 to brigade-foo

@luishdez
Copy link
Author

luishdez commented Jun 4, 2015

Ok @josephholsten let's give it some time to see if we can get the original name 👍

@luishdez
Copy link
Author

@josephholsten Do we have any news ?

@josephholsten
Copy link
Contributor

@luishdez sorry, I heard back from @jamesonjlee and he doesn't have access. I'll bug @thekorn and @edelight. Until then, let's proceed with brigade-mongodb.

@zuazo
Copy link
Contributor

zuazo commented Jul 14, 2015

I think it would be better to use an underscore in the prefix: brigade_. For example brigade_mongodb.

I propose this because using dashes gives problems when making ChefSpec tests: https://github.com/sethvargo/chefspec#testing-lwrps

WARNING Cookbooks with dashes (hyphens) are difficult to test with ChefSpec because of how Chef classifies objects. We recommend naming cookbooks with underscores (_) instead of dashes (-).

@josephholsten
Copy link
Contributor

@zuazo and that's why I'm glad to have a community of smart folks about.

@rex
Copy link

rex commented Jul 15, 2015

Indeed. @zuazo great catch. I prefer to have hyphens instead of underscores in repository names, but for consistency's sake underscores are perfectly fine IMO. I also like the brigade_<package> convention. Simple, sexy.

@josephholsten
Copy link
Contributor

Could someone start a recommendations doc? I've started a template in https://github.com/chef-brigade/cookbook-skeleton, but that's not really where we want guidance for this sort of thing.

@luishdez
Copy link
Author

Mmmm… I do prefer dashes as well, actually I kinda hate underscores 😄

I haven't use chefSpec that much so I can't tell, but are we using chef spec in all the repos? If this causes a problem that can not be avoided with good coding style practices I'm fine then.

It's not the most important thing but I think that naming is not trivial

For example with underscores the name is treated as a one word for SEO purposes. In the title h1 and URLs that gives good hints for SEO… If someone searches for mongo cookbook those keywords won't match, This name is shown in H1, URls, texts… in pages like github, supermarket among others.

Though there is no much competition so it's not a big problem… but I think the "{resource}-cookbook" pattern is the best approach for this.

@dblessing
Copy link

ChefSpec is an essential tool IMO. Can you name the cookbook with an underscore and still name the repo with a dash, use alternative characters in the README, etc. to get around SEO issues?

@lamont-granquist
Copy link

Dashes are a bad option for any ruby code:

% pry
[1] pry(main)> def foo-bar(thing)
SyntaxError: unexpected '-', expecting ';' or '\n'
def foo-bar(thing)
        ^
[1] pry(main)> def foo_bar(thing)
[1] pry(main)* end
=> :foo_bar

We've generally stamped out all those bugs that we know of, but its still considered best practice to use underscores instead of dashes in cookbooks to avoid any future issues.

The issue is not confined to chefspec. Its just a best practice recommended by nearly everyone who has touched chef-client core.

@lamont-granquist
Copy link

also if you're really adopting the mongodb cookbook it should still be named mongodb so users can still find it and upgrade and don't have to update all their dependencies.

you only need to do this when you're forking an existing cookbook, and can't adopt the cookbook from the original author.

@zuazo
Copy link
Contributor

zuazo commented Dec 8, 2016

@lamont-granquist AFAIK we have no permissions over the original mongodb cookbook in supermarket. See sous-chefs/sc-mongodb#106 for more information.

damacus added a commit that referenced this issue Dec 8, 2016
Remove -cookbook suffix as per discussion in issue #3
fix another brigade

#3
@damacus damacus added the ready label Dec 9, 2016
@damacus
Copy link
Member

damacus commented Dec 9, 2016

Do we think this is covered by https://github.com/sous-chefs/meta/blob/master/forking.md ?

@damacus damacus added in progress and removed ready labels Dec 9, 2016
@damacus
Copy link
Member

damacus commented Dec 9, 2016

Closing as per slack discussion on #sous-chefs

@lock
Copy link

lock bot commented Jul 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants