How Bamboo manages and displays commit authors

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.

    

Summary

Bamboo builds store a lot of information. In this KB we are going to focus on commits related to a build, and how Bamboo display authors in the build results page for a plan.

Environment

Any Bamboo supported version.

Diagnosis

We can start by setting some context: when we open a plan, we will see the most recent builds, together with information on who made changes to the repository behind the plan. For example:

On the column "Reason" we see the information "Changes by mate". In this context, "mate" is the author of the commit that triggered the build.

Let's expand a bit on the concept. The tables where this information is stored, and how is related to the build result, are:

We have the table "author" where this information is stored. The columns on this table are:

  • author_id: id (PK) of the entry.
  • linked_user_name: if present, then in the field "Changes by" Bamboo will show the username and email of the user in the user directory.
  • author_email: email of the author, coming from gitconfig
  • author_name: name of the author. This will be displayed in the field "Changes by" if linked_user_name is empty.

Now, let's use an example:

  • User stan1, with name "Stan", exists as a user in Bamboo
  • stan1 makes commits. His name ("Stan") will appear in the field "Changes by".
  • We can see this by running the query
select * from author where linked_user_name = 'stan1';


Authors are linked to build results through the id:

  • author.author_id - user_commit.author_id
  • user_commit.repository_changeset_id - repository_changeset.repository_changeset_id
  • repository_changeset.buildresultsummary_id - buildresultsummary.buildresultsummary_id
  • Table buildresultsummary will have plan key and build result.

Let's keep going with a concrete example. Let's say you want to know who made the changes for PROJ-PLAN, build #10. The query that will provide this information is:

select a.* from author a, user_commit uc, repository_changeset rc, buildresultsummary brs
where a.author_id = uc.author_id and
uc.repository_changeset_id = rc.repository_changeset_id and 
rc.buildresultsummary_id = brs.buildresultsummary_id
and brs.build_key='PROJ-PLAN' and brs.build_number = 10;



Last modified on Jan 27, 2022

Was this helpful?

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