Announcing New Stiltsoft Partner Program

March 22, 2021
#News
2 min

At Stiltsoft, we recognize how important both our partners and customers are, so we decided to launch our new Partner Program that will affect only the Awesome Graphs for Bitbucket app.

We are building a new Partner Program to provide you with comprehensive training materials and resources, free app licenses, promo codes, and more. If you apply, you save time and effort of your sales team with the help of our training course and demos on demand.

We want to inform you that Awesome Graphs for Bitbucket has Standard Atlassian Partner Discount until March 21st, 2021. From March 22nd, a 20% discount will only be available for Stiltsoft Partners.

Other Stiltsoft apps participate in the Standard Discount scheme for Atlassian Marketplace Products.

To get a 20% discount, you will need to become our partner. Moreover, you will get other partnership perks:

  • Free licenses
  • Demo on demand
  • Promo codes
  • Enablement materials
  • App training
  • Co-marketing activities

To join, simply drop an email at partner@stiltsoft.com, and we will get you set up as soon as possible. For more details, please visit our website.

We look forward to continued collaboration!

Related posts

    How to Get the Number of Commits and Lines of Code in Pull Requests

    February 4, 2021
    #How To#Bitbucket#Reporting
    9 min

    According to the research conducted by the Cisco Systems programming team, where they tried to determine the best practices for code review, they found out that the pull request size should not include more than 200 to 400 lines of code. Keeping the size of your pull requests within these limits not only will speed up the review but also this amount of information is optimal for the brain to process effectively at a time.

    In case you’d like to analyze your current database, counting lines of code manually for each pull request could take years, so we suggest automating this process with the help of Awesome Graphs for Bitbucket and Python. This article will show you how you can build a report with pull request size statistics in terms of lines of code and commits on the repository level.

    What you will get

    As a result, you’ll get a CSV file containing a detailed list of pull requests created during the specified period with the number of commits, lines of code added and deleted in them.

    How to get it

    To get the report described above, we’ll run the following script that will make requests into the REST API, and do all the calculations and aggregation for us.

    import requests
    import csv
    import sys
    
    bitbucket_url = sys.argv[1]
    login = sys.argv[2]
    password = sys.argv[3]
    project = sys.argv[4]
    repository = sys.argv[5]
    since = sys.argv[6]
    until = sys.argv[7]
    
    get_prs_url = bitbucket_url + '/rest/awesome-graphs-api/latest/projects/' + project + '/repos/' + repository \
                + '/pull-requests'
    
    s = requests.Session()
    s.auth = (login, password)
    
    
    class PullRequest:
    
        def __init__(self, title, pr_id, author, created, closed):
            self.title = title
            self.pr_id = pr_id
            self.author = author
            self.created = created
            self.closed = closed
    
    
    class PullRequestWithCommits:
    
        def __init__(self, title, pr_id, author, created, closed, commits, loc_added, loc_deleted):
            self.title = title
            self.pr_id = pr_id
            self.author = author
            self.created = created
            self.closed = closed
            self.commits = commits
            self.loc_added = loc_added
            self.loc_deleted = loc_deleted
    
    
    def get_pull_requests():
    
        pull_request_list = []
    
        is_last_page = False
    
        while not is_last_page:
    
            response = s.get(get_prs_url, params={'start': len(pull_request_list), 'limit': 1000,
                                          'sinceDate': since, 'untilDate': until}).json()
    
            for pr_details in response['values']:
    
                title = pr_details['title']
                pd_id = pr_details['id']
                author = pr_details['author']['user']['emailAddress']
                created = pr_details['createdDate']
                closed = pr_details['closedDate']
    
                pull_request_list.append(PullRequest(title, pd_id, author, created, closed))
    
            is_last_page = response['isLastPage']
    
        return pull_request_list
    
    
    def get_commit_statistics(pull_request_list):
    
        pr_list_with_commits = []
    
        for pull_request in pull_request_list:
    
            print('Processing Pull Request', pull_request.pr_id)
    
            commit_ids = []
    
            is_last_page = False
    
            while not is_last_page:
    
                url = bitbucket_url + '/rest/api/latest/projects/' + project + '/repos/' + repository \
                    + '/pull-requests/' + str(pull_request.pr_id) + '/commits'
                response = s.get(url, params={'start': len(commit_ids), 'limit': 25}).json()
    
                for commit in response['values']:
                    commit_ids.append(commit['id'])
    
                is_last_page = response['isLastPage']
    
            commits = 0
            loc_added = 0
            loc_deleted = 0
    
            for commit_id in commit_ids:
    
                commits += 1
    
                url = bitbucket_url + '/rest/awesome-graphs-api/latest/projects/' + project + '/repos/' + repository \
                    + '/commits/' + commit_id
                response = s.get(url).json()
    
                if 'errors' not in response:
                    loc_added += response['linesOfCode']['added']
                    loc_deleted += response['linesOfCode']['deleted']
                else:
                    pass
    
            pr_list_with_commits.append(PullRequestWithCommits(pull_request.title, pull_request.pr_id, pull_request.author,
                                                               pull_request.created, pull_request.closed, commits,
                                                               loc_added, loc_deleted))
    
        return pr_list_with_commits
    
    
    with open('{}_{}_pr_size_stats_{}_{}.csv'.format(project, repository, since, until), mode='a', newline='') as report_file:
    
        report_writer = csv.writer(report_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
        report_writer.writerow(['title', 'id', 'author', 'created', 'closed', 'commits', 'loc_added', 'loc_deleted'])
    
        for pr in get_commit_statistics(get_pull_requests()):
            report_writer.writerow([pr.title, pr.pr_id, pr.author, pr.created, pr.closed, pr.commits, pr.loc_added, pr.loc_deleted])
    
    print('The resulting CSV file is saved to the current folder.')
    
    

    To make this script work, you’ll need to install the requests module in advance, the csv and sys modules are available in Python out of the box. Then you need to pass seven arguments to the script when executed: the URL of your Bitbucket, login, password, project key, repository name, since date, until date. Here’s an example:

    py script.py https://bitbucket.your-company-name.com login password PRKEY repo-name 2020-11-31 2021-02-01

    As you’ll see at the end of the execution, the resulting file will be saved to the same folder next to the script.

    Want more?

    The Awesome Graphs for Bitbucket app and its REST API, in particular, allow you to get much more than described here, and we want to help you to get the most of it. If you have an idea in mind or a problem that you’d like us to solve, write here in the comments or create a request in our Help Center, and we’ll cover it in future posts! In fact, the idea for this very article was brought to us by our customers, so there is a high chance that your case will be the next one. 

    Here are a few how-tos that you can read right now:

    Case Study: How a FinTech Company Improves Code Review Process

    June 30, 2020
    #Bitbucket#Case Study
    7 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 of Engineering at Strands, shared best practices on how their team effectively uses our solution to:

    • identify bottlenecks in code review
    • track the process improvement with the implemented changes
    • increase developers’ motivation by keeping an eye on their performance trends.

    Code review process improvement

    In fact, they’ve got pretty good with their Code Review process so far. But initially, the PRs were complex, poorly 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 motivating for the team to see the progress, and the Pull Requests reports give them the perfect overview of these advancements.

    A couple of years ago, they started improving their code review process. For example, they introduced the practice of approving PRs by at least three people. Moreover, they encouraged developers to leave many comments and suggestions and only approve a PR once it’s good enough.

    As a result, PRs are resolved faster, not only because they are done better but also because the quality of suggested improvements rises constantly. The Contributions report gives an overview of code review activity and whether it improves or not.

    contributions report in Bitbucket

    Software development tracking

    At Strands, managers don’t use Awesome Graphs to control the number of commits per developer. Still, they find it useful to look at the dynamics of the overall activity to capture the code development trends. For example, if there’s a significant drop, the developer is probably stuck at 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 emerging trend serves as a valuable point for discussion, enabling the team to identify potential bottlenecks or areas that can be enhanced within their software development process. Developers’ performance is complex and depends on lots of different things, some quantitative and some qualitative. Still, the aggregation of code contributions (comments, pull requests, tasks solved, commits, etc) gives some good indicators of how a team evolves with time.

    Along with the others, the Contributors graph provides insights into the dynamics of code contributions by different teams and helps with software development tracking.

    software development tracking

    Try the best teams’ practices for your company

    Awesome Graphs for Bitbucket has become a helpful tool for Strands to identify problem areas  in their processes and track whether the implemented changes improve them. Besides, it is a handy instrument for regular monitoring of software development.

    Try Awesome Graphs for Bitbucket for free and discover how it can benefit your workflow.

    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
    #Reporting#Analytics#How To#Bitbucket
    12 min

    Remote teams management can be quite challenging. Distance makes it more difficult to monitor your distributed 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. 

    Pull request metrics - check status of pull requests

    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.

    Analyze how your team is involved in the code review process

    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.

    Apply a data-driven approach in remote teams management

    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 software development 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!

    5 New Apps to Supercharge Your Bitbucket – Third Quarter 2019

    December 24, 2019
    #Bitbucket
    9 min

    Last week, we shared our favorite Jira apps released in the third quarter of this year. This week, we are back with a new list of the most useful apps for Bitbucket released between April and June 2019. We’ve picked solutions that will help you enhance your Bitbucket experience.

    The great news is that four Bitbucket apps from our list are free to use. So let’s take a closer look at them and their capabilities.

    Review submodule changes with ease

    This app may help those who are using the workflow of Git submodules. Users can view modifications to the submodules in the Diff tab as two commit hashes. They do not see the changes made to the submodule. Submodule Changes for Bitbucket is an app that helps collaborators effortlessly find modified files and perform PR review leaving comments and suggestions in pull requests.

    Now you can watch the Blame view and see the changes committed to a submodule in the Diff tab as if they’re committed to the parental repository.

    Try this app to simplify your workflow and reduce mistakes because it allows you to rapidly check Git submodule updates.

    Pricing: The Submodule Changes for Bitbucket app is free to use.

    Assign reviewer groups automatically

    Assign Reviewer Groups allows teams to evenly distribute the workload among project members. You can automatically set up groups of reviewers to make sure that some developers don’t become swamped with reviews.

    This app allows you to randomize users on each pull request using hot commands. You can also use this solution when only one member of the reviewers’ group needs to approve the PR, but the PR creator does not need to know who exactly will do the review.

    With this add-on, you do not need to decide who to include each time for your PR review. Moreover, you can choose how many reviewers to add from each group.

    Pricing: Assign Reviewer Groups is a free app.

    Live code collaboration in IDE

    TeamHub is an app for Bitbucket Cloud that takes your collaboration on code to the next level helping all contributors to work in real-time without merge conflicts. You can quickly get a live view of what your colleagues are working on.

    What’s great about this app is that you can rapidly check who is online and what they are working on at the moment, which means that you will get access to working copies for the repositories that you only have access to. You will get a notification in case you make a conflicting change.

    This app allows you to take advantage of collaborative editing making your cursor visible in the editor of your teammates.

    Pricing: The TeamHub app is free to use.

    Detailed license view

    Centralized license visibility is a simple and straightforward tool that lets you monitor the actual license usage across all of your Atlassian products. This app requires the installation of Crowd 3.5 Data Center because you will need to connect your Atlassian Server or Data Center products with Crowd to get license usage data.

    Now you can evaluate the actual license needs for your company because this solution helps you find inactive users or users who rarely log in to your Atlassian products.

    This is a useful solution for Atlassian administrators because it helps them get a bird’s-eye view of license usage in their Atlassian environment. The information they get allows them to easily export and analyze their license data.

    Pricing: Centralized license visibility is a free app.

    Bitbucket security enhancement

    BitLeaks — Secrets Leak Security prevents secret information leaks (API and Cryptographic keys leaks) into source code repositories. This app detects attempts to push multiple cryptographic keys & secret tokens and by default rejects any commits that contain sensitive information.

    Use this app to avoid data/information leaks via Git repositories. This solution can be of great support both to newbies and experienced developers.

    Pricing: The pricing of BitLeaks — Secrets Leak Security starts from $79 for 25 users and ends at $3,499 for 2,000 users.

    Boost your Bitbucket experience

    This was our list of fresh Bitbucket apps released in the last couple of months. Give them a try and share your feedback with us! Tell us more about the apps you like. Feel free to comment below.

    Did you miss one of our previous editions? If yes, check out our selection of Bitbucket apps released in the second quarter.

    Don’t forget to subscribe to email notifications about new posts in our blog – enter your email in the Newsletter section on the sidebar.

    Related posts

      Introducing New Feature: Graphs for Teams in Awesome Graphs

      December 3, 2019
      #Reporting#Analytics#News#Bitbucket
      7 min

      There is no doubt that effective working and communication processes in a team greatly influence the overall success of a product or company. Atlassian products like Bitbucket, Jira, and Confluence aim to improve collaboration and bring distributed colleagues together.

      Awesome Graphs for Bitbucket app is our contribution to the teamwork of more than 2,000 companies, as its primary goal is to help identify the bottlenecks in the development workflow and increase the speed. We are eager to make the processes transparent for both developers and managers and, thereby, improve the communication and narrow the gap between them.

      We’ve discovered that lots of our clients use similar workflows: they have multiple teams working on the same project or repository. Therefore, tracking the productivity of a particular group that a project or delivery manager, or team lead manages can be tricky as the app showed graphs for all the activity across a project or repository that included the statistics about all the teams together. That’s why we decided to implement a feature that can make their lives easier: graphs for teams.

      View the statistics for your team

      Teams feature is designed to visualize the statistics about your team performance if there’s a lot of people working on a project or repository. It excludes the contributions of the members of other teams and helps get rid of noisy data.

      Configure your teams in the settings and choose it in the All contributors drop-down menu on the Graphs page and analyze how much commits, pull requests, and lines of code a team produces apart from others.

      Compare the activity of different teams

      If you manage multiple teams working on the same project or repository, you may find it useful to separate their statistics from each other.  For example, compare their impact in a codebase of your repository using the Code Frequency graph. That’s what you can easily do with our new feature!

      Let’s say you manage two teams: back-end and front-end developers. Open a graph for each team in different tabs and compare their performance.

      From the screenshot below, you may identify that your back-end team is continuously deleting the lines of code. They are probably involved in some bug fixing or refactoring activities or implement changes in the API.

      Meanwhile, the front-end team has to rewrite some pieces of code to adjust the changes in the backend.

      Exclude automated users from the statistics

      If you use automation in your repositories, the graphs may show the information that is not related to the activity of your team. Lots of commits and lines of code added by CI/CD users and automated scripts may complicate the performance analysis since it’s not obvious which contributions are made by real people and which of them are not.

      Use teams feature to solve this problem by creating a team with all the people you need except for the automated users.

      Teams management

      A team can be made on the global, project, and repository level by the user with administrative permissions on this level. A team can include whole Bitbucket groups or individual users.

      It’s possible to create a global team in the Teams tab in the Administration page and view graphs for it in all projects and repositories.

      There’s no need to disturb your Sys Admins from their work to create a team. If you’re a project or repository admin, you may do it in the Teams tab in the settings. In this case, your teams’ graphs will be available only in your repository or project and higher.

      Improve your teams’ activity tracking

      At the moment, graphs for teams are available only for the Graphs page, but we’ll add this feature to the People page and Reports soon in the next releases.

      Try a new version of Awesome Graphs for Bitbucket to get even more useful insights on your team productivity and compare the activities of different teams!

      We are delighted to implement the team feature that our customers were asking for, and we hope to make their working process a bit easier and better! So, we appreciate any feedback on the app and suggestions that could help you get the most benefit from Awesome Graphs. If you have any, please, feel free to write to us here as we’re looking forward to learning about your needs!

      Related posts