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

feat: add github_repository_content table #207

Conversation

aminvielledebatAtBedrock
Copy link
Contributor

List a repository

Query
select
  * 
from
  github_public.github_repository_content 
where
  repository_full_name = 'github/docs'
Results
repository_full_name type name requested_path path size content target sha url git_url html_url download_url _ctx
github/docs file .env.example .env.example 27 983c975bb3680a2da59ccfd34b53c5c96bba4520 https://api.github.com/repos/github/docs/contents/.env.example?ref=main https://api.github.com/repos/github/docs/git/blobs/983c975bb3680a2da59ccfd34b53c5c96bba4520 https://github.com/github/docs/blob/main/.env.example https://raw.githubusercontent.com/github/docs/main/.env.example {"connection_name":"github_public"}
github/docs dir .vscode .vscode 0 1242eaf1a1d4b73a04fa39170e718cc4715ec4a0 https://api.github.com/repos/github/docs/contents/.vscode?ref=main https://api.github.com/repos/github/docs/git/trees/1242eaf1a1d4b73a04fa39170e718cc4715ec4a0 https://github.com/github/docs/tree/main/.vscode {"connection_name":"github_public"}
github/docs file azure-preview-env-template.json azure-preview-env-template.json 2800 f63f318358de73ed720aeb1b17c3827bbf99ab1a https://api.github.com/repos/github/docs/contents/azure-preview-env-template.json?ref=main https://api.github.com/repos/github/docs/git/blobs/f63f318358de73ed720aeb1b17c3827bbf99ab1a https://github.com/github/docs/blob/main/azure-preview-env-template.json https://raw.githubusercontent.com/github/docs/main/azure-preview-env-template.json {"connection_name":"github_public"}
github/docs file tsconfig.json tsconfig.json 641 beedb054164da3b1ada92f449aee69b8a0a3013e https://api.github.com/repos/github/docs/contents/tsconfig.json?ref=main https://api.github.com/repos/github/docs/git/blobs/beedb054164da3b1ada92f449aee69b8a0a3013e https://github.com/github/docs/blob/main/tsconfig.json https://raw.githubusercontent.com/github/docs/main/tsconfig.json {"connection_name":"github_public"}
github/docs file jest.setup.js jest.setup.js 487 a7f994411e5dbaa8d880b0b1de0fed0411d280df https://api.github.com/repos/github/docs/contents/jest.setup.js?ref=main https://api.github.com/repos/github/docs/git/blobs/a7f994411e5dbaa8d880b0b1de0fed0411d280df https://github.com/github/docs/blob/main/jest.setup.js https://raw.githubusercontent.com/github/docs/main/jest.setup.js {"connection_name":"github_public"}
github/docs file next.config.js next.config.js 1832 50aa6fcec002869b3635c1a046609674d688abb1 https://api.github.com/repos/github/docs/contents/next.config.js?ref=main https://api.github.com/repos/github/docs/git/blobs/50aa6fcec002869b3635c1a046609674d688abb1 https://github.com/github/docs/blob/main/next.config.js https://raw.githubusercontent.com/github/docs/main/next.config.js {"connection_name":"github_public"}
github/docs file package.json package.json 7842 43f22e9aa7d7831115b17e63e3cc8581486be110 https://api.github.com/repos/github/docs/contents/package.json?ref=main https://api.github.com/repos/github/docs/git/blobs/43f22e9aa7d7831115b17e63e3cc8581486be110 https://github.com/github/docs/blob/main/package.json https://raw.githubusercontent.com/github/docs/main/package.json {"connection_name":"github_public"}
github/docs file Dockerfile.openapi_decorator Dockerfile.openapi_decorator 525 6014681b41da5fd88a60cc72d502ba46ca961730 https://api.github.com/repos/github/docs/contents/Dockerfile.openapi\_decorator?ref=main https://api.github.com/repos/github/docs/git/blobs/6014681b41da5fd88a60cc72d502ba46ca961730 https://github.com/github/docs/blob/main/Dockerfile.openapi\_decorator https://raw.githubusercontent.com/github/docs/main/Dockerfile.openapi\_decorator {"connection_name":"github_public"}
github/docs file .eslintrc.cjs .eslintrc.cjs 1061 2e7e063533be52faaa54efd855f9ef5a57e97bba https://api.github.com/repos/github/docs/contents/.eslintrc.cjs?ref=main https://api.github.com/repos/github/docs/git/blobs/2e7e063533be52faaa54efd855f9ef5a57e97bba https://github.com/github/docs/blob/main/.eslintrc.cjs https://raw.githubusercontent.com/github/docs/main/.eslintrc.cjs {"connection_name":"github_public"}
github/docs dir pages pages 0 c1fa0161d0b55f41c0316ff69d5d3fe5d576d923 https://api.github.com/repos/github/docs/contents/pages?ref=main https://api.github.com/repos/github/docs/git/trees/c1fa0161d0b55f41c0316ff69d5d3fe5d576d923 https://github.com/github/docs/tree/main/pages {"connection_name":"github_public"}
github/docs file LICENSE LICENSE 18620 9238c8f9388066fe7cb3b308de35104bb3c9596b https://api.github.com/repos/github/docs/contents/LICENSE?ref=main https://api.github.com/repos/github/docs/git/blobs/9238c8f9388066fe7cb3b308de35104bb3c9596b https://github.com/github/docs/blob/main/LICENSE https://raw.githubusercontent.com/github/docs/main/LICENSE {"connection_name":"github_public"}
github/docs file codespaces-settings.json codespaces-settings.json 19 840c49b326de81028baeced9678851ec46f5be02 https://api.github.com/repos/github/docs/contents/codespaces-settings.json?ref=main https://api.github.com/repos/github/docs/git/blobs/840c49b326de81028baeced9678851ec46f5be02 https://github.com/github/docs/blob/main/codespaces-settings.json https://raw.githubusercontent.com/github/docs/main/codespaces-settings.json {"connection_name":"github_public"}
github/docs dir lib lib 0 4514297a5e659ae5819ac61db762711e6aad5936 https://api.github.com/repos/github/docs/contents/lib?ref=main https://api.github.com/repos/github/docs/git/trees/4514297a5e659ae5819ac61db762711e6aad5936 https://github.com/github/docs/tree/main/lib {"connection_name":"github_public"}
github/docs file CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md 5363 e66f6d941d8c806dde598112670761e8ad205f99 https://api.github.com/repos/github/docs/contents/CODE\_OF\_CONDUCT.md?ref=main https://api.github.com/repos/github/docs/git/blobs/e66f6d941d8c806dde598112670761e8ad205f99 https://github.com/github/docs/blob/main/CODE\_OF\_CONDUCT.md https://raw.githubusercontent.com/github/docs/main/CODE\_OF\_CONDUCT.md {"connection_name":"github_public"}
github/docs file nodemon.json nodemon.json 153 e5c16a7537db31b3f97b02eab64574af6ff74bb9 https://api.github.com/repos/github/docs/contents/nodemon.json?ref=main https://api.github.com/repos/github/docs/git/blobs/e5c16a7537db31b3f97b02eab64574af6ff74bb9 https://github.com/github/docs/blob/main/nodemon.json https://raw.githubusercontent.com/github/docs/main/nodemon.json {"connection_name":"github_public"}
github/docs file .babelrc .babelrc 68 34abf3fffeb8d879e40057d78d1f4d639c252bed https://api.github.com/repos/github/docs/contents/.babelrc?ref=main https://api.github.com/repos/github/docs/git/blobs/34abf3fffeb8d879e40057d78d1f4d639c252bed https://github.com/github/docs/blob/main/.babelrc https://raw.githubusercontent.com/github/docs/main/.babelrc {"connection_name":"github_public"}
github/docs dir script script 0 c76e0e28601f650c498482594499fc01e480f62c https://api.github.com/repos/github/docs/contents/script?ref=main https://api.github.com/repos/github/docs/git/trees/c76e0e28601f650c498482594499fc01e480f62c https://github.com/github/docs/tree/main/script {"connection_name":"github_public"}
github/docs file LICENSE-CODE LICENSE-CODE 1059 c9802266ce3239fc222b1c803308535712b2e3be https://api.github.com/repos/github/docs/contents/LICENSE-CODE?ref=main https://api.github.com/repos/github/docs/git/blobs/c9802266ce3239fc222b1c803308535712b2e3be https://github.com/github/docs/blob/main/LICENSE-CODE https://raw.githubusercontent.com/github/docs/main/LICENSE-CODE {"connection_name":"github_public"}
github/docs dir components components 0 eac3eccf4214887e41cbb012ea4a7a621e8a235c https://api.github.com/repos/github/docs/contents/components?ref=main https://api.github.com/repos/github/docs/git/trees/eac3eccf4214887e41cbb012ea4a7a621e8a235c https://github.com/github/docs/tree/main/components {"connection_name":"github_public"}
github/docs file CONTRIBUTING.md CONTRIBUTING.md 7797 babc51f666d5d0d361944e2901616a03d2fbe051 https://api.github.com/repos/github/docs/contents/CONTRIBUTING.md?ref=main https://api.github.com/repos/github/docs/git/blobs/babc51f666d5d0d361944e2901616a03d2fbe051 https://github.com/github/docs/blob/main/CONTRIBUTING.md https://raw.githubusercontent.com/github/docs/main/CONTRIBUTING.md {"connection_name":"github_public"}
github/docs dir middleware middleware 0 54ac42077acdeab7230ee179589c235cebef03a0 https://api.github.com/repos/github/docs/contents/middleware?ref=main https://api.github.com/repos/github/docs/git/trees/54ac42077acdeab7230ee179589c235cebef03a0 https://github.com/github/docs/tree/main/middleware {"connection_name":"github_public"}
github/docs file ownership.yaml ownership.yaml 727 8bcc8188283f89caa6eea115461a6122acb6c8a8 https://api.github.com/repos/github/docs/contents/ownership.yaml?ref=main https://api.github.com/repos/github/docs/git/blobs/8bcc8188283f89caa6eea115461a6122acb6c8a8 https://github.com/github/docs/blob/main/ownership.yaml https://raw.githubusercontent.com/github/docs/main/ownership.yaml {"connection_name":"github_public"}
github/docs file .gitattributes .gitattributes 267 94f95b93826d614321f8db400bf27e0ec84c6283 https://api.github.com/repos/github/docs/contents/.gitattributes?ref=main https://api.github.com/repos/github/docs/git/blobs/94f95b93826d614321f8db400bf27e0ec84c6283 https://github.com/github/docs/blob/main/.gitattributes https://raw.githubusercontent.com/github/docs/main/.gitattributes {"connection_name":"github_public"}
github/docs file README.md README.md 3345 fbbaf2e15695e62c7f8e992b70dd67f95260a2a9 https://api.github.com/repos/github/docs/contents/README.md?ref=main https://api.github.com/repos/github/docs/git/blobs/fbbaf2e15695e62c7f8e992b70dd67f95260a2a9 https://github.com/github/docs/blob/main/README.md https://raw.githubusercontent.com/github/docs/main/README.md {"connection_name":"github_public"}
github/docs file server.js server.js 49 a48da58794021cf7db6f7b9ee270c657be6adcf9 https://api.github.com/repos/github/docs/contents/server.js?ref=main https://api.github.com/repos/github/docs/git/blobs/a48da58794021cf7db6f7b9ee270c657be6adcf9 https://github.com/github/docs/blob/main/server.js https://raw.githubusercontent.com/github/docs/main/server.js {"connection_name":"github_public"}
github/docs dir content content 0 2cebbc04564c9c3301c0fa84a0e4099ecbd3b11d https://api.github.com/repos/github/docs/contents/content?ref=main https://api.github.com/repos/github/docs/git/trees/2cebbc04564c9c3301c0fa84a0e4099ecbd3b11d https://github.com/github/docs/tree/main/content {"connection_name":"github_public"}
github/docs file Dockerfile Dockerfile 2989 cb9dcc3ad98d6ea9c4112ed7904604b828087578 https://api.github.com/repos/github/docs/contents/Dockerfile?ref=main https://api.github.com/repos/github/docs/git/blobs/cb9dcc3ad98d6ea9c4112ed7904604b828087578 https://github.com/github/docs/blob/main/Dockerfile https://raw.githubusercontent.com/github/docs/main/Dockerfile {"connection_name":"github_public"}
github/docs file next-env.d.ts next-env.d.ts 201 4f11a03dc6cc37f2b5105c08f2e7b24c603ab2f4 https://api.github.com/repos/github/docs/contents/next-env.d.ts?ref=main https://api.github.com/repos/github/docs/git/blobs/4f11a03dc6cc37f2b5105c08f2e7b24c603ab2f4 https://github.com/github/docs/blob/main/next-env.d.ts https://raw.githubusercontent.com/github/docs/main/next-env.d.ts {"connection_name":"github_public"}
github/docs file package-lock.json package-lock.json 1141381 a871e8fa9175668edc875fd086f8d83cfb161c00 https://api.github.com/repos/github/docs/contents/package-lock.json?ref=main https://api.github.com/repos/github/docs/git/blobs/a871e8fa9175668edc875fd086f8d83cfb161c00 https://github.com/github/docs/blob/main/package-lock.json https://raw.githubusercontent.com/github/docs/main/package-lock.json {"connection_name":"github_public"}
github/docs dir .devcontainer .devcontainer 0 6a929511b06913dbc123320eb0ed5b880a7cedc5 https://api.github.com/repos/github/docs/contents/.devcontainer?ref=main https://api.github.com/repos/github/docs/git/trees/6a929511b06913dbc123320eb0ed5b880a7cedc5 https://github.com/github/docs/tree/main/.devcontainer {"connection_name":"github_public"}
github/docs file start-server.js start-server.js 1801 99f4872fbbbd786a0b8fe3d1fcc38fe3d875bfa8 https://api.github.com/repos/github/docs/contents/start-server.js?ref=main https://api.github.com/repos/github/docs/git/blobs/99f4872fbbbd786a0b8fe3d1fcc38fe3d875bfa8 https://github.com/github/docs/blob/main/start-server.js https://raw.githubusercontent.com/github/docs/main/start-server.js {"connection_name":"github_public"}
github/docs dir .github .github 0 c9a5878760cee1010de687606243511d408c35f7 https://api.github.com/repos/github/docs/contents/.github?ref=main https://api.github.com/repos/github/docs/git/trees/c9a5878760cee1010de687606243511d408c35f7 https://github.com/github/docs/tree/main/.github {"connection_name":"github_public"}
github/docs dir contributing contributing 0 dcee2b717757136f5c5554ee2d9528962902adf4 https://api.github.com/repos/github/docs/contents/contributing?ref=main https://api.github.com/repos/github/docs/git/trees/dcee2b717757136f5c5554ee2d9528962902adf4 https://github.com/github/docs/tree/main/contributing {"connection_name":"github_public"}
github/docs dir tests tests 0 be635b1a62e00e23077a22e0cc2aa3005a663518 https://api.github.com/repos/github/docs/contents/tests?ref=main https://api.github.com/repos/github/docs/git/trees/be635b1a62e00e23077a22e0cc2aa3005a663518 https://github.com/github/docs/tree/main/tests {"connection_name":"github_public"}
github/docs file .editorconfig .editorconfig 171 beffa3084e7a693343fff8701f413ec3efa87b24 https://api.github.com/repos/github/docs/contents/.editorconfig?ref=main https://api.github.com/repos/github/docs/git/blobs/beffa3084e7a693343fff8701f413ec3efa87b24 https://github.com/github/docs/blob/main/.editorconfig https://raw.githubusercontent.com/github/docs/main/.editorconfig {"connection_name":"github_public"}
github/docs file .dockerignore .dockerignore 353 aa9b89a06425fc2f21f673e976ff721365892ea5 https://api.github.com/repos/github/docs/contents/.dockerignore?ref=main https://api.github.com/repos/github/docs/git/blobs/aa9b89a06425fc2f21f673e976ff721365892ea5 https://github.com/github/docs/blob/main/.dockerignore https://raw.githubusercontent.com/github/docs/main/.dockerignore {"connection_name":"github_public"}
github/docs dir assets assets 0 5f0e97fca19d32331a8e424acc8a031d24a98911 https://api.github.com/repos/github/docs/contents/assets?ref=main https://api.github.com/repos/github/docs/git/trees/5f0e97fca19d32331a8e424acc8a031d24a98911 https://github.com/github/docs/tree/main/assets {"connection_name":"github_public"}
github/docs file .gitignore .gitignore 614 d610611db9497f61f6a28d4981def15f75130b0d https://api.github.com/repos/github/docs/contents/.gitignore?ref=main https://api.github.com/repos/github/docs/git/blobs/d610611db9497f61f6a28d4981def15f75130b0d https://github.com/github/docs/blob/main/.gitignore https://raw.githubusercontent.com/github/docs/main/.gitignore {"connection_name":"github_public"}
github/docs file docker-compose.yaml docker-compose.yaml 141 68470e45a7ff46af90f07e549e4e416eab721011 https://api.github.com/repos/github/docs/contents/docker-compose.yaml?ref=main https://api.github.com/repos/github/docs/git/blobs/68470e45a7ff46af90f07e549e4e416eab721011 https://github.com/github/docs/blob/main/docker-compose.yaml https://raw.githubusercontent.com/github/docs/main/docker-compose.yaml {"connection_name":"github_public"}
github/docs dir docs docs 0 743da72211bf44ab6c1c7b0868bafdb41bb3415b https://api.github.com/repos/github/docs/contents/docs?ref=main https://api.github.com/repos/github/docs/git/trees/743da72211bf44ab6c1c7b0868bafdb41bb3415b https://github.com/github/docs/tree/main/docs {"connection_name":"github_public"}
github/docs dir stylesheets stylesheets 0 61229708c49cd5733becd8907516f8582f8b70a8 https://api.github.com/repos/github/docs/contents/stylesheets?ref=main https://api.github.com/repos/github/docs/git/trees/61229708c49cd5733becd8907516f8582f8b70a8 https://github.com/github/docs/tree/main/stylesheets {"connection_name":"github_public"}
github/docs dir translations translations 0 c2f6dc20ce63483cab222e1d9e8b922dae06807e https://api.github.com/repos/github/docs/contents/translations?ref=main https://api.github.com/repos/github/docs/git/trees/c2f6dc20ce63483cab222e1d9e8b922dae06807e https://github.com/github/docs/tree/main/translations {"connection_name":"github_public"}
github/docs file docker-compose.prod.tmpl.yaml docker-compose.prod.tmpl.yaml 870 0c986eca9312d4ef114c1f388db2be28415bdc5a https://api.github.com/repos/github/docs/contents/docker-compose.prod.tmpl.yaml?ref=main https://api.github.com/repos/github/docs/git/blobs/0c986eca9312d4ef114c1f388db2be28415bdc5a https://github.com/github/docs/blob/main/docker-compose.prod.tmpl.yaml https://raw.githubusercontent.com/github/docs/main/docker-compose.prod.tmpl.yaml {"connection_name":"github_public"}
github/docs file jest-puppeteer.config.cjs jest-puppeteer.config.cjs 109 a66133dd35ea74a0afc69c34da4bbce8052684d4 https://api.github.com/repos/github/docs/contents/jest-puppeteer.config.cjs?ref=main https://api.github.com/repos/github/docs/git/blobs/a66133dd35ea74a0afc69c34da4bbce8052684d4 https://github.com/github/docs/blob/main/jest-puppeteer.config.cjs https://raw.githubusercontent.com/github/docs/main/jest-puppeteer.config.cjs {"connection_name":"github_public"}
github/docs file docker-compose.staging.tmpl.yaml docker-compose.staging.tmpl.yaml 849 0ca9b2d0fae1606db13fd77803cd5bb6e0aacf6b https://api.github.com/repos/github/docs/contents/docker-compose.staging.tmpl.yaml?ref=main https://api.github.com/repos/github/docs/git/blobs/0ca9b2d0fae1606db13fd77803cd5bb6e0aacf6b https://github.com/github/docs/blob/main/docker-compose.staging.tmpl.yaml https://raw.githubusercontent.com/github/docs/main/docker-compose.staging.tmpl.yaml {"connection_name":"github_public"}
github/docs dir data data 0 569ebd957ef4dfacad0bf26c552db7d36cbbc017 https://api.github.com/repos/github/docs/contents/data?ref=main https://api.github.com/repos/github/docs/git/trees/569ebd957ef4dfacad0bf26c552db7d36cbbc017 https://github.com/github/docs/tree/main/data {"connection_name":"github_public"}
github/docs file jest.config.js jest.config.js 1464 404781c32232722730480118de89b8dc8e0125f4 https://api.github.com/repos/github/docs/contents/jest.config.js?ref=main https://api.github.com/repos/github/docs/git/blobs/404781c32232722730480118de89b8dc8e0125f4 https://github.com/github/docs/blob/main/jest.config.js https://raw.githubusercontent.com/github/docs/main/jest.config.js {"connection_name":"github_public"}
github/docs file feature-flags.json feature-flags.json 63 64c69f19d789c3f681400959dc1b3985bd9edf9e https://api.github.com/repos/github/docs/contents/feature-flags.json?ref=main https://api.github.com/repos/github/docs/git/blobs/64c69f19d789c3f681400959dc1b3985bd9edf9e https://github.com/github/docs/blob/main/feature-flags.json https://raw.githubusercontent.com/github/docs/main/feature-flags.json {"connection_name":"github_public"}
github/docs file .npmrc .npmrc 105 9b816f6d44a58c89ae93cebddd940208422b0894 https://api.github.com/repos/github/docs/contents/.npmrc?ref=main https://api.github.com/repos/github/docs/git/blobs/9b816f6d44a58c89ae93cebddd940208422b0894 https://github.com/github/docs/blob/main/.npmrc https://raw.githubusercontent.com/github/docs/main/.npmrc {"connection_name":"github_public"}
github/docs file .prettierignore .prettierignore 85 80eac85c27be1e4df71d9be9eb39f0381026f178 https://api.github.com/repos/github/docs/contents/.prettierignore?ref=main https://api.github.com/repos/github/docs/git/blobs/80eac85c27be1e4df71d9be9eb39f0381026f178 https://github.com/github/docs/blob/main/.prettierignore https://raw.githubusercontent.com/github/docs/main/.prettierignore {"connection_name":"github_public"}
github/docs dir .husky .husky 0 99cc69a3f9a2c9606eaff8ef21c81a37857737d4 https://api.github.com/repos/github/docs/contents/.husky?ref=main https://api.github.com/repos/github/docs/git/trees/99cc69a3f9a2c9606eaff8ef21c81a37857737d4 https://github.com/github/docs/tree/main/.husky {"connection_name":"github_public"}
github/docs file .node-version .node-version 6 1c2b43343f0b94485b880b21d7cb9c6ee8593b8d https://api.github.com/repos/github/docs/contents/.node-version?ref=main https://api.github.com/repos/github/docs/git/blobs/1c2b43343f0b94485b880b21d7cb9c6ee8593b8d https://github.com/github/docs/blob/main/.node-version https://raw.githubusercontent.com/github/docs/main/.node-version {"connection_name":"github_public"}
github/docs file .prettierrc.json .prettierrc.json 357 a76d08f0287d26d78a8215b1880b8f0c218ea84a https://api.github.com/repos/github/docs/contents/.prettierrc.json?ref=main https://api.github.com/repos/github/docs/git/blobs/a76d08f0287d26d78a8215b1880b8f0c218ea84a https://github.com/github/docs/blob/main/.prettierrc.json https://raw.githubusercontent.com/github/docs/main/.prettierrc.json {"connection_name":"github_public"}

List a directory in a repository

Query
select
  * 
from
  github_public.github_repository_content 
where
  repository_full_name = 'github/docs' 
  and requested_path = 'docs'
Results
repository_full_name type name requested_path path size content target sha url git_url html_url download_url _ctx
github/docs file index.yaml docs docs/index.yaml 1963 91461a8c9f53fd0bc1b3b278cdfd5b262ac2c343 https://api.github.com/repos/github/docs/contents/docs/index.yaml?ref=main https://api.github.com/repos/github/docs/git/blobs/91461a8c9f53fd0bc1b3b278cdfd5b262ac2c343 https://github.com/github/docs/blob/main/docs/index.yaml https://raw.githubusercontent.com/github/docs/main/docs/index.yaml {"connection_name":"github_public"}

Get a file in a repository

Query
select
  * 
from
  github_public.github_repository_content 
where
  repository_full_name = 'github/docs' 
  and requested_path = 'docs/index.yaml'
Results
repository_full_name type name requested_path path size content target sha url git_url html_url download_url _ctx
github/docs file index.yaml docs/index.yaml docs/index.yaml 1963 # This stuff ends up here: https://catalog.githubapp.com/services/help-docs/docs

version: 1
links:
- name: Observability docs
description: Docs Engineering observability docs
kind: docs
service: docs-internal
url: https://github.com/github/docs-engineering/blob/main/docs/observability/docs.github.com.md
- name: Datadog dashboard
description: Production Datadog dashboard
kind: dashboard
service: docs-internal
url: https://app.datadoghq.com/dashboard/8uc-x67-tgi/help-docs
- name: Sentry dashboard
description: Production Sentry dashboard
kind: dashboard
service: docs-internal
url: https://sentry.io/organizations/github/issues/?project=5394325
- name: Help Docs playbook
description: How to respond to Help Docs Alerts
kind: playbook
service: docs-internal
url: https://github.com/github/docs-engineering/blob/main/docs/playbooks/docs/index.md
- name: Maintaining the deployment
description: Document describing the production deployment and how to troubleshoot it.
kind: docs
service: docs-internal
url: https://github.com/github/docs-internal#deployments
- name: PagerDuty escalation policy
description: Escalation policy and on-call schedule for incident response
kind: tool
service: docs-internal
url: https://github.pagerduty.com/schedules#PSTWXGP
- name: Feature docs
description: Docs describing a few key features of Help Docs
kind: docs
service: docs-internal
url: https://github.com/github/docs-engineering/tree/main/docs
- name: Technical architecture
description: This document covers the technical architecture of Help Docs
kind: docs
service: docs-internal
url: https://github.com/github/docs-internal#readmes
- name: Spin up locally
description: How to setup Help Docs on your local machine
kind: docs
service: docs-internal
url: https://github.com/github/docs-internal#developing
91461a8c9f53fd0bc1b3b278cdfd5b262ac2c343 https://api.github.com/repos/github/docs/contents/docs/index.yaml?ref=main https://api.github.com/repos/github/docs/git/blobs/91461a8c9f53fd0bc1b3b278cdfd5b262ac2c343 https://github.com/github/docs/blob/main/docs/index.yaml https://raw.githubusercontent.com/github/docs/main/docs/index.yaml {"connection_name":"github_public"}

@aminvielledebatAtBedrock aminvielledebatAtBedrock marked this pull request as ready for review October 5, 2022 22:31
@misraved misraved self-requested a review October 12, 2022 10:07
github_public.github_repository_content
where
repository_full_name = 'github/docs'
and repository_content_path = 'docs'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
and repository_content_path = 'docs'
and repository_content_path = 'docs';

github_public.github_repository_content
where
repository_full_name = 'github/docs'
and repository_content_path = '.vscode/settings.json'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
and repository_content_path = '.vscode/settings.json'
and repository_content_path = '.vscode/settings.json';

{Name: "content", Description: "The decoded file content (if the element is a file).", Type: proto.ColumnType_STRING, Transform: transform.FromMethod("GetContent")},
{Name: "target", Description: "Target is only set if the type is \"symlink\" and the target is not a normal file. If Target is set, Path will be the symlink path.", Type: proto.ColumnType_STRING},
{Name: "sha", Description: "The sha of the file.", Type: proto.ColumnType_STRING, Transform: transform.FromField("SHA")},
{Name: "url", Description: "Url of file's metadata", Type: proto.ColumnType_STRING},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{Name: "url", Description: "Url of file's metadata", Type: proto.ColumnType_STRING},
{Name: "url", Description: "URL of file's metadata.", Type: proto.ColumnType_STRING},

Comment on lines 35 to 36
{Name: "git_url", Description: "Git url (with SHA) of the file", Type: proto.ColumnType_STRING},
{Name: "html_url", Description: "Raw file url in GitHub", Type: proto.ColumnType_STRING},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{Name: "git_url", Description: "Git url (with SHA) of the file", Type: proto.ColumnType_STRING},
{Name: "html_url", Description: "Raw file url in GitHub", Type: proto.ColumnType_STRING},
{Name: "git_url", Description: "Git URL (with SHA) of the file.", Type: proto.ColumnType_STRING},
{Name: "html_url", Description: "Raw file URL in GitHub.", Type: proto.ColumnType_STRING},

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.

Thanks @aminvielledebatAtBedrock for the contribution.

I have left a few minor comments on the PR. If you have any questions on the feedback, please reach out 😄 .

@aminvielledebatAtBedrock
Copy link
Contributor Author

So cool @misraved and @cbruno10 !
Fixed !

One last point : actually content is filled when repository_file_content_path points to a file (empty when you list a dir).
Do you think it could be great to use a specific Hydrate on this column, to make X API calls to get X file contents ?

IMO, it's not the most efficient way 😢

@aminvielledebatAtBedrock aminvielledebatAtBedrock requested review from cbruno10 and misraved and removed request for cbruno10 and misraved October 12, 2022 14:03
@e-gineer
Copy link
Contributor

I'm excited about this table ... wondering about the name ... is github_repository_content the best name?

Generally the name of the table should represent what is in each row. Perhaps github_repository_file or github_repository_path?

@misraved
Copy link
Contributor

@e-gineer I think github_repository_content is a better name since it encapsulates both files and directories.

It gives all the contents of the target repository.

@aminvielledebatAtBedrock I think using a specific Hydrate on the content column is the correct way to go about it, even though it's not the most efficient.

@cbruno10 could you please share your thoughts on this one?

@aminvielledebatAtBedrock
Copy link
Contributor Author

✔️ Automaticaly get file content when displaying content of a directory
✔️ Documentation updated

cc @misraved and @cbruno10

@cbruno10
Copy link
Contributor

Hey @aminvielledebatAtBedrock , sorry for the delay in review, I'll have a look tomorrow and provide any additional feedback.

@gforien
Copy link

gforien commented Nov 7, 2022

Hi
Any updates on this 🙏 ?

@cbruno10
Copy link
Contributor

cbruno10 commented Nov 7, 2022

Hi @gforien , @aminvielledebatAtBedrock , sorry, we're (still) working through a backlog of issues and other PR reviews (in other plugin and mod repos as well). This is definitely on our radar though and we'll address the review as soon as we can.

Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

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

@aminvielledebatAtBedrock Please see review questions and suggestions, thanks!


//// TABLE DEFINITION

func tableGitHubRepositoryContent() *plugin.Table {
Copy link
Contributor

Choose a reason for hiding this comment

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

@aminvielledebatAtBedrock I tried to use this table to list contents of a directory that contained a .png file, and then tried a query to get the actual .png file:

> select * from github_repository_content where repository_full_name = 'turbot/steampipe-mod-aws-insights' and repository_content_path = 'docs/images/aws-insights-console-graphic.png'

Error: rpc error: code = Internal desc = grpc: error while marshaling: string field contains invalid UTF-8 (SQLSTATE HV000)

+----------------------+------+------+-------------------------+------+------+---------+--------+-----+-----+---------+----------+--------------+------+
| repository_full_name | type | name | repository_content_path | path | size | content | target | sha | url | git_url | html_url | download_url | _ctx |
+----------------------+------+------+-------------------------+------+------+---------+--------+-----+-----+---------+----------+--------------+------+
+----------------------+------+------+-------------------------+------+------+---------+--------+-----+-----+---------+----------+--------------+------+
> select * from github_repository_content where repository_full_name = 'turbot/steampipe-mod-aws-insights' and repository_content_path = 'docs/images'

Error: rpc error: code = Internal desc = grpc: error while marshaling: string field contains invalid UTF-8 (SQLSTATE HV000)

+----------------------+------+------+-------------------------+------+------+---------+--------+-----+-----+---------+----------+--------------+------+
| repository_full_name | type | name | repository_content_path | path | size | content | target | sha | url | git_url | html_url | download_url | _ctx |
+----------------------+------+------+-------------------------+------+------+---------+--------+-----+-----+---------+----------+--------------+------+
+----------------------+------+------+-------------------------+------+------+---------+--------+-----+-----+---------+----------+--------------+------+

I'm not sure what the repository content API returns, but have you tested using this table when getting content for non-text files, or listing directories that contain them? For instance, does this table also work with GIF, JPEG, SVG, Microsoft Office (Word, PPT, Excel), PDF, etc., files? If so, what's in content for them?

Also, I'm not sure if you're on a different version, but I'm on github.com/google/go-github/v48 v48.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

I just tried against an .svg file and it seemed to return the content OK

{Name: "name", Description: "The file name.", Type: proto.ColumnType_STRING},
{Name: "repository_content_path", Description: "The requested path in repository search.", Type: proto.ColumnType_STRING, Transform: transform.FromQual("repository_content_path")},
{Name: "path", Description: "The path of the file.", Type: proto.ColumnType_STRING},
{Name: "size", Description: "The size of the file (in MB).", Type: proto.ColumnType_INT},
Copy link
Contributor

Choose a reason for hiding this comment

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

@aminvielledebatAtBedrock I saw that the GitHub API lists some caveats and restrictions about file size in https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#size-limits.

What are the query results/error if the file size is over 100 MB? Also, for files less than 1 MB and for those between 1 - 100 MB, are there any differences in the column values, or do the differences not affect the table?


func tableGitHubRepositoryContent() *plugin.Table {
return &plugin.Table{
Name: "github_repository_content",
Copy link
Contributor

Choose a reason for hiding this comment

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

For the table name (originally brought up in #207 (comment)), I think I still like the name github_repository_content, but am open to github_repository_file.

For github_repository_content, it's the name that the GitHub API uses and because each row can return each file's contents, the name still seems to fit.

On the other hand, github_repository_file would also be intuitive, as each row contains a file (giving meta information and contents).

Between the two, I don't have any strong preferences.

@e-gineer @johnsmyth @aminvielledebatAtBedrock - Curious to hear your thoughts as well, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

@cbruno10 I also lean toward github_repository_content if the table also returns submodules and directories in addition to files.

ShouldIgnoreError: isNotFoundError([]string{"404"}),
KeyColumns: []*plugin.KeyColumn{
{Name: "repository_full_name", Require: plugin.Required},
{Name: "repository_content_path", Require: plugin.Optional, CacheMatch: "exact"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a separate column for this? Could we use path instead as the optional key column?

List: &plugin.ListConfig{
Hydrate: tableGitHubRepositoryContentList,
ShouldIgnoreError: isNotFoundError([]string{"404"}),
KeyColumns: []*plugin.KeyColumn{
Copy link
Contributor

Choose a reason for hiding this comment

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

For key columns, are we also able to pass in the ref, e.g., commit, branch, that the API lists?

@github-actions
Copy link

'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label Feb 12, 2023
@misraved misraved removed the stale No recent activity has been detected on this issue/PR and it will be closed label Feb 13, 2023
@cbruno10
Copy link
Contributor

Hey @aminvielledebatAtBedrock , do you think you'll have time to look at the review suggestions soon? We're keen to get your awesome table in, so if you don't have time, we can merge your branch into a local feature branch and then go from there. Thanks!

@aminvielledebatAtBedrock
Copy link
Contributor Author

Hi @cbruno10 ! Sorry about the delay, i'm working on other stuff right now... but we need this table to exploit baseline from https://github.com/Yelp/detect-secrets accross our projects.

So, I plan to work on it the next weeks. If it's acceptable for you, you can rely on me.

@github-actions
Copy link

'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label Apr 16, 2023
@aminvielledebatAtBedrock
Copy link
Contributor Author

Don't stale this PR. I'm still working on ;)

@cbruno10 cbruno10 removed the stale No recent activity has been detected on this issue/PR and it will be closed label Apr 17, 2023
@cbruno10
Copy link
Contributor

@aminvielledebatAtBedrock Blame the bot 😆 Thanks for checking up on the issue!

@cbruno10
Copy link
Contributor

@aminvielledebatAtBedrock Hey, just checking in, would you like any help with this PR? We're happy to do some additional testing for the suggestions above if so. Thanks!

@cbruno10 cbruno10 changed the base branch from main to add-github-repo-content-table August 15, 2023 19:28
@cbruno10 cbruno10 merged commit 20de5e4 into turbot:add-github-repo-content-table Aug 15, 2023
1 check failed
@cbruno10
Copy link
Contributor

Hey @aminvielledebatAtBedrock , thanks again for your work on this table!

For now, I've merged it into the add-github-repo-content branch, as we're planning on addressing some of the comments/suggestions in the next few weeks from the most recent review, #207.

If you get time and are interested in working more on the table, feel free to fork the add-github-repo-content branch and open another PR!

@aminvielledebatAtBedrock
Copy link
Contributor Author

Hey @cbruno10 !

Sorry again for the delay. You're totally right by doing this.
Actually, i don't have enough time to rework this PR (I saw that you're using the new github graphql API, it's pretty cool 😄), so feel free !

Thank you so much for your efforts !

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

6 participants