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

We need a REST endpoint to update the status of an older build

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • API - REST
    • None
    • 2
    • 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

      At present, as per documentation, we have the

      POST /rest/build-status/1.0/commits/{commitId}
      

      endpoint that associates a build status with a commit.
      However, if you have an older build (ie. not the latest for the given commitId within the same plan), you cannot update its state using this endpoint. If you send such POST request, a new build will be created.

      We need a new REST endpoint that would allow updating the older builds, so that we don't have to use the unsupported method of modifying the database, as suggested in the Workaround.

      Workaround

      • To update the state of an older build (eg. to Failed), find its ID in the BB_BUILD_STATUS table, then execute the following SQL query:
        UPDATE BB_BUILD_STATUS SET STATE = 'FAILED' WHERE ID = '<build_ID>'
        
      • If you have already created an additional build using the aforementioned POST request, find its <build_ID> in the same table, then delete it using the following query:
        DELETE FROM BB_BUILD_STATUS WHERE ID = '<build_ID>'
        
      Please note

      Running SQL queries directly against Bitbucket's database is not a supported approach.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              msuchecki Marek Suchecki
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: