Table: github_pull_request_review - Query GitHub Pull Request Reviews using SQL
A GitHub Pull Request Review is a feature within GitHub that allows users to provide feedback on pull requests. It provides a collaborative platform for code review where users can comment, approve or request changes on the proposed code changes. GitHub Pull Request Reviews help to ensure code quality and maintainability by facilitating peer review before code merging.
Table Usage Guide
The github_pull_request_review
table provides insights into the review process of pull requests within GitHub. As a developer or a team lead, explore review-specific details through this table, including the review comments, review status, and the reviewer details. Utilize it to understand the feedback on pull requests, the approval process, and to gain insights into the code review practices in your projects.
Important Notes
- You must specify the
repository_full_name
(repository including org/user prefix) andnumber
(of the PR) columns in thewhere
orjoin
clause to query the table.
Examples
List all reviews for a specific pull request
Explore all feedback for a specific project update. This is particularly useful for developers and project managers who want to understand the team's thoughts, concerns, and suggestions regarding a particular code change or feature addition.
select id, author_login, author_association, state, body, submitted_at, urlfrom github_pull_request_reviewwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207;
select id, author_login, author_association, state, body, submitted_at, urlfrom github_pull_request_reviewwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207;
List reviews for a specific pull request which match a certain body content
This query is useful for identifying specific feedback within the reviews of a particular pull request. It can help you to pinpoint comments that match a certain keyword, enabling you to quickly find and address relevant concerns or suggestions.
select id, number as issue, author_login as comment_author, author_association, body as content, submitted_at, urlfrom github_pull_request_reviewwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207 and body like '%minor%';
select id, number as issue, author_login as comment_author, author_association, body as content, submitted_at, urlfrom github_pull_request_reviewwhere repository_full_name = 'turbot/steampipe-plugin-github' and number = 207 and body like '%minor%';
List reviews for all open pull requests from a specific repository
Determine the areas in which feedback has been provided for all active changes proposed in a specific project. This can be useful to understand the type of improvements or modifications suggested by contributors during the development process.
select rv.*from github_pull_request r join github_pull_request_review rv on r.repository_full_name = rv.repository_full_name and r.number = rv.numberwhere r.repository_full_name = 'turbot/steampipe-plugin-github' and r.state = 'OPEN';
select rv.*from github_pull_request r join github_pull_request_review rv on r.repository_full_name = rv.repository_full_name and r.number = rv.numberwhere r.repository_full_name = 'turbot/steampipe-plugin-github' and r.state = 'OPEN';
Schema for github_pull_request_review
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
author | jsonb | The actor who authored the review. | |
author_association | text | Author's association with the subject of the pr the review was raised on. | |
author_can_push_to_repository | boolean | Indicates whether the author of this review has push access to the repository. | |
author_login | text | The login of the review author. | |
body | text | The body of the review. | |
id | bigint | The ID of the review. | |
login_id | text | =, !=, ~~, ~~*, !~~, !~~* | Unique identifier for the user login. |
node_id | text | The node ID of the review. | |
number | bigint | = | The PR number. |
repository_full_name | text | = | The full name of the repository (login/repo-name). |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | The state of the review. | |
submitted_at | timestamp with time zone | Identifies when the Pull Request Review was submitted. | |
url | text | The HTTP URL permalink for this PullRequestReview. |
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)" -- github
You can pass the configuration to the command with the --config
argument:
steampipe_export_github --config '<your_config>' github_pull_request_review