Table: bitbucket_my_repository - Query Bitbucket Repositories using SQL
Bitbucket is a web-based version control repository hosting service owned by Atlassian, for source code and development projects that use either Mercurial or Git revision control systems. Bitbucket offers both commercial plans and free accounts. It provides a way for developers to manage and maintain their code, with features such as pull requests, branching, and in-line commenting.
Table Usage Guide
The bitbucket_my_repository
table provides insights into repositories within Bitbucket. As a developer or project manager, explore repository-specific details through this table, including repository name, project key, size, and other metadata. Utilize it to uncover information about repositories, such as those with the most recent commits, the size of each repository, and the associated project key.
Important Notes
- To query ANY repository, including public repositories, use the
bitbucket_repository
table.
Examples
List of repositories that you or your workspace owns
Explore the repositories that you or your workspace own, to manage and organize your projects better. This allows you to assess the ownership of different repositories, enhancing your control and coordination over them.
select name, uuid, full_name, owner_display_namefrom bitbucket_my_repositoryorder by full_name;
select name, uuid, full_name, owner_display_namefrom bitbucket_my_repositoryorder by full_name;
List your public repositories
Explore which of your Bitbucket repositories are publicly accessible. This can be useful to ensure sensitive information is not inadvertently exposed.
select name, is_private, full_name, owner_display_namefrom bitbucket_my_repositorywhere not is_private;
select name, is_private, full_name, owner_display_namefrom bitbucket_my_repositorywhere not is_private;
List the unassigned open issues in your repositories
Discover the segments that have unresolved issues in your repositories that are yet to be assigned. This is useful for identifying potential bottlenecks in your workflow, allowing you to take remedial action and improve efficiency.
select i.repository_full_name, i.id, i.title, i.state, i.assignee_display_name, i.assignee_uuidfrom bitbucket_issue as i, bitbucket_my_repository as rwhere repository_full_name = r.full_name and i.assignee_uuid is null and i.state = 'new';
Error: The corresponding SQLite query is unavailable.
List details of the default reviewers of your repositories
Gain insights into who are set as default reviewers for your repositories, helpful in understanding the review process and ensuring the right people are involved in code reviews.
with default_reviewers as ( select full_name as repository_name, r ->> 'AccountId' as reviewer_account_id, r ->> 'Uuid' as reviewer_uuid, r ->> 'DisplayName' as reviewer_display_name, r ->> 'Type' as reviewer_type from bitbucket_my_repository, jsonb_array_elements(default_reviewers) as r)select repository_name, reviewer_account_id, reviewer_uuid, reviewer_display_name, reviewer_typefrom default_reviewers;
with default_reviewers as ( select full_name as repository_name, json_extract(r.value, '$.AccountId') as reviewer_account_id, json_extract(r.value, '$.Uuid') as reviewer_uuid, json_extract(r.value, '$.DisplayName') as reviewer_display_name, json_extract(r.value, '$.Type') as reviewer_type from bitbucket_my_repository, json_each(default_reviewers) as r)select repository_name, reviewer_account_id, reviewer_uuid, reviewer_display_name, reviewer_typefrom default_reviewers;
List the repositories without default reviewers
Discover the segments that have repositories without designated default reviewers. This is useful for identifying potential areas of oversight, ensuring that all repositories have appropriate review processes in place.
select name, uuid, full_name, owner_display_namefrom bitbucket_my_repositorywhere default_reviewers is null;
select name, uuid, full_name, owner_display_namefrom bitbucket_my_repositorywhere default_reviewers is null;
Schema for bitbucket_my_repository
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
default_reviewers | jsonb | Details of the default reviewers of the repository. | |
description | text | Description of the repository. | |
fork_policy | text | Controls the rules for forking this repository. "allow_forks": unrestricted forking, "no_public_forks": restrict forking to private forks (forks cannot be made public later) and "no_forks": deny all forking | |
full_name | text | The concatenation of the repository owner's username and the slugified name, e.g. "turbot/steampipe-plugin-bitbucket". This is the same string used in Bitbucket URLs. | |
has_issues | text | To initialize or disable the new repo's issue tracker | |
is_private | boolean | Indicates whether the repository is publicly accessible, or whether it is private to the team and consequently only visible to team members. | |
language | text | The type of markup language the raw content is to be interpreted in. | |
mainbranch | jsonb | Details of the main branch of the repository. | |
name | text | The name of repository. | |
owner_account_id | text | Jira account id of the owner. | |
owner_display_name | text | Display name of the owner the repository. | |
owner_type | text | Type of the owner of the repository. Can be a user or team. | |
owner_uuid | text | Bitbucket UUID of the owner. | |
project_key | text | Key of the project this repository belongs to. | |
project_name | text | Name of the project this repository belongs to. | |
project_uuid | text | UUID of the project this repository belongs to. | |
self_link | text | Self link to this repository. | |
slug | text | A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
title | text | Title of the resource. | |
uuid | text | The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- bitbucket
You can pass the configuration to the command with the --config
argument:
steampipe_export_bitbucket --config '<your_config>' bitbucket_my_repository