Best Practices for Сreating External Documentation Site in Confluence

February 24, 2022
#How To#Confluence Tutorial#Confluence
22 min

We all love Confluence so much for the ability to have the information at hand, open and well-organized. It makes cooperation easy as a pie and saves us a lot of time. But when it comes to creating external documentation in Confluence for our products, we can get stuck.

The good news is that all we need is already in Confluence, and documentation for our products can be ready in a few hours.  However, it can be challenging to quickly find the required information since it can be scattered across multiple Confluence pages and spaces. External users need to have limited access to all these pages and see only the relevant information. Moreover, an inexperienced user can easily be lost in Confluence. The interface we all love and find so convenient can appear not so intuitive for those who see a Confluence page for the first time.

You can be a little bit overwhelmed with all that given, however, the solution is simple yet powerful. Keep reading for the best practices for creating an external documentation site in Confluence Cloud.

Create a separate space for your documentation

For security and common sense reasons, we can’t let external users browse our whole Confluence instance. So let’s create a separate space for our product documentation and collect the information for our users there.

Confluence allows flexibility in access restrictions for separate spaces. You easily define what particular users or user groups can do across Confluence pages within a space.

As we create product documentation, we need all users worldwide to access it. Anonymous access works great for that. Navigate to the Confluence sidebar, locate Space settings > Space permissions, and click General.

space access restrictions in Confluence

Scroll down to Anonymous Access. Here you can choose the permissions for all external users of your Confluence Cloud documentation site. Be mindful that you can grant broad permissions to anyone outside your organization. Limiting anonymous access to viewing and commenting is reasonable to ensure information consistency and quality. You can read more about space permissions in the Atlassian Support documentation. We suggest enabling only viewing permission for a documentation site.

space permissions in Confluence Cloud

In this case, you can be sure that your product documentation pages remain clean and concise. Commenting is a great thing, but it can be distracting on informational pages. There are other better ways to communicate with your users, and we’ll cover them later in this article.

Organize the information in your Confluence documentation space

Once you’ve created a separate space for your documentation site in Confluence and given access to anonymous users to it, you need to think about the page structure. Even the most valuable information can become useless when readers can’t reach it effortlessly.

It’s a good idea to start your documentation site with the page tree in mind. Spend some time thinking about the logical structure of your space. You can go even further and create a quick draft on a sheet of paper to consult it while creating Confluence pages.

An apparent solution here is to create a home page with general information, parent pages for the main features of your product, and child pages for minor functions or details. You may also want to create separate sections for FAQs, releases, and other technical information. As a result, you’ll get a well-organized documentation site in Confluence that is easy to browse even for inexperienced users.

page tree in a Confluence Cloud

Other things to keep in mind

The devil is in the detail. All product owners know it for sure. When it comes to your product, you need to always be on top of things. Many great products remained unnoticed because of nuances like an irrelevant logo, title, or bad documentation.

Have you already created a product documentation space in Confluence? Presumably, you were even accurate enough in a space structure. It’s time to leverage your product documentation site with our tips.

Keep your page tree neat and skimmable

Create Confluence pages according to the chosen structure. Don’t make a complex structure where users can get lost. Believe it or not, 2-3 levels of child pages can be complicated enough for your readers. Don’t go overboard.

Keep page names simple

Don’t give readers a reason to quit. Create Confluence pages with short names. The ugly truth is that people are lazy by nature. Who would love to open the page with an academic name like “A technical documentation covering the engineering implementation, functionality, and out of scope issues of a Confluence inline macro for status tracking”? And what if you place the same information under the “Handy Status” title? It looks like this option has a much higher chance of getting read.

Be consistent

Choose the principle of page naming and follow it throughout your documentation. We love to see something known and traditional. No need to vary your page names from section to section. For example, you have a page “How to use Handy Status.” Once you create another one about Handy Date, you may write “Using Handy Date.” The idea is the same, but this inconsistency would distract readers. Stick to one model throughout your Confluence space.

Create a beautiful Confluence page for your documentation overview

Documentation sites in Confluence are easy to set up, but they can be plain and look boring for external users. A landing page with the Children display macro for navigation seems intuitive for you, but it can turn out to be unattractive in your readers’ eyes. In the end, the primary purpose of our documentation site is the satisfaction of our end user. They refer to our documentation expecting to get quick answers to their questions. Their customer journey on our public Confluence site depends on us so let’s make it a smooth adventure.

Highlight the key features of your product

You’ll be surprised, but the visitor of your documentation can know little about your fantastic product. Many users start the evaluation of the product with its documentation. They will walk through the functionality you describe deciding whether your product is worth a trial period. Use this insight to your advantage – create a top-notch documentation site demonstrating the best of your product.

The main page should be concise but informative. Create an attractive page with a brief product description, point out the key features with the bullet list, and add links to the detailed technical description.

Embed video in Confluence

We’re pressed with time and want to proceed with daily tasks as quickly as possible. Add a short demo video to help users learn more about your product. 

In Confluence, you can insert links to your Youtube videos in several ways.

First, you can insert the link to your video directly into the Confluence page. Choose the way the link is shown on a page. For better visibility, we advise the Display embed option.

Choose the way links look on a Confluence page

If public links are disabled for your Confluence instance and you want anonymous users to see them, use the Widget Connector macro. It allows you to embed Youtube videos, Flickr slideshows, Twitter streams, Google Docs, and other content from the web into Confluence pages in a few clicks. You can choose the source address and the preferrable size of your media. With this method, you can be sure that even anonymous users will reach the content on your page once you allow the public access to it.

Widget Connector macro to embed multimedia in Confluence Cloud

Add a call to action to your Confluence page

Our documentation is another touchpoint with our users. Let’s benefit from it. Add an effective call to action to your main page to trigger additional contacts between you and your site visitors. This could result in long-term relationships in the future. The only thing here is that your call to action needs to be appealing and easy to locate on Confluence pages.

At Stiltsoft, we use the Handy Button macro for that. It’s a part of the Handy Macros for Confluence app. It allows you to create Confluence-like buttons and customize their color and size. Another great thing is that you can easily reuse your Confluence content as Handy Button can lead to an external address or an internal Confluence page.

Handy Button to create clickable links in Confluence

We suggest creating noticeable links somewhere on top of your documentation page so that users can see them without scrolling the page.

external documentation in Confluence

Show the product roadmap

Your customers could be interested in the information about upcoming releases. The features you are working on can become your strength when your users know about them. Don’t go deep here, a short plan overview will be enough.

You can show a table with the product development progress from your product dashboard. Here’s an example that we suggest.

Create product roadmaps in Confluence

Simple as it is, this table gives an overview of what to expect from the product in the next few months. The user sees the feature itself, its status, and progress. To ensure that the information is always up-to-date, put the content from your product space into the documentation page using a combination of the Excerpt and Excerpt Include macros. This way, you can rapidly reuse the existing table on several Confluence pages. Once the values of the original table change, reused tables will be updated automatically.

Use Excerpt Include to reuse information in Confluence

You can effortlessly create these dashboards in your space. Your team will benefit a lot from focusing on the essential things. To start with, add the Excerpt macro to your page, create the table with statuses, add sliders for progress management.

Use Excerpt to reuse the information in Confluence

You can add the native Confluence Status macro. Type /Status to add it to the page.

Add statuses in Confluence

Another solution is Handy Status, a macro allowing you to create a custom set of statuses and easily switch them in the page view mode.

Create dropdowns in Confluence with Handy Status

Handy Slider is another macro from the Handy Macros for Confluence app. It can transform your table into an interactive infographic in a second. Just type /Handy Slider, insert it to the page, and set the value. The macro coloring changes based on its value, making progress tracking even more accessible.

Add interactive sloders to track and visualize changes in Confluence

You can change Handy Slider in the page view mode. But no worries here. Anonymous users won’t affect your data as they can’t change the Handy Slider value on a page.

Highlight the relevant content

Even though you have created an excellent documentation structure, it’s reasonable to put links to the pages frequently read by your users on the main page.

Use button lists to highlight information in Confluence

Keep these bullet lists short. Too many highlights can affect your readers in an opposite way leading to distraction from the key points.

Provide additional navigation

Your readers are newbies to your Confluence site. It’s your role to help them look around. Why not add some more navigational tools? Add the Labels list macro to create a list of labels used in your Confluence documentation space. If you’re accurate enough to update labels for your pages, you’ll get quick navigation by topic, like this one:

Users can browse Confluence content by topic with the Label list macro

A search bar is a must-have for an external Confluence site. It’s probably the best way to locate the necessary information in a few seconds. Use the Livesearch macro to embed a search box into your Confluence page to show search results as you type.

Search for information in Confluence with a search bar

You can customize its look in the settings to satisfy your needs better.

Share the event agenda

If you organize webinars, meetings, or other events related to your product and best practices, you can promote them on your Confluence documentation site. The audience coming to read about your product is presumably interested in your educational content.

You can put an announcement of upcoming events in a table generated with the help of another Confluence native macro, Page Properties Report. When combined with Page Properties, it collects the tabular data across multiple Confluence pages based on the selected criteria.

Page Properties Report in Confluence

As a result, in our example, we get a brief table overview of the webinars described on three different Confluence pages.

With Handy Macros for Confluence, you can go even further and add some dynamic macros to this table.

Handy Date is a great way to highlight the dates of future events for our use case. This macro enriches your experience with date operations in Confluence. You can change the date in the page view mode and choose the date coloring.

Add Handy Buttons to create clickable buttons on your Confluence page. Once you do it and provide the links to your webinar registration or stream record, your users will be able to enroll and take part in your events right from the documentation site.

links on Confluence pages in Page Properties Report

Move on to your external documentation

Confluence empowers its users with great tools for any need or purpose. Now you see how to organize an external documentation site without any additional development or engineering skills. Just use the native Confluence macros in combination with Handy Macros for Confluence. You can try the app for free on the Atlassian Marketplace to see how you can benefit from it. If you still have questions, don’t hesitate to contact us.

Analyze How Code Review is Going in Bitbucket Data Center

September 27, 2021
#Analytics#How To#Bitbucket
9 min

Awesome Graphs is one of our most popular apps. It’s a solution that extends Bitbucket, a platform that teams use to host Git repositories and collaborate on code.

Awesome Graphs helps engineering leaders and software teams improve their own processes and deliver products faster by transforming invisible development activities into easy-to-understand insights and reports.

One of the keys focuses of the app is the code review processes analytics. We would like to tell you which features support this use case and how you can benefit from the app. Keep reading if you are interested in:

  • Seeing how actively your team members review code
  • Analyzing what developers may need to improve their work patterns and who’s doing a great job
  • Learning what reviewers are most active and diligent
  • Knowing the average time taken to resolve pull requests.

Code review analysis

code review analysis in bitbucket

The Contributions Report analyzes activity in pull requests (tasks, comments, needs work/approved/declined statuses). It helps you understand:

  • What developers create high-quality code and who might need to improve their approach to work. E.g. when an engineer has fewer taskscomments, and needs work flags in their pull requests, it suggests his work is approved as it is or with minor changes and he creates code of high quality.
  • What reviewers are thorough when they review the work of developers. E.g. diligent reviewers come up with suggestions and improvements, so they have more tasks and comments than others.
  • How the dynamics of code review changes over time. E.g. you can see if the number of pull requests with Needs work flags is getting bigger or smaller if the number of tasks in pull requests is increasing or decreasing over time.

Learn more

The average time taken to resolve pull requests

pull requests resolution time report in bitbucket

Another report, Resolution Time Report, shows the average time taken to resolve pull requests. This is helpful to capture trends in resolution time. It displays resolution times of merged and declined pull requests separately. With this report you can:

  • Notice spikes in resolution time and then dive in to see what went wrong
  • See if an average resolution time is high for a long period of time – it can be a signal to look into your code review process and determine what causes delays
  • Monitor how changes in your processes affect the speed of code review.

Learn more

Knowledge sharing indicators

reviewers of pull requests report in bitbucket

The Pie Chart Report is a handy way to check if all developers in your team are involved in the code review. This report shows the breakdown of pull requests by different statistics types.

Grouped by reviewer, the Pie Chart Report shows the following:

  • How many pull requests each person reviewed. These metrics help understand how much everyone contributes to the project.
  • Whether all people review code or there are one or two who are doing all job. This is an indicator of poor knowledge sharing.
  • Who is too busy reviewing all pull requests of their team. These people can become a bottleneck that slows the delivery time, because they’re not available for immediate review.

Learn more

Pull requests with a too long or too short resolution time

pull requests resolution time report in bitbucket

The Resolution Time Distribution Report visualizes pull requests grouped by the time taken to merge or decline them and gives an idea of the most frequent resolution times on your project. Using this report. you can easily:

  • find pull requests with the longest resolution time to check the reasons for the delay
  • see pull requests with the shortest time to resolve them to investigate whether they were checked as appropriate
  • predict the resolution time for the future pull requests.

Learn more

Exporting pull requests for the future processing

With Awesome Graphs, the historical data can be exported to a CSV file right on the People page.

exporting pull requests from bitbucket

As a result of the exporting, you receive the CSV file with the list of pull requests (alternatively, the list of commits) with their details about the author, reviewers, state, the date they were created and last updated. The files can be processed in Excel or integrated with analytics tools like Tableau, Power BI, etc. to create custom graphs and dashboards and merge with the data from other apps.

Learn more

What other reports do you need?

Awesome Graphs already has a wide range of graphs and reports that help you answer various questions about project development and the work of your team in Bitbucket. We are open to your feedback and appreciate hearing about what you need. So if you have a problem that you think Awesome Graphs can help you with, contact us – we actually listen.

Try Awesome Graphs for free

 

Pull Request vs. Merge Request

June 28, 2021
#Analytics#How To#Bitbucket
7 min

When it comes to choosing a Git management tool, you need to consider various factors as it significantly affects the workflow. One of the most important aspects is how collaboration is organized in this application. Pull Request in Bitbucket and GitHub or Merge Request in GitLab are the features made for more convenient code review. These features are equivalent as they both do the same git merge command to merge feature branches or forks with the existing code.

You probably want to ask why you need to use a special tool for something that a git command can do, but convenience and efficiency are what makes a difference here:

  • Your team ends up having a much higher quality code in your project as everyone on your team can check it and merge branches only after the code is good enough and meets your coding standards.
  • You get a well-organized process where you can leave comments and see the changes in one tool. So there’s no need to use emails and other communication channels to discuss features. It works perfectly, especially for distributed teams, no matter whether they are located – in different rooms or cities.
  • This feature allows you to get some insights into how effective your team is.

Working with Pull Requests in Bitbucket

Let’s look at how to use pull requests in Bitbucket and what information about your team performance you can get from it.

For instance, one of your developers has just finished working on a feature in a dedicated branch. Now, this feature should be merged with the development branch. But first, other team members should review it.

So, your developer navigates to Create pull request, chooses the feature branch as Source and the development branch as Destination. The developer can add the Title and Description of the pull request and choose who will be Reviewers of it or leave it without a particular reviewer.

create pull request in Bitbucket

Then a discussion of the feature begins. Each reviewer can:

  • see what files have been edited, what commits have been made
  • see what’s been changed since they last reviewed so that there’s no need to re-review everything again
  • add comments to the whole pull request or a particular code line and discuss it

comment pull request or code line in Bitbucket

  • decline a pull request or set Needs work status
  • merge a pull request and delete the source branch if needed.

merge pull request in Bitbucket

Working with Merge Requests in GitLab

Now let’s find out how to use the Merge Request feature in GitLab to improve the code review process.

Navigate to Merge Requests and click New merge request. 

create merge request in GitLab

Choose the Source branch that you want to merge and the Target branch which will be the destination.

merge source branch with target branch

Same as Bitbucket, GitLab allows you to choose who will review this request. It’s also possible to see the changes in edited files, the commits included in the merge request, discuss the feature, and make suggestions.

When reviewers approve the changes, click Merge to merge branches.

how to merge branches in GitLab

Insights on Your Team Performance in Bitbucket

While working in Bitbucket, you can also evaluate your team performance using the Awesome Graphs for Bitbucket app. It is possible to:

contributions report in Bitbucket

Improve your development process

Such collaboration while working on the project positively affects the quality of the code your team produces. Moreover, pull requests definitely reduce the number of bugs in the code.

As a result, the quality of your product gets better, and your customers become much more satisfied. Thanks to the detailed analysis of your team’s performance using Awesome Graphs for Bitbucket app, it’s possible to improve it and increase the speed of the development process.

Try it for your team!

How to Search for Commits in Bitbucket Server and Data Center

May 17, 2021
#Reporting#Analytics#How To#Bitbucket
14 min

Bitbucket has greatly improved the development workflow of teams and companies that use Git with its friendly interface and features. However, sometimes it lacks opportunities for convenient work with commits. Have you ever wasted time scrolling the mouse wheel trying to find some of the old commits? Luckily, there are some ways to make your life easier and search for commits in Bitbucket. In this article, you will learn how to find:

  • projects and repositories in your Bitbucket that a certain user contributed to (filter by author)
  • commits that were made long ago to a repository with high activity (filter by time)
  • the commits of a user made to a repository or project (filter by author and project/repo)
  • all the commits made to a project (filter by project).

We’ll also show you how to automate the process using the Bitbucket REST API, as well as the Awesome Graphs REST API and the Export to CSV feature.

Sourcetree search opportunities

Sourcetree is an Atlassian desktop client for working with Git and Mercurial repositories. It provides an opportunity to search for commits by an author, a commit message, and a file.

search for commits by an author, a commit message, and a file in Sourcetree

Its user-friendly interface helps find commits easier, but it’s impossible to look at them for all repositories at once as you need to go to each repo manually. Besides, it needs to be installed on each computer separately and is not available for Linux.

Use Awesome Graphs to search commits in Bitbucket

Awesome Graphs for Bitbucket helps engineering leaders and software teams improve their processes and deliver products faster by transforming invisible development activities into easy-to-understand insights and reports. Convenient search for commits isn’t its main purpose, but a nice bonus.

This app indexes information about commits, which makes searching by author, time, or repository faster and does not affect even huge Bitbucket instances (70,000+ repositories).

The Contributions graph shows the activity of each developer during a year as a calendar. So it’s an easy way to find all the commits made by a person to all projects and repositories. Here you can also filter the commits of a particular user by time period (up to a year) and by project or repository.

Contributions graph in Bitbucket

Below the calendar, there is a list of all commits made during the selected time span. By default, it’s a year, but it’s possible to choose any period to display.

activity stream in Bitbucket

In order to find the commits made to a certain repository regardless of their author, use the Activity graph. It shows all commits for the last year or a shorter time span in the Activity section below the charts.

contributor activity in Atlassian Bitbucket

And if you need to find commits made long ago, the Top Committers Report can be a good solution. In general, its use-case is to find the most active contributors of the project or repository, but you can configure the Period of time and choose Authors of the commits you’re searching for.

top commiters report in Atlassian Bitbucket

As a result, it shows the list of all commits for the selected time span in the Activity section below as well as their distribution in time.

Top Committers report in Atlassian Bitbbucket

Export commit data to CSV

Awesome Graphs for Bitbucket also gives you the capability to export commit data to CSV in different ways. As a result, you’ll get a list of commits with their details:

export commit data to CSV

To export raw commit data to CSV directly from Bitbucket, you need to go to the People page. There you’ll notice the Export menu at the top-right corner, where you can choose CSV.

Developers list in Atlassian Bitbucket

Another way to export commit data to CSV is to use the Awesome Graphs REST API, which allows you to automate the processes and retrieve this data easier using the dedicated resources.

You can access the in-app documentation (accessible to Awesome Graphs’ users) by choosing Export → REST API on the People page or go to our documentation website.

Search for commits in Bitbucket via REST API

Bitbucket REST API provides a possibility to get the list of all commits in the repository using this request.

https://example.com/rest/api/1.0/projects/exampleprojectkey/repos/example-repository-slug/commits

The request can be extended by specific parameters to receive a more accurate result. For instance, since and until options help to get the commits made after or before a certain commit, or between two commits defined by their IDs. Merges parameter controls how to handle merge commits – exclude merge commits, include both merge commits and non-merge commits, or only return merge commits.

https://example.com/rest/api/1.0/projects/exampleprojectkey/repos/example-repository-slug/commits?merges=exclude&since=ea3eea9dcbd&until=f4240bf022a

As a result, you receive a JSON response with the list of the commits and their IDs, author’s names and email addresses, commit messages, and parents.

{
    "values": [
        {
            "id": "f4240bf022a69815241a883c03645444b58ac553",
            "displayId": "f4240bf022a",
            "author": {
                "name": "Max Desiatov",
                "emailAddress": "max@desiatov.com"
            },
            "authorTimestamp": 1557113671000,
            "committer": {
                "name": "Tomer Doron",
                "emailAddress": "tomer@apple.com"
            },
            "committerTimestamp": 1557113671000,
            "message": "Add internal section link to README.md (#71)",
            "parents": [
                {
                    "id": "ea3eea9dcbd46887d846696261f54b3d2f74fecd",
                    "displayId": "ea3eea9dcbd"
                }
            ]
        },

Alternatively, you can use the Awesome Graphs REST API that provides global, user, project, and repository data. The solution allows you to retrieve data faster while decreasing the load on the instance compared to Bitbucket REST API. 

Use this request to get a list of commits from the specified repository.

https://example.com/rest/awesome-graphs-api/latest/projects/exampleprojectkey/repos/example-repository-slug/commits

The response will look as follows:

{
  "values": [
    {
      "user": {
        "emailAddress": "yorlov@stiltsoft.com",
        "displayName": "Administrator",
        "name": "admin"
      },
      "author": {
        "displayName": "admin",
        "emailAddress": "yorlov@stiltsoft.com"
      },
      "authorTimestamp": "2020-03-05T22:58:18Z",
      "linesOfCode": {
        "added": 1,
        "deleted": 0
      },
      "parents": [],
      "repository": {
        "slug": "Commit Hook",
        "name": "commit-hook",
        "project": {
          "key": "TESTCONTAINERS",
          "name": "Testcontainers",
          "type": "NORMAL"
        }
      },
      "id": "9f2e24a147bb8f5a5a3d10b692703cc5784df8b5"
    },
  ],
}

Learn more about the available REST API resources.

Find out what works best for you

We’ve described different ways to work with commits effectively:

  • Sourcetree as a free application that is suitable for searching among a small number of repositories.
  • Awesome Graphs for Bitbucket add-on as a tool with wide search opportunities and various analytical features.
  • Bitbucket REST API as a more advanced and technically demanding option.

Try them all and find the best solution!

You can also read how other teams benefit from using Bitbucket in a bundle with Awesome Graphs:

 

Case Study: How a FinTech Company Improves Code Review Process

June 30, 2020
#Bitbucket#Case Study
8 min

We’ve got pretty good with our Pull Request and Code Review process, but initially, our PRs were complex, not very well documented, and difficult to read. The Resolution Time Distribution graph shows how better we are getting at this, being able to merge PRs much quicker than before.

Pablo Reyes, VP Engineering at Strands

Strands is one of our customers that has been using Awesome Graphs for Bitbucket for a couple of years so far. Since 2004, Strands has been developing highly customizable digital money management software for top-tier financial institutions worldwide. Our team is happy to help them reach their goals and improve their development processes with the statistics visualizations we provide.

Pablo Reyes, VP Engineering at Strands, agreed to share how their team uses our solution and provided us with a picture of how they:

  • identified bottlenecks in code review
  • tracked if this process was improving with the changes they implemented
  • increased developers’ motivation watching the trends in individual performance.

Code review process improvement

In fact, they’ve got pretty good with their Code Review process so far. But initially, the PRs were complex, not very well documented, and difficult to read. The Resolution Time Distribution report shows how better they are getting at this, merging PRs much quicker than before. code review process improvement in Bitbucket

Since they do a lot of code reviews at Strands, it’s always nice to see who and what teams are making the best use of it. It’s encouraging for the team to see the progress with these reviews, and the Pull Requests reports give them the perfect overview of these improvements.

A couple of years ago, they started improving their methodology. For example, introduced the practice of approving PRs by at least three people. Moreover, they also encouraged developers to leave lots of comments and suggestions and not approve a PR until it’s good enough.

PRs are resolved faster now because they are done better, and the quality of suggested things improves all the time. As a result, it’s nice to see how senior developers make sure everything is done according to coding guidelines. Overview of how things are going and if it improves or not is presented in the Contributions report.

contributions report in Bitbucket

Coding trends

At Strands, managers don’t use Awesome Graphs to control the number of commits per developer, but they find it useful to look at the dynamics of the overall activity to capture the trends. For example, if there’s a significant drop, the developer is probably stuck at some difficult tasks or disturbed by various activities, helping other teams or communicating with customers.

Most things are caught soon in the day-to-day communication and work, but mid-term changes in the trend (either a decrease or increase) give them a hint of something they may need to look at. This has been visible when people change projects or teams.

The Developer’s Contributions graph gives a clear view of this kind of drops and rises, and it’s handy to compare two periods before and after certain changes were implemented.

developer contributions in Bitbucket

Any trend is a good point to discuss and find if there’re any bottlenecks or places to be improved with the processes in a team. Performance is a complex measure and depends on lots of different things, some quantitative and some qualitative, but the aggregation of code contributions (comments, pull requests, tasks solved, commits, etc) gives some good indicators on how a team is evolving with time.

Along with the others, the Contributors graph provides this kind of insight into the dynamics of code contributions by different teams.

code contributions by different teams

Try the best teams’ practices for your company

Awesome Graphs for Bitbucket has become a useful tool for Strands on their way of identifying where the problematic places are, and tracking if the implemented changes improve the situation or not. Besides, it appeared to be a handy instrument for regular monitoring.

Try Awesome Graphs for Bitbucket for free and check if it can help you as well.

Read more case studies to see how our customers benefit from using Awesome Graphs for Bitbucket in their work:

Remote Teams Management: How to Turn Data into Code Review Insights

March 17, 2020
#Analytics#How To#Bitbucket#Reporting
12 min

Leading remote and distributed teams can be quite challenging. Distance makes it more difficult to monitor your team activity. So, you have to either rely on them, hoping it won’t end up as a disaster, or annoy developers with overcontrol.

Fortunately, there’s no need to go blindly as you can go data-driven and use the statistics of developers’ activity to your advantage.

In this article, we focus on pull requests metrics as a way to identify bottlenecks in the code review process and check if it’s healthy or not. You will find the answers to the following questions:

  • What metrics to choose as a subject to analyze and how to organize them.
  • How to retrieve them using Bitbucket REST API.
  • How to interpret metrics to get as many insights as possible.

Pull Requests status dashboard

If you want to keep in touch with the pull requests on your project status, you may find it useful to create a dashboard that visualizes the statuses of pull requests. This helps you see:

  • the number of pull requests your team created for the last week/month/sprint
  • how many pull requests are already merged and which of them are still open
  • if there are any pull requests open long ago and are not merged yet.

You can retrieve this data using this Bitbucket REST API request:

https://your-bitbucket-url/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests?state=all

Get the following information from the returned results: pull request ID, state, and the date it was created and merged in the Unix time format.

{
    "size": 25,
    "limit": 25,
    "isLastPage": false,
    "values": [
        {
            "id": 13,
            "version": 13,
            "title": "Looking for Sarah Connor",
            "description": "Trying to save the Future",
            "state": "MERGED",
            "open": false,
            "closed": true,
            "createdDate": 1583837364846,
            "updatedDate": 1583843660283,
            "closedDate": 1583843660283,
            "fromRef": {},
            "toRef": {},
            "locked": false,
            "author": {
                "user": {
                    "name": "arnie",
                    "emailAddress": "arnie@stiltsoft.com",
                    "id": 3,
                    "displayName": "Arnie",
                    "active": true,
                    "slug": "arnie",
                    "type": "NORMAL",
                    "links": {},
                "role": "AUTHOR",
                "approved": false,
                "status": "UNAPPROVED"
            },
            "reviewers": [
                {
                    "user": {
                        "name": "sarahconnor",
                        "emailAddress": "sarahconnor@stiltsoft.com",
                        "id": 4,
                        "displayName": "Sarah Connor",
                        "active": true,
                        "slug": "sarahconnor",
                        "type": "NORMAL",
                        "links": {},
                    "lastReviewedCommit": "",
                    "role": "REVIEWER",
                    "approved": true,
                    "status": "APPROVED"
                }
            ],
            "participants": [],
            "properties": {
                "resolvedTaskCount": 3,
                "commentCount": 1,
                "openTaskCount": 0
            },
            "links": {}
                ]
            }
        },

Then create a script that parses these data and turns it into a pull requests status dashboard. 

There are some possible difficulties you may face due to the REST API restrictions:

  • The number of returned results is limited, so you’ll have to make several requests to retrieve all data.
  • It’s only possible to run the query on a repository level, so the more repositories you have, the more requests you’ll need to make.
  • The Bitbucket performance may be affected in large instances.

The same can be done using the Pie Chart report in Awesome Graphs for Bitbucket. Grouped by state, it shows the number of pull requests created during the chosen time span with their current statuses. 

Tip: find pull requests created long ago and not merged yet by selecting a previous week or month as a period to analyze.

Reviewers’ involvement

Another pattern to watch is whether all team members participate in the code review. If not, there are some possible consequences:

  • knowledge sharing in a team is poor, and junior developers miss the opportunity to grow their skills without watching the examples of more experienced programmers’ work
  • pull requests resolution may be slow if there are more pull requests created than people who can review it
  • those who review all pull requests may have no time to write new code.

The same REST API request from the previous paragraph retrieves the data about the participants of pull requests. Organize these data as a list of reviewers and the number of pull requests they reviewed to get insights about the developers’ involvement in the peer review. 

The Pie Chart report grouped by reviewer serves the same purposes and gives you a breakdown of pull requests reviewed by all members of your team.

Tip: pay attention to pull requests that are merged without reviewing. Those are the areas where you may have a risk as the code was not checked as appropriate. 

Reviewers’ activity chart

The difference between just being assigned as a reviewer and truly reviewing the new code and suggesting improvements to it is huge. Luckily, there are a couple of metrics to watch that may help you get a clear view of the thoroughness with which developers check each other’s work.

Use this REST API request and retrieve the data about the number of tasks, comments, needs work, or approved actions per pull request and group it by user:

https://your-bitbucket-url/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities

The example of the returned results with the data that needs to be parsed:

{
    "size": 5,
    "limit": 25,
    "isLastPage": true,
    "values": [
        {
            "id": 46766,
            "createdDate": 1574762295000,
            "user": {
                "name": "sarahconnor",
                "emailAddress": "sarahconnor@stiltsoft.com",
                "id": 3,
                "displayName": "Sarah Connor",
                "active": true,
                "slug": "sarahconnor",
                "type": "NORMAL",
                "links": {}
            },
            "action": "MERGED",
            "commit": {}
        },
        {
            "id": 46756,
            "createdDate": 1574690608000,
            "user": {
                "name": "johnconnor",
                "emailAddress": "johnconnor@stiltsoft.com",
                "id": 652,
                "displayName": "John Connor",
                "active": true,
                "slug": "johnconnor",
                "type": "NORMAL",
                "links": {}
            },
            "action": "APPROVED"
        },
        {
            "id": 46688,
            "createdDate": 1574431693000,
            "user": {
                "name": "arnie",
                "emailAddress": "arnie@stiltsoft.com",
                "id": 4,
                "displayName": "Arnie",
                "active": true,
                "slug": "arnie",
                "type": "NORMAL",
                "links": {}
            },
            "action": "COMMENTED",
            "commentAction": "ADDED",
            "comment": {
                "properties": {},
                "id": 6569,
                "version": 0,
                "text": "i need your jacket, boots, and motorcycle",
                "author": {}
                },
        {
            "id": 46668,
            "createdDate": 1574418254000,
            "user": {
                "name": "sarahconnor",
                "emailAddress": "sarahconnor@stiltsoft.com",
                "id": 3,
                "displayName": "Sarah Connor",
                "active": true,
                "slug": "sarahconnor",
                "type": "NORMAL",
                "links": {}
            },
            "action": "OPENED"
        }
    ],
    "start": 0
}

The visualization of the developers’ activity in pull requests provides you with the following insights:

  • Most active reviewers in your team. These people check the code thoroughly. On the other hand, this pattern may have negative sides if the perfectionism slows down the feature delivery too much.
  • Infrequent participants in the code review. These developers are not involved in the knowledge sharing process for some reason. Do they skip this part of work intentionally, or are they afraid to criticize their colleagues’ work? 
  • Periods with unusual activity. Check the values that go beyond the trend to find the answer to why the reviewer had to leave too many or too little comments. For example, there can be bad code or the pull request was too large, and nobody wanted to check it. These are the patterns that you’d definitely like to avoid.

The Contributions report provides the same view across projects and repositories with the swift access to each pull request in Bitbucket so you could check its content.

Tip: group this report by author to see who receives the largest number of tasks and comments in their pull requests. This may be a sign of a code that took lots of re-writing and may lead to bugs in the future. Besides, looking at the dynamics of these numbers makes it obvious if developers are improving their working patterns or not.

Try the data-driven approach to bring transparency into your code review processes

Tracking developers’ activity may be especially important in remote or distributed teams where it’s impossible to reach each other physically. 

However, the benefits that metrics bring are valuable for any company as they help:

  • find areas to improve in code review processes
  • optimize peer review practices
  • avoid slowdowns and poor quality code. 

Create your dashboard using the Bitbucket REST API or try Awesome Graphs for Bitbucket for free to discover how you can benefit from it!