This command queries all open Github issues in an organization or repository, and loads that data to a BigQuery table.
This program assumes that the table already exists. Learn how to create an empty table.
If you get a no such field
error, fix the table schema mismatch
If the JSON file is bigger than 100MB, BigQuery fails. To fix that issue, split the file into smaller parts and upload them manually before running the program.
See the list of available flags:
Name | Required | Description |
---|---|---|
--githubOrgName | Yes | The string value with the Github organization name to retrieve issues from. |
--githubRepoName | No | The string value with the Github repository name to retrieve issues from. |
--githubToken | Yes | The string value with the Github OAuth token. |
--githubBaseURL | No | The string value with the custom Github API base URL. |
--issuesFilename | No | The string value with the name of the generated file with list of issues. It defaults to issues.json . |
--bqCredentials | Yes | The string value with the path to BigQuery credentials JSON file. |
--bqProjectID | Yes | The string value with the name of the BigQuery project. |
--bqDatasetName | Yes | The string value with the name of the BigQuery dataset. |
--bqTableName | Yes | The string value with the name of the BigQuery table. |
To create an empty table, do the following:
- Go to BigQuery console.
- Create a new table in a dataset.
- Edit the schema as text:
- For an organization, copy the schema from
table_org_schema.json
. - For a singular repo, copy the schema from
table_repo_schema.json
.
- In the
partitioning
dropdown list, selectupdated_at
field.
In order to fix the no such field
error, do the following:
- Download the current table schema definition. Run:
bq show \ --schema \ --format=prettyjson \ PROJECT_ID:DATASET.TABLE_NAME > table_org_schema.json
. - Add missing fields to the
table_org_schema.json
file. - Upload the updated table schema. Run:
bq update PROJECT_ID:DATASET.TABLE_NAME table_org_schema.json
.