Issue #6703 resolved

Corrupt branch field on certain POST Web Hook calls

Arlo Carreon
created an issue

I setup my repo to pull from BB when ever there is a commit on BB.

I use this project for my webHook: http://mexitek.github.com/myWebHook/

While I logged all the post data sent to my webhook I noticed the one commit for which my web hook failed has corrupted branch/branches field.

Here is the post data sent to my hook after committing to staging:

Web Hook Post: March 15, 2013, 3:38 pm

{
   "repository":{
      "website":"",
      "fork":false,
      "name":"facebook",
      "scm":"git",
      "absolute_url":"/midealervirtual/facebook/",
      "owner":"midealervirtual",
      "slug":"facebook",
      "is_private":true
   },
   "truncated":false,
   "commits":[
      {
         "node":"7e95eb3a4b43",
         "files":[
            {
               "type":"modified",
               "file":"lightbox.css"
            },
            {
               "type":"modified",
               "file":"vehicle_detail.php"
            }
         ],
         "branches":[

         ],
         "branch":null,
         "utctimestamp":"2013-03-15 20:19:13+00:00",
         "author":"mexitek",
         "timestamp":"2013-03-15 21:19:13",
         "raw_node":"7e95eb3a4b43d9d418a3fc6e11bbcb56ad880bb2",
         "parents":[
            "f2a651b2579a"
         ],
         "raw_author":"Arlo Carreon <arlo.carreon@gmail.com>",
         "message":"Adding images to fancybox\n",
         "size":-1,
         "revision":null
      },
      {
         "node":"7a5c6337a98a",
         "files":[
            {
               "type":"added",
               "file":"images/blank.gif"
            },
            {
               "type":"added",
               "file":"images/fancybox_buttons.png"
            },
            {
               "type":"added",
               "file":"images/fancybox_loading.gif"
            },
            {
               "type":"added",
               "file":"images/fancybox_sprite.png"
            }
         ],
         "branches":[

         ],
         "branch":null,
         "utctimestamp":"2013-03-15 20:21:01+00:00",
         "author":"mexitek",
         "timestamp":"2013-03-15 21:21:01",
         "raw_node":"7a5c6337a98a45c43d33ff343abff8d8b4057ff8",
         "parents":[
            "7e95eb3a4b43"
         ],
         "raw_author":"Arlo Carreon <arlo.carreon@gmail.com>",
         "message":"forgot the assests\n",
         "size":-1,
         "revision":null
      },
      {
         "node":"64c72ba316b0",
         "files":[
            {
               "type":"modified",
               "file":"lightbox.css"
            }
         ],
         "branches":[

         ],
         "branch":null,
         "utctimestamp":"2013-03-15 20:27:09+00:00",
         "author":"mexitek",
         "timestamp":"2013-03-15 21:27:09",
         "raw_node":"64c72ba316b090a3794ad0597062da311b87a9ea",
         "parents":[
            "7a5c6337a98a"
         ],
         "raw_author":"Arlo Carreon <arlo.carreon@gmail.com>",
         "message":"Fixing css top glitch thing\n",
         "size":-1,
         "revision":null
      },
      {
         "node":"fa8c694b1c45",
         "files":[
            {
               "type":"modified",
               "file":"vehicle_detail.php"
            }
         ],
         "branches":[

         ],
         "branch":null,
         "utctimestamp":"2013-03-15 20:30:52+00:00",
         "author":"mexitek",
         "timestamp":"2013-03-15 21:30:52",
         "raw_node":"fa8c694b1c450ffbb5933f4570179cc737debf7d",
         "parents":[
            "64c72ba316b0"
         ],
         "raw_author":"Arlo Carreon <arlo.carreon@gmail.com>",
         "message":"default js config\n",
         "size":-1,
         "revision":null
      },
      {
         "node":"990a5849aba2",
         "files":[
            {
               "type":"modified",
               "file":"lightbox.css"
            }
         ],
         "branches":[

         ],
         "branch":null,
         "utctimestamp":"2013-03-15 20:33:34+00:00",
         "author":"mexitek",
         "timestamp":"2013-03-15 21:33:34",
         "raw_node":"990a5849aba28ec211c2ad35f1d932f7aea7946a",
         "parents":[
            "fa8c694b1c45"
         ],
         "raw_author":"Arlo Carreon <arlo.carreon@gmail.com>",
         "message":"centering the spinner\n",
         "size":-1,
         "revision":null
      },
      {
         "node":"4608cbca721f",
         "files":[
            {
               "type":"modified",
               "file":"vehicles.css"
            }
         ],
         "branches":[
            "master",
            "staging"
         ],
         "branch":null,
         "utctimestamp":"2013-03-15 20:36:13+00:00",
         "author":"mexitek",
         "timestamp":"2013-03-15 21:36:13",
         "raw_node":"4608cbca721f638242b10cc082fabbf5e687389f",
         "parents":[
            "990a5849aba2"
         ],
         "raw_author":"Arlo Carreon <arlo.carreon@gmail.com>",
         "message":"fixing position issues\n",
         "size":-1,
         "revision":null
      }
   ],
   "canon_url":"https://bitbucket.org",
   "user":"mexitek"
}

Comments (5)

  1. Jesper Nøhr

    How is the branch field "corrupted" here? As far as I can tell, it's only there in the last commit, which makes sense, as we include branch information only for branch heads, since in git, the branch is not recorded at time of commit, and must be deduced.

  2. Arlo Carreon reporter

    I see. For some reason when I was first testing this with a merge the first commit object had the branch data under branches : [].

    So are we guaranteed that the branch information will always be on the last commit object in the commits array?

  3. Log in to comment