Repository navigation
Add the github_project_v2 table - #548
Conversation
There was a problem hiding this comment.
@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.goandtable_github_project_v2.goboth failgofmt -l, can you please check these files?
If you have any questions, please let us know!
7c1c288 to
f98e304
Compare
835f9de to
7eeb984
Compare
cbruno10
left a comment
There was a problem hiding this comment.
@dark-panda Thanks for the latest updates and sorry for the late response. I've left a few additional review comments, can you please have a look when you get a chance? Thanks!
7eeb984 to
594cbc5
Compare
|
@cbruno10 feedback applied, let's see how this looks now. |
|
@dark-panda - Thanks for working through the last round of feedback! I've tested the table again and added a few more suggestions in the most recent review. Can you please have a look when you get a chance? Also, can you please update the PR description? It still has the older Thanks! |
6114b59 to
96c9650
Compare
|
@cbruno10 feedback addressed, how's it looking? |
|
@dark-panda Thanks again for all the work on this new table, it's now out in v1.11.0! Along with your changes, I made a few others in the plugin as well:
To get the same results as the original join example in this PR, you can list the org's projects and then get the items in each one: with projects as materialized (
select
number,
title,
state,
id
from
github_project_v2
where
organization = 'turbot'
)
select
i.content_id as id,
i.title,
p.title as project_title,
p.state as project_state,
p.id as project_id
from
projects p
join github_project_v2_item i on i.project_number = p.number
where
i.organization = 'turbot'
and i.repository_full_name = 'turbot/guardrails-samples'
and i.type = 'ISSUE';A few notes on the query above:
However, if this doesn't cover something you were doing with the old columns, please let me know! |
This PR adds a table called
github_project_v2that contains some of the fields exposed by the GraphQL API for ProjectV2 and adds a few fields togithub_issueto allow you to join the two tables together. We're using thegithub_project_v2name here rather thangithub_projectbecause of existing fields in tables likegithub_teamandgithub_organizationthat referenceprojects_v2_total_countand such.Example queries: