Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-11847

Include commits/commit message in push (refs_changed) event payload

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • 8.8.0
    • Webhooks
    • None
    • 0
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      Currently when users push to a repository, the resulting payload for any configured webhooks does not contain any information surrounding the commits that were pushed. This request is to include this commit information, to a reasonable degree, so that it can be used by the applications receiving the webhook payload. One example of how this could be implemented comes from how these events are handled for the equivalent push payloads in Bitbucket Cloud:

      commits: An array containing up to 5 of the most recent commits pushed to the reference. The array for a push with more than 5 commits is truncated, which is indicated by the truncated property.

      For reference, here is the current payload as it exists in Bitbucket Server today:

      {  
        "eventKey":"repo:refs_changed",
        "date":"2017-09-19T09:45:32+1000",
        "actor":{  
          "name":"admin",
          "emailAddress":"admin@example.com",
          "id":1,
          "displayName":"Administrator",
          "active":true,
          "slug":"admin",
          "type":"NORMAL"
        },
        "repository":{  
          "slug":"repository",
          "id":84,
          "name":"repository",
          "scmId":"git",
          "state":"AVAILABLE",
          "statusMessage":"Available",
          "forkable":true,
          "project":{  
            "key":"PROJ",
            "id":84,
            "name":"project",
            "public":false,
            "type":"NORMAL"
          },
          "public":false
        },
        "changes":[  
          {  
            "ref":{  
              "id":"refs/heads/master",
              "displayId":"master",
              "type":"BRANCH"
            },
            "refId":"refs/heads/master",
            "fromHash":"ecddabb624f6f5ba43816f5926e580a5f680a932",
            "toHash":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
            "type":"UPDATE"
          }
        ]
      }
      

      Where this is the payload information from Bitbucket Cloud that would be nice to have implemented in Server:

              "commits": [
                {
                  "hash": "03f4a7270240708834de475bcf21532d6134777e",
                  "type": "commit",
                  "message": "commit message\n",
                  "author": User,
                  "links": {
                    "self": {
                      "href": "https://api.bitbucket.org/2.0/repositories/user/repo/commit/03f4a7270240708834de475bcf21532d6134777e"
                    },
                    "html": {
                      "href": "https://bitbucket.org/user/repo/commits/03f4a7270240708834de475bcf21532d6134777e"
                    }
                  }
                }
              ]
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              eslaughter@atlassian.com Evan Slaughter
              Votes:
              8 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: