steampipe plugin install github

Table: github_search_pull_request - Query GitHub Pull Requests using SQL

GitHub Pull Requests is a feature within GitHub that allows developers to propose changes to a repository. It provides a platform for code review and discussion about the proposed changes before they are merged into the codebase. GitHub Pull Requests helps in maintaining the integrity and quality of the code in a repository by ensuring that all changes are reviewed and approved before they are incorporated.

Table Usage Guide

The github_search_pull_request table provides insights into pull requests within GitHub. As a developer or project manager, explore pull request-specific details through this table, including status, creator, assignee, and associated metadata. Utilize it to monitor the progress of proposed changes, manage code reviews, and ensure the quality of the code in your repositories.

Important Notes

  • You must always include at least one search term when searching pull requests in the where or join clause using the query column. You can narrow the results using these search qualifiers in any combination. See Searching issues and pull requests for details on the GitHub query syntax.

Examples

List pull requests by the title, body, or comments

Explore which GitHub pull requests match certain criteria within the title, body, or comments. This can be useful for identifying relevant discussions or changes related to specific topics or keywords.

select
title,
id,
state,
created_at,
repository_full_name,
url
from
github_search_pull_request
where
query = 'github_search_issue in:title in:body in:comments';
select
title,
id,
state,
created_at,
repository_full_name,
url
from
github_search_pull_request
where
query = 'github_search_issue in:title in:body in:comments';

List pull requests in open state assigned to a specific user

Determine the areas in which a specific user has been assigned open pull requests for a particular repository. This is useful for project managers to track individual contributions and progress in a collaborative environment.

select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'is:open assignee:c0d3r-arnab repo:turbot/steampipe-plugin-github';
select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'is:open assignee:c0d3r-arnab repo:turbot/steampipe-plugin-github';

List pull requests with public visibility assigned to a specific user

Determine the areas in which a specific user has been assigned public visibility pull requests in a particular GitHub repository. This can be useful to track a user's involvement and contribution to publicly visible projects.

select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'is:public assignee:c0d3r-arnab repo:turbot/steampipe-plugin-github';
select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'is:public assignee:c0d3r-arnab repo:turbot/steampipe-plugin-github';

List pull requests not linked to an issue

Identify instances where open pull requests are not linked to an issue within the 'turbot/steampipe-plugin-github' repository. This can help to uncover potential oversights in issue tracking and ensure all code changes are properly documented.

select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'is:open -linked:issue repo:turbot/steampipe-plugin-github';
select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'is:open -linked:issue repo:turbot/steampipe-plugin-github';

List pull requests with over 50 comments

Determine the areas in which pull requests have sparked significant discussion, by identifying those with over 50 comments. This can provide insights into contentious or complex issues within your organization's GitHub repositories.

select
title,
id,
total_comments_count,
state,
created_at,
url
from
github_search_pull_request
where
query = 'org:turbot comments:>50';
select
title,
id,
total_comments_count,
state,
created_at,
url
from
github_search_pull_request
where
query = 'org:turbot comments:>50';

List open draft pull requests

Explore the open draft pull requests in your GitHub organization. This could be used to identify unfinished work and help prioritize tasks for your development team.

select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'org:turbot draft:true state:open';
select
title,
id,
state,
created_at,
url
from
github_search_pull_request
where
query = 'org:turbot draft:true state:open';

List pull requests that took more than 30 days to close

Determine the areas in which pull requests have taken more than a month to close. This can help in identifying bottlenecks in the code review process and provide insights for improving efficiency.

select
title,
id,
state,
created_at,
closed_at,
url
from
github_search_pull_request
where
query = 'org:turbot state:closed'
and closed_at > (created_at + interval '30' day);
select
title,
id,
state,
created_at,
closed_at,
url
from
github_search_pull_request
where
query = 'org:turbot state:closed'
and closed_at > datetime(created_at, '+30 days');

Schema for github_search_pull_request

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
active_lock_reasontextReason that the conversation was locked.
additionsbigintThe number of additions in this pull request.
assigneesjsonbA list of Users assigned to the pull request.
authorjsonbThe author of the pull request.
author_associationtextAuthor's association with the pull request.
base_ref_nametextIdentifies the name of the base Ref associated with the pull request, even if the ref has been deleted.
bodytextThe body as Markdown.
changed_filesbigintThe number of files changed in this pull request.
checks_urltextURL for the checks of this pull request.
closedbooleanIf true, pull request is closed.
closed_attimestamp with time zoneTimestamp when the pull request was closed.
created_attimestamp with time zoneTimestamp when the pull request was created.
created_via_emailbooleanIf true, pull request comment was created via email.
deletionsbigintThe number of deletions in this pull request.
editorjsonbThe actor who edited the pull request's body.
head_ref_nametextIdentifies the name of the head Ref associated with the pull request, even if the ref has been deleted.
head_ref_oidtextIdentifies the oid/sha of the head ref associated with the pull request, even if the ref has been deleted.
idbigintThe ID of the pull request.
includes_created_editbooleanIf true, this pull request was edited and includes an edit with the creation data.
is_cross_repositorybooleanIf true, head and base repositories are different.
is_draftbooleanIf true, the pull request is a draft.
is_read_by_userbooleanIf true, this pull request was read by the current user.
last_edited_attimestamp with time zoneTimestamp the editor made the last edit.
lockedbooleanIf true, the pull request is locked.
maintainer_can_modifybooleanIf true, maintainers can modify the pull request.
mergeabletextWhether or not the pull request can be merged based on the existence of merge conflicts.
mergedbooleanIf true, the pull request was merged.
merged_attimestamp with time zoneTimestamp when pull request was merged.
merged_byjsonbThe actor who merged the pull request.
milestonejsonbThe milestone associated with the pull request.
node_idtextThe node ID of the pull request.
numberbigintThe number of the pull request.
permalinktextPermanent URL for the pull request.
published_attimestamp with time zoneTimestamp the pull request was published.
querytext=The query provided for the search.
repository_full_nametextThe full name of the repository the pull request belongs to.
revert_urltextURL to revert the pull request.
review_decisiontextThe current status of this pull request with respect to code review.
statetextThe current state of the pull request.
text_matchesjsonbThe text match details.
titletextThe title of the pull request.
total_comments_countbigintThe number of comments on the pull request.
updated_attimestamp with time zoneTimestamp when the pull request was last updated.
urltextURL of the pull request.

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_search_pull_request