guides-cms icon indicating copy to clipboard operation
guides-cms copied to clipboard

Support adding a branch via github push webhook

Open durden opened this issue 9 years ago • 2 comments

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 avatar May 24 '16 09:05 durden

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 avatar May 24 '16 09:05 durden

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.

durden avatar May 24 '16 09:05 durden