Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table github_blob #430

Merged
merged 3 commits into from May 17, 2024
Merged

Add table github_blob #430

merged 3 commits into from May 17, 2024

Conversation

rmhartog
Copy link
Contributor

Add the table github_blob

Allows the github blobs to be joined to a github tree to access a specific file's contents, for example to check for configuration files or README's.

Example query results

select
  tree_sha,
  truncated,
  path,
  mode,
  type,
  sha,
  decode(content, encoding) as content
from
  github_tree t
left outer join
  github_blob b on b.repository_full_name = t.repository_full_name and b.blob_sha = t.sha
where
  t.repository_full_name = 'turbot/steampipe'
  and tree_sha = '0f200416c44b8b85277d973bff933efa8ef7803a'
  and path = 'Makefile';
Results
+------------------------------------------+-----------+----------+--------+------+------------------------------------------+-------------------------------------------+
| tree_sha                                 | truncated | path     | mode   | type | sha                                      | content                                   |
+------------------------------------------+-----------+----------+--------+------+------------------------------------------+-------------------------------------------+
| 0f200416c44b8b85277d973bff933efa8ef7803a | false     | Makefile | 100644 | blob | 4650745ea73b4769919e29f3882a05d1351e2212 |                                           |
|                                          |           |          |        |      |                                          | steampipe:                                |
|                                          |           |          |        |      |                                          |     go build -o  /usr/local/bin/steampipe |
|                                          |           |          |        |      |                                          |                                           |
|                                          |           |          |        |      |                                          | dashboard_assets:                         |
|                                          |           |          |        |      |                                          |     $(MAKE) -C ui/dashboard               |
|                                          |           |          |        |      |                                          |                                           |
|                                          |           |          |        |      |                                          | all:                                      |
|                                          |           |          |        |      |                                          |     $(MAKE) -C pluginmanager              |
|                                          |           |          |        |      |                                          |     $(MAKE) -C ui/dashboard               |
|                                          |           |          |        |      |                                          |     go build -o  /usr/local/bin/steampipe |
|                                          |           |          |        |      |                                          |                                           |
+------------------------------------------+-----------+----------+--------+------+------------------------------------------+-------------------------------------------+

@rmhartog
Copy link
Contributor Author

The current approach is a single call per blob, which is limited when it comes to rate limiting.

@misraved
Copy link
Contributor

Welcome to Steampipe @rmhartog and thank you so much for raising the PR for a new table 👍.

Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

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

@rmhartog please take a look at the initial review comments, Thanks!!

docs/tables/github_blob.md Outdated Show resolved Hide resolved
docs/tables/github_blob.md Outdated Show resolved Hide resolved
rmhartog and others added 2 commits April 30, 2024 10:40
Co-authored-by: Ved misra <47312748+misraved@users.noreply.github.com>
Co-authored-by: Ved misra <47312748+misraved@users.noreply.github.com>
@rmhartog rmhartog requested a review from misraved May 14, 2024 08:36
@misraved misraved merged commit 1dc44f2 into turbot:main May 17, 2024
1 check passed
@rmhartog rmhartog deleted the github_blob branch May 21, 2024 10:48
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.

None yet

2 participants