Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-8548

Better CI integration: Add a build status API for commits (BB-9631)

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Hi,
      It would be nice if Bitbucket supported one of Stash's features, which also GitHub has it, build status api for commits as described here: https://developer.atlassian.com/stash/docs/latest/how-tos/updating-build-status-for-commits.html

      With this API, we could better integrate BitBucket with our current CI server.

            [BCLOUD-8548] Better CI integration: Add a build status API for commits (BB-9631)

            Attachment 3651779018-Screenshot%20from%202016-02-10%2014.44.47.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            Legacy Bitbucket Cloud User (Inactive) added a comment - Attachment 3651779018-Screenshot%20from%202016-02-10%2014.44.47.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            gion_13 added a comment -

            Attachment 1292792713-bitship-disable2.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            gion_13 added a comment - Attachment 1292792713-bitship-disable2.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            gion_13 added a comment -

            Attachment 134794843-bitship-disable.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            gion_13 added a comment - Attachment 134794843-bitship-disable.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            Attachment 2842112559-screenshot.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            chesleybrown added a comment - Attachment 2842112559-screenshot.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            legacy-bitbucket-user added a comment -

            Attachment 3335932978-687474703a2f2f6661726d392e737461746963666c69636b722e636f6d2f383039362f383532393634323430365f323965336539613839395f6f2e706e67.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            legacy-bitbucket-user added a comment - Attachment 3335932978-687474703a2f2f6661726d392e737461746963666c69636b722e636f6d2f383039362f383532393634323430365f323965336539613839395f6f2e706e67.png has been added with description: Originally embedded in Bitbucket issue #8548 in site/master

            dtao added a comment -

            @stevepeak you asked that question months ago and I totally forgot to respond! My understanding is that at this point you've already gotten the information you were looking for; but for posterity, in case anyone else was wondering, we do have a diff API. The documentation (not perfect, but better than nothing) is here: https://confluence.atlassian.com/display/BITBUCKET/diff+Resource

            Basically you can hit /diff/bar..foo and get a raw diff of the changes from foo to bar.

            Example: https://api.bitbucket.org/2.0/repositories/tortoisehg/thg/diff/c594574..0fef1c0

            dtao added a comment - @stevepeak you asked that question months ago and I totally forgot to respond! My understanding is that at this point you've already gotten the information you were looking for; but for posterity, in case anyone else was wondering, we do have a diff API. The documentation (not perfect, but better than nothing) is here: https://confluence.atlassian.com/display/BITBUCKET/diff+Resource Basically you can hit /diff/bar..foo and get a raw diff of the changes from foo to bar. Example: https://api.bitbucket.org/2.0/repositories/tortoisehg/thg/diff/c594574..0fef1c0

            @dtao This is amazing. Woo!

            stringerbell added a comment - @dtao This is amazing. Woo!

            stevepeak added a comment -

            @dtao this is great, and unexpected, news! Thanks for creating this endpoint.

            PS (slightly unrelated) Is there a diff/compare endpoint? If not... is this possible: ../compare/:head...:base or ../diff/:sha?since=:base_sha
            RE BCLOUD-4779
            RE https://developer.github.com/v3/repos/commits/#compare-two-commits

            stevepeak added a comment - @dtao this is great, and unexpected, news! Thanks for creating this endpoint. PS (slightly unrelated) Is there a diff/compare endpoint? If not... is this possible: ../compare/:head...:base or ../diff/:sha?since=:base_sha RE BCLOUD-4779 RE https://developer.github.com/v3/repos/commits/#compare-two-commits

            dtao added a comment -

            @stringerbell Yes, we actually do have that API! As for the URL, your guess was close; it's at:

            GET https://api.bitbucket.org/2.0/repositories/{owner}/{repo_slug}/commit/{revision}/statuses
            

            To see an example, try hitting https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/d62ae57/statuses.

            We are in the process of making some changes to our documentation, so this small but useful addition slipped through the cracks. I'll be sure to get our docs updated soon, but in the meantime the API is there for you to use.

            cc @stevepeak

            dtao added a comment - @stringerbell Yes, we actually do have that API! As for the URL, your guess was close; it's at: GET https: //api.bitbucket.org/2.0/repositories/{owner}/{repo_slug}/commit/{revision}/statuses To see an example, try hitting https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/d62ae57/statuses . We are in the process of making some changes to our documentation, so this small but useful addition slipped through the cracks. I'll be sure to get our docs updated soon, but in the meantime the API is there for you to use. cc @stevepeak

            @dtao: any word on getting all statuses from this endpoint now? (like @stevepeak suggested) I'd love to see that too. It'd be super useful so you don't have know about the builds ahead of time to get their status.

            I'd imagine it'd look like this:

            {{GET https://api.bitbucket.org/2.0/repositories/

            {owner}

            /

            {repo_slug}

            /commit/

            {revision}

            /statuses/build/}}

            stringerbell added a comment - @dtao: any word on getting all statuses from this endpoint now? (like @stevepeak suggested) I'd love to see that too. It'd be super useful so you don't have know about the builds ahead of time to get their status. I'd imagine it'd look like this: {{GET https://api.bitbucket.org/2.0/repositories/ {owner} / {repo_slug} /commit/ {revision} /statuses/build/}}

              dtao dtao
              legacy-bitbucket-user Legacy Bitbucket Cloud User (Inactive)
              Votes:
              114 Vote for this issue
              Watchers:
              85 Start watching this issue

                Created:
                Updated:
                Resolved: