# GitHub workflow for open source cookbooks

**URL:** <https://discourse.chef.io/t/github-workflow-for-open-source-cookbooks/1876>\
**Category:** Chef Infra (archive)\
**Created:** [June 17, 2011, 2:29pm UTC](https://discourse.chef.io/t/github-workflow-for-open-source-cookbooks/1876 "2011-06-17T14:29:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Hauser](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/eric_hauser/32/818_2.png) [@Eric\_Hauser](https://discourse.chef.io/u/Eric_Hauser)\
**Post date:** [June 17, 2011, 2:29pm UTC](https://discourse.chef.io/t/github-workflow-for-open-source-cookbooks/1876/1 "2011-06-17T14:29:02Z")

</div>

Hi,

We have a normal chef style cookbooks repository on GitHub with about 30  
cookbooks or so in our site-cookbooks directory. Since I only want to open  
source a subset of them, I cannot just make our repository public. I was  
thinking about just setting up a second public repository and using git  
filter-branch to move the cookbooks we want to open into it. That seems  
like it work well for the initial release, but I wanted to make ongoing  
maintenance easy well. Assuming I don’t change the directory names, I  
believe I might be able to cherry-pick from the private repository to keep  
the public cookbooks up to date. The other alternative I thought was  
filter-branch’ing a new public repository, forking it and making the fork  
private. This requires more coordination with the other guys using our  
repository and I’m not sure if you can send a pull request to a public  
repository from a private one.

Anyone have a good suggestion? Thanks.

---

<div class="post-metadata">

**Author:** ![Charles\_Duffy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/charles_duffy/32/793_2.png) [@Charles\_Duffy](https://discourse.chef.io/u/Charles_Duffy)\
**Post date:** [June 17, 2011, 3:26pm UTC](https://discourse.chef.io/t/github-workflow-for-open-source-cookbooks/1876/2 "2011-06-17T15:26:28Z")

</div>

I don't try to sync cookbooks in our public repository back to the private  
one -- once it's moved to public, it's public, and that's the _only_ place  
it lives.

On Fri, Jun 17, 2011 at 9:29 AM, Eric Hauser [ewhauser@gmail.com](mailto:ewhauser@gmail.com) wrote:

> Hi,
> 
> We have a normal chef style cookbooks repository on GitHub with about 30  
> cookbooks or so in our site-cookbooks directory. Since I only want to open  
> source a subset of them, I cannot just make our repository public. I was  
> thinking about just setting up a second public repository and using git  
> filter-branch to move the cookbooks we want to open into it. That seems  
> like it work well for the initial release, but I wanted to make ongoing  
> maintenance easy well. Assuming I don't change the directory names, I  
> believe I might be able to cherry-pick from the private repository to keep  
> the public cookbooks up to date. The other alternative I thought was  
> filter-branch'ing a new public repository, forking it and making the fork  
> private. This requires more coordination with the other guys using our  
> repository and I'm not sure if you can send a pull request to a public  
> repository from a private one.
> 
> Anyone have a good suggestion? Thanks.

---

<div class="post-metadata">

**Author:** ![ringods](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ringods/32/154_2.png) [@ringods](https://discourse.chef.io/u/ringods)\
**Post date:** [June 17, 2011, 6:30pm UTC](https://discourse.chef.io/t/github-workflow-for-open-source-cookbooks/1876/3 "2011-06-17T18:30:43Z")

</div>

Eric,

On 17 June 2011 16:29, Eric Hauser [ewhauser@gmail.com](mailto:ewhauser@gmail.com) wrote:

> We have a normal chef style cookbooks repository on GitHub with about 30  
> cookbooks or so in our site-cookbooks directory. Since I only want to open  
> source a subset of them, I cannot just make our repository public. I was  
> thinking about just setting up a second public repository and using git  
> filter-branch to move the cookbooks we want to open into it. That seems  
> like it work well for the initial release, but I wanted to make ongoing  
> maintenance easy well.

Have a look at the following:  
[https://github.com/atriso/chef-repo-pas](https://github.com/atriso/chef-repo-pas)

> **[GitHub - mburns/chef-openerp-cookbook: Chef cookbook for OpenERP](https://github.com/mburns/chef-openerp-cookbook)**
>
> Chef cookbook for OpenERP. Contribute to mburns/chef-openerp-cookbook development by creating an account on GitHub.

The former link is a Chef repository on Github I am using for one of  
my customers, that has the single cookbook repository from the second  
link as a Git submodule.

Having the cookbooks I develop in separate Git repositories is easy  
for letting other people contribute. It is a repo on it's own, with  
tickets, pull requests and alike. Either, people use my repo (or their  
own fork) as a Git submodule within their Chef repository, or they use  
the knife plugin [1] that allows them to use the vendor branch pattern  
similar to "knife cookbook site install".

[1] [GitHub - websterclay/knife-github-cookbooks: A knife plugin facilitating installing, updating, and tracking Chef cookbooks found on Github.](https://github.com/websterclay/knife-github-cookbooks)

In your case, split out the cookbooks you want to share as separate  
Git repositories, and then pull them back in in your complete Chef  
repository as Git submodules.

Cheers,

Ringo

---

<div class="post-metadata">

**Author:** ![hedgehog](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/hedgehog/32/620_2.png) [@hedgehog](https://discourse.chef.io/u/hedgehog)\
**Post date:** [June 18, 2011, 7:06am UTC](https://discourse.chef.io/t/github-workflow-for-open-source-cookbooks/1876/4 "2011-06-18T07:06:44Z")

</div>

On Sat, Jun 18, 2011 at 12:29 AM, Eric Hauser [ewhauser@gmail.com](mailto:ewhauser@gmail.com) wrote:

> Hi,  
> We have a normal chef style cookbooks repository on GitHub with about 30  
> cookbooks or so in our site-cookbooks directory. Since I only want to open  
> source a subset of them, I cannot just make our repository public. I was  
> thinking about just setting up a second public repository and using git  
> filter-branch to move the cookbooks we want to open into it. That seems  
> like it work well for the initial release, but I wanted to make ongoing  
> maintenance easy well. Assuming I don't change the directory names, I  
> believe I might be able to cherry-pick from the private repository to keep  
> the public cookbooks up to date. The other alternative I thought was  
> filter-branch'ing a new public repository, forking it and making the fork  
> private. This requires more coordination with the other guys using our  
> repository and I'm not sure if you can send a pull request to a public  
> repository from a private one.  
> Anyone have a good suggestion? Thanks.

If you follow the opscode convention of with cookbook  
as folder the we can probably track that as upstream in  
[Multiple vendor Chef cookbooks. · GitHub](http://github.com/cookbooks).  
The thought was to have github teams per-cookbook, so you could be  
added to your cookbook's team if you wanted, and could soliicit others  
to join.  
Just how teams are formed and regulated is an open issue - thoughts?  
This team would manage community contributions to that cookbook,  
handle issues and pull requests, etc.  
The idea is:

- master branch tracks upstream, in this case your repo, in other  
cases 37signals or opscode.
- qa branch is for community contributions
- various teams should try to ensure that their cookbooks play nice  
with other cookbook's qa branches, it not its a bug - for which  
cookbook is for the various team members to debate - hopefully in  
public on the issue tracker.

That said we are still feeling our way in discovering what works for  
people. jnewland has made some nice contributions with his knife  
plugin and offering to run the cookbooks-bot.  
The objective is to try and facilitate contributions from those 400+  
forks of various cookbooks, and to try and bring to the surface  
cookbooks for less known applications.

Feed back welcome.

HTH

--  
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα  
[The fox knows many things, but the hedgehog knows one big thing.]  
Archilochus, Greek poet (c. 680 BC – c. 645 BC)  
[http://hedgehogshiatus.com](http://hedgehogshiatus.com)
