pluralsight / guides-cms

DEPRECATED - Markdown based CMS with Github repository as persistent storage
http://www.pluralsight.com/guides/
GNU Affero General Public License v3.0
108 stars 35 forks source link

Support adding a branch via github push webhook #81

Open durden opened 8 years ago

durden commented 8 years ago

Currently we remove branches from the details.json metadata file when a branch is deleted via github. This is done via the delete webhook. We should also hook into adding a branch via the push event.

We're already handling the push web hook, but we're only using it to clear our guide cache.

durden commented 8 years ago

This would be useful in a few scenarios:

  1. The 'restore branch' button in the Github.com UI.
    • Sometimes editors might delete a branch on accident. The delete will trigger the branch to be removed from the associated details.json file. However, hitting the 'restore a branch' will not re-add it to the details.json file.
    • The net effect of this is that our site will never show a link to this branch again unless we manually edit the metadata file or the user makes another edit to the original guide from our site.
  2. Collaborator pushes a new branch and forgets to update the guide's details.json file.
    • Supporting this would make it very easy to support workflows where editors could do everything from the CLI and then just push a new branch to github.com. They wouldn't even need to edit the details.json file at all since the push event would detect a new branch and make the update automatically.
durden commented 8 years ago

Now that I think about it, adding this functionality would go a long way towards supporting #9.

Adding this doesn't solve the issue of user verification because only github collaborators could push a new branch from the CLI. However, it would make it easier on collaborators (and our eventual script) to not require editing of the details.json file.