Skip to content

Add the github_project_v2 table - #548

Open
dark-panda wants to merge 2 commits into
turbot:mainfrom
dark-panda:add-project-v2-table
Open

Add the github_project_v2 table#548
dark-panda wants to merge 2 commits into
turbot:mainfrom
dark-panda:add-project-v2-table

Conversation

@dark-panda

Copy link
Copy Markdown

This PR adds a table called github_project_v2 that contains some of the fields exposed by the GraphQL API for ProjectV2 and adds a few fields to github_issue to allow you to join the two tables together. We're using the github_project_v2 name here rather than github_project because of existing fields in tables like github_team and github_organization that reference projects_v2_total_count and such.

Example queries:

=> select * from github_project_v2 where organization = 'turbot' ;
-[ RECORD 1 ]------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------
login_id                 | MDQ6VXNlcjg0Nzgz
organization             | turbot
number                   | 14
id                       | 10217986
node_id                  | PVT_kwDOAlEJmM4Am-oC
owner                    | {"type": "Organization", "user": {"id": 38865304, "login": "turbot"}, "organization": {"id": 38865304, "login": "turbot"}}
creator                  | {"url": "https://github.com/apps/github-project-automation", "login": "github-project-automation", "avatar_url": "https://avatars.githubusercontent.com/in/235829?v=4"}
title                    | Issue Management
description              |
is_public                | t
closed_at                | 2026-06-08 13:57:12+00
created_at               | 2024-08-29 03:57:44+00
updated_at               | 2026-06-08 13:57:12+00
state                    | closed
latest_status_update     | [NULL]
is_template              | f
readme                   | Tracking all examples required by end users
resource_path            | /orgs/turbot/projects/14
url                      | https://github.com/orgs/turbot/projects/14
repositories             | ["turbot/guardrails-samples"]
repositories_total_count | 1
teams                    | ["", ""]
teams_total_count        | 2
sp_connection_name       | github
sp_ctx                   | {"steampipe": {"sdk_version": "5.14.0"}, "connection_name": "github"}
_ctx                     | {"steampipe": {"sdk_version": "5.14.0"}, "connection_name": "github"}

=> select
  i.id,
  i.title,
  p.title as project_title,
  p.state as project_state,
  p.id as project_id
from
  github_issue i,
  jsonb_array_elements_text(i.project_items) as project_node_id
  join github_project_v2 p on p.node_id = project_node_id
where
  i.repository_full_name = 'turbot/guardrails-samples'
  and p.organization = 'turbot';
     id     |                           title                            |  project_title   | project_state | project_id
------------+------------------------------------------------------------+------------------+---------------+------------
  815566711 | SecHub - Feature - SecHub needs a heartbeat                | Issue Management | closed        |   10217986
  841771067 | GraphQL - Get the details of a policy such as descriptions | Issue Management | closed        |   10217986
  966425300 | Calculated Policy - Log Group Deletions                    | Issue Management | closed        |   10217986
 1016873038 | TrimBot - Fix the version for dependent libraries          | Issue Management | closed        |   10217986
  966422959 | TrimBot - Error handling should be more verbose            | Issue Management | closed        |   10217986
  966420924 | TrimBot - SNS topics not all removed                       | Issue Management | closed        |   10217986
(6 rows)

@cbruno10 cbruno10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dark-panda Thanks for raising this PR! I've added a few suggestions and questions in this PR. A few other minor points:

  • Can you please add a table doc page for docs/tables/github_project_v2.md?
  • Can you please also update the PR description, which have different (possibly older) columns? I think it'd be helpful to see the results of the example queries from the upcoming table doc.
  • Locally, models/project_v2.go and table_github_project_v2.go both fail gofmt -l, can you please check these files?

If you have any questions, please let us know!

Comment thread github/table_github_project_v2.go
Comment thread github/table_github_project_v2.go
Comment thread github/table_github_project_v2.go
Comment thread github/table_github_issue.go Outdated
@dark-panda
dark-panda force-pushed the add-project-v2-table branch from 6751d97 to 7c1c288 Compare August 11, 2026 17:20
@dark-panda
dark-panda force-pushed the add-project-v2-table branch 3 times, most recently from 5a78b19 to 835f9de Compare August 20, 2026 17:27
@dark-panda
dark-panda force-pushed the add-project-v2-table branch from 835f9de to 7eeb984 Compare August 20, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants