How to retrieve which commit hashes are included in a expired or deleted Bamboo build

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

After a build result is expired or deleted from Bamboo, it's not possible to retrieve which were the commits of those builds.

However if the build is consuming a Bitbucket repository the information is still available in Bitbucket's database.

Environment

This information available only for Bamboo plans that consume Bitbucket server/DC repositories.

Solution


Using the following SQL statement it's possible to retrieve all builds that contained a specific commitID:

SELECT
    BBS.commit_id,
    BBS.name,
    BBS.build_key,
    BBS.build_number,
    BBS.created_date,
    BBS.updated_date,
    BBS.ref
FROM
    public.bb_build_status BBS
WHERE
    BBS.commit_id LIKE '%6afb46fde71%' 

(info) Substitute 6afb46fde71 with the commit id and the results will display all the builds associated with that commit id.

Using the following SQL statement it's possible to retrieve all commits that contained a specific build key:

SELECT
    BBS.commit_id,
    BBS.name,
    BBS.build_key,
    BBS.build_number,
    BBS.created_date,
    BBS.updated_date,
    BBS.ref
FROM
    public.bb_build_status BBS
WHERE
BBS.build_key LIKE '%PLAN-KEY%'

(info) Substitute PLAN-KEY with the plan key



Last modified on Jan 27, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.