Skip to content

Commit bfdba6c

Browse files
Fix events and workflow_runs datetimes in source-github (#19299)
* Fix events and workflow_runs datetimes in `source-github` * add PR number * whitespace * auto-bump connector version Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
1 parent b16f28f commit bfdba6c

File tree

6 files changed

+85
-76
lines changed

6 files changed

+85
-76
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
- name: GitHub
469469
sourceDefinitionId: ef69ef6e-aa7f-4af1-a01d-ef775033524e
470470
dockerRepository: airbyte/source-github
471-
dockerImageTag: 0.3.7
471+
dockerImageTag: 0.3.8
472472
documentationUrl: https://docs.airbyte.com/integrations/sources/github
473473
icon: github.svg
474474
sourceType: api

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4094,7 +4094,7 @@
40944094
supportsNormalization: false
40954095
supportsDBT: false
40964096
supported_destination_sync_modes: []
4097-
- dockerImage: "airbyte/source-github:0.3.7"
4097+
- dockerImage: "airbyte/source-github:0.3.8"
40984098
spec:
40994099
documentationUrl: "https://docs.airbyte.com/integrations/sources/github"
41004100
connectionSpecification:

airbyte-integrations/connectors/source-github/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ RUN pip install .
1212
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
1313
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1414

15-
LABEL io.airbyte.version=0.3.7
15+
LABEL io.airbyte.version=0.3.8
1616
LABEL io.airbyte.name=airbyte/source-github

airbyte-integrations/connectors/source-github/source_github/schemas/events.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
}
5454
},
5555
"created_at": {
56-
"type": ["null", "string"]
56+
"type": ["null", "string"],
57+
"format": "date-time"
5758
},
5859
"id": {
5960
"type": ["null", "string"]

airbyte-integrations/connectors/source-github/source_github/schemas/workflow_runs.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@
5353
}
5454
},
5555
"created_at": {
56-
"type": ["null", "string"]
56+
"type": ["null", "string"],
57+
"format": "date-time"
5758
},
5859
"updated_at": {
59-
"type": ["null", "string"]
60+
"type": ["null", "string"],
61+
"format": "date-time"
6062
},
6163
"run_attempt": {
6264
"type": ["null", "integer"]

docs/integrations/sources/github.md

Lines changed: 76 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
# GitHub
2+
23
This page contains the setup guide and reference information for the GitHub source connector.
34

45
## Prerequisites
5-
* Start date
6-
* GitHub Repositories
7-
* Branch (Optional)
8-
* Page size for large streams (Optional)
96

10-
**For Airbyte Cloud:**
7+
- Start date
8+
- GitHub Repositories
9+
- Branch (Optional)
10+
- Page size for large streams (Optional)
1111

12-
* Personal Access Token (see [Permissions and scopes](https://docs.airbyte.com/integrations/sources/github#permissions-and-scopes))
13-
* OAuth
12+
**For Airbyte Cloud:**
1413

14+
- Personal Access Token (see [Permissions and scopes](https://docs.airbyte.com/integrations/sources/github#permissions-and-scopes))
15+
- OAuth
1516

1617
**For Airbyte Open Source:**
1718

18-
* Personal Access Token (see [Permissions and scopes](https://docs.airbyte.com/integrations/sources/github#permissions-and-scopes))
19-
19+
- Personal Access Token (see [Permissions and scopes](https://docs.airbyte.com/integrations/sources/github#permissions-and-scopes))
2020

2121
## Setup guide
22+
2223
### Step 1: Set up GitHub
2324

2425
Create a [GitHub Account](https://github.com).
@@ -28,19 +29,21 @@ Create a [GitHub Account](https://github.com).
2829
Log into [GitHub](https://github.com) and then generate a [personal access token](https://github.com/settings/tokens). To load balance your API quota consumption across multiple API tokens, input multiple tokens separated with `,`.
2930

3031
### Step 2: Set up the GitHub connector in Airbyte
32+
3133
**For Airbyte Cloud:**
3234

3335
1. [Log into your Airbyte Cloud](https://cloud.airbyte.io/workspaces) account.
3436
2. In the left navigation bar, click **Sources**. In the top-right corner, click **+ new source**.
3537
3. On the source setup page, select **GitHub** from the Source type dropdown and enter a name for this connector.
36-
4. Click `Authenticate your GitHub account` by selecting Oauth or Personal Access Token for Authentication.
38+
4. Click `Authenticate your GitHub account` by selecting Oauth or Personal Access Token for Authentication.
3739
5. Log in and Authorize to the GitHub account.
3840
6. **Start date** - The date from which you'd like to replicate data for streams: `comments`, `commit_comment_reactions`, `commit_comments`, `commits`, `deployments`, `events`, `issue_comment_reactions`, `issue_events`, `issue_milestones`, `issue_reactions`, `issues`, `project_cards`, `project_columns`, `projects`, `pull_request_comment_reactions`, `pull_requests`, `pull_requeststats`, `releases`, `review_comments`, `reviews`, `stargazers`, `workflow_runs`, `workflows`.
3941
7. **GitHub Repositories** - Space-delimited list of GitHub organizations/repositories, e.g. `airbytehq/airbyte` for single repository, `airbytehq/airbyte airbytehq/another-repo` for multiple repositories. If you want to specify the organization to receive data from all its repositories, then you should specify it according to the following example: `airbytehq/*`.
4042
8. **Branch (Optional)** - Space-delimited list of GitHub repository branches to pull commits for, e.g. `airbytehq/airbyte/master`. If no branches are specified for a repository, the default branch will be pulled. (e.g. `airbytehq/airbyte/master airbytehq/airbyte/my-branch`).
4143
9. **Page size for large streams (Optional)** - The GitHub connector contains several streams with a large load. The page size of such streams depends on the size of your repository. Recommended to specify values between 10 and 30.
4244

4345
**For Airbyte Open Source:**
46+
4447
1. Authenticate with **Personal Access Token**.
4548

4649
## Supported sync modes
@@ -59,85 +62,88 @@ The GitHub source connector supports the following [sync modes](https://docs.air
5962

6063
This connector outputs the following full refresh streams:
6164

62-
* [Assignees](https://docs.github.com/en/rest/reference/issues#list-assignees)
63-
* [Branches](https://docs.github.com/en/rest/reference/repos#list-branches)
64-
* [Collaborators](https://docs.github.com/en/rest/reference/repos#list-repository-collaborators)
65-
* [Issue labels](https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository)
66-
* [Organizations](https://docs.github.com/en/rest/reference/orgs#get-an-organization)
67-
* [Pull request commits](https://docs.github.com/en/rest/reference/pulls#list-commits-on-a-pull-request)
68-
* [Tags](https://docs.github.com/en/rest/reference/repos#list-repository-tags)
69-
* [TeamMembers](https://docs.github.com/en/rest/teams/members#list-team-members)
70-
* [TeamMemberships](https://docs.github.com/en/rest/reference/teams#get-team-membership-for-a-user)
71-
* [Teams](https://docs.github.com/en/rest/reference/teams#list-teams)
72-
* [Users](https://docs.github.com/en/rest/reference/orgs#list-organization-members)
65+
- [Assignees](https://docs.github.com/en/rest/reference/issues#list-assignees)
66+
- [Branches](https://docs.github.com/en/rest/reference/repos#list-branches)
67+
- [Collaborators](https://docs.github.com/en/rest/reference/repos#list-repository-collaborators)
68+
- [Issue labels](https://docs.github.com/en/rest/issues/labels#list-labels-for-a-repository)
69+
- [Organizations](https://docs.github.com/en/rest/reference/orgs#get-an-organization)
70+
- [Pull request commits](https://docs.github.com/en/rest/reference/pulls#list-commits-on-a-pull-request)
71+
- [Tags](https://docs.github.com/en/rest/reference/repos#list-repository-tags)
72+
- [TeamMembers](https://docs.github.com/en/rest/teams/members#list-team-members)
73+
- [TeamMemberships](https://docs.github.com/en/rest/reference/teams#get-team-membership-for-a-user)
74+
- [Teams](https://docs.github.com/en/rest/reference/teams#list-teams)
75+
- [Users](https://docs.github.com/en/rest/reference/orgs#list-organization-members)
7376

7477
This connector outputs the following incremental streams:
7578

76-
* [Comments](https://docs.github.com/en/rest/reference/issues#list-issue-comments-for-a-repository)
77-
* [Commit comment reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-a-commit-comment)
78-
* [Commit comments](https://docs.github.com/en/rest/reference/repos#list-commit-comments-for-a-repository)
79-
* [Commits](https://docs.github.com/en/rest/reference/repos#list-commits)
80-
* [Deployments](https://docs.github.com/en/rest/reference/deployments#list-deployments)
81-
* [Events](https://docs.github.com/en/rest/reference/activity#list-repository-events)
82-
* [Issue comment reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-an-issue-comment)
83-
* [Issue events](https://docs.github.com/en/rest/reference/issues#list-issue-events-for-a-repository)
84-
* [Issue milestones](https://docs.github.com/en/rest/reference/issues#list-milestones)
85-
* [Issue reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-an-issue)
86-
* [Issues](https://docs.github.com/en/rest/reference/issues#list-repository-issues)
87-
* [Project cards](https://docs.github.com/en/rest/reference/projects#list-project-cards)
88-
* [Project columns](https://docs.github.com/en/rest/reference/projects#list-project-columns)
89-
* [Projects](https://docs.github.com/en/rest/reference/projects#list-repository-projects)
90-
* [Pull request comment reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment)
91-
* [Pull request stats](https://docs.github.com/en/rest/reference/pulls#get-a-pull-request)
92-
* [Pull requests](https://docs.github.com/en/rest/reference/pulls#list-pull-requests)
93-
* [Releases](https://docs.github.com/en/rest/reference/repos#list-releases)
94-
* [Repositories](https://docs.github.com/en/rest/reference/repos#list-organization-repositories)
95-
* [Review comments](https://docs.github.com/en/rest/reference/pulls#list-review-comments-in-a-repository)
96-
* [Reviews](https://docs.github.com/en/rest/reference/pulls#list-reviews-for-a-pull-request)
97-
* [Stargazers](https://docs.github.com/en/rest/reference/activity#list-stargazers)
98-
* [WorkflowRuns](https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository)
99-
* [Workflows](https://docs.github.com/en/rest/reference/actions#workflows)
79+
- [Comments](https://docs.github.com/en/rest/reference/issues#list-issue-comments-for-a-repository)
80+
- [Commit comment reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-a-commit-comment)
81+
- [Commit comments](https://docs.github.com/en/rest/reference/repos#list-commit-comments-for-a-repository)
82+
- [Commits](https://docs.github.com/en/rest/reference/repos#list-commits)
83+
- [Deployments](https://docs.github.com/en/rest/reference/deployments#list-deployments)
84+
- [Events](https://docs.github.com/en/rest/reference/activity#list-repository-events)
85+
- [Issue comment reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-an-issue-comment)
86+
- [Issue events](https://docs.github.com/en/rest/reference/issues#list-issue-events-for-a-repository)
87+
- [Issue milestones](https://docs.github.com/en/rest/reference/issues#list-milestones)
88+
- [Issue reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-an-issue)
89+
- [Issues](https://docs.github.com/en/rest/reference/issues#list-repository-issues)
90+
- [Project cards](https://docs.github.com/en/rest/reference/projects#list-project-cards)
91+
- [Project columns](https://docs.github.com/en/rest/reference/projects#list-project-columns)
92+
- [Projects](https://docs.github.com/en/rest/reference/projects#list-repository-projects)
93+
- [Pull request comment reactions](https://docs.github.com/en/rest/reference/reactions#list-reactions-for-a-pull-request-review-comment)
94+
- [Pull request stats](https://docs.github.com/en/rest/reference/pulls#get-a-pull-request)
95+
- [Pull requests](https://docs.github.com/en/rest/reference/pulls#list-pull-requests)
96+
- [Releases](https://docs.github.com/en/rest/reference/repos#list-releases)
97+
- [Repositories](https://docs.github.com/en/rest/reference/repos#list-organization-repositories)
98+
- [Review comments](https://docs.github.com/en/rest/reference/pulls#list-review-comments-in-a-repository)
99+
- [Reviews](https://docs.github.com/en/rest/reference/pulls#list-reviews-for-a-pull-request)
100+
- [Stargazers](https://docs.github.com/en/rest/reference/activity#list-stargazers)
101+
- [WorkflowRuns](https://docs.github.com/en/rest/actions/workflow-runs#list-workflow-runs-for-a-repository)
102+
- [Workflows](https://docs.github.com/en/rest/reference/actions#workflows)
100103

101104
### Notes
102105

103106
1. Only 4 streams \(`comments`, `commits`, `issues` and `review comments`\) from the above 24 incremental streams are pure incremental meaning that they:
104-
* read only new records;
105-
* output only new records.
107+
108+
- read only new records;
109+
- output only new records.
106110

107111
2. Streams `workflow_runs` and `worflow_jobs` is almost pure incremental:
108-
* read new records and some portion of old records (in past 30 days) [docs](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs);
109-
* the `workflow_jobs` depends on the `workflow_runs` to read the data, so they both follow the same logic [docs](https://docs.github.com/pt/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run);
110-
* output only new records.
112+
113+
- read new records and some portion of old records (in past 30 days) [docs](https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs);
114+
- the `workflow_jobs` depends on the `workflow_runs` to read the data, so they both follow the same logic [docs](https://docs.github.com/pt/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run);
115+
- output only new records.
111116

112117
3. Other 19 incremental streams are also incremental but with one difference, they:
113-
* read all records;
114-
* output only new records.
115-
Please, consider this behaviour when using those 19 incremental streams because it may affect you API call limits.
118+
119+
- read all records;
120+
- output only new records.
121+
Please, consider this behaviour when using those 19 incremental streams because it may affect you API call limits.
116122

117123
4. We are passing few parameters \(`since`, `sort` and `direction`\) to GitHub in order to filter records and sometimes for large streams specifying very distant `start_date` in the past may result in keep on getting error from GitHub instead of records \(respective `WARN` log message will be outputted\). In this case Specifying more recent `start_date` may help.
118-
**The "Start date" configuration option does not apply to the streams below, because the GitHub API does not include dates which can be used for filtering:**
119-
120-
* `assignees`
121-
* `branches`
122-
* `collaborators`
123-
* `issue_labels`
124-
* `organizations`
125-
* `pull_request_commits`
126-
* `pull_request_stats`
127-
* `repositories`
128-
* `tags`
129-
* `teams`
130-
* `users`
124+
**The "Start date" configuration option does not apply to the streams below, because the GitHub API does not include dates which can be used for filtering:**
125+
126+
- `assignees`
127+
- `branches`
128+
- `collaborators`
129+
- `issue_labels`
130+
- `organizations`
131+
- `pull_request_commits`
132+
- `pull_request_stats`
133+
- `repositories`
134+
- `tags`
135+
- `teams`
136+
- `users`
131137

132138
### Permissions and scopes
133139

134140
If you use OAuth authentication method, the oauth2.0 application requests the next list of [scopes](https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes): **repo**, **read:org**, **read:repo_hook**, **read:user**, **read:discussion**, **workflow**. For [personal access token](https://github.com/settings/tokens) it need to manually select needed scopes.
135141

136142
Your token should have at least the `repo` scope. Depending on which streams you want to sync, the user generating the token needs more permissions:
137143

138-
* For syncing Collaborators, the user which generates the personal access token must be a collaborator. To become a collaborator, they must be invited by an owner. If there are no collaborators, no records will be synced. Read more about access permissions [here](https://docs.github.com/en/get-started/learning-about-github/access-permissions-on-github).
139-
* Syncing [Teams](https://docs.github.com/en/organizations/organizing-members-into-teams/about-teams) is only available to authenticated members of a team's [organization](https://docs.github.com/en/rest/orgs). [Personal user accounts](https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts) and repositories belonging to them don't have access to Teams features. In this case no records will be synced.
140-
* To sync the Projects stream, the repository must have the Projects feature enabled.
144+
- For syncing Collaborators, the user which generates the personal access token must be a collaborator. To become a collaborator, they must be invited by an owner. If there are no collaborators, no records will be synced. Read more about access permissions [here](https://docs.github.com/en/get-started/learning-about-github/access-permissions-on-github).
145+
- Syncing [Teams](https://docs.github.com/en/organizations/organizing-members-into-teams/about-teams) is only available to authenticated members of a team's [organization](https://docs.github.com/en/rest/orgs). [Personal user accounts](https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts) and repositories belonging to them don't have access to Teams features. In this case no records will be synced.
146+
- To sync the Projects stream, the repository must have the Projects feature enabled.
141147

142148
### Performance considerations
143149

@@ -147,6 +153,7 @@ The GitHub connector should not run into GitHub API limitations under normal usa
147153

148154
| Version | Date | Pull Request | Subject |
149155
| :------ | :--------- | :---------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
156+
| 0.3.8 | 2022-11-10 | [19299](https://github.com/airbytehq/airbyte/pull/19299) | Fix events and workflow_runs datetimes |
150157
| 0.3.7 | 2022-10-20 | [18213](https://github.com/airbytehq/airbyte/pull/18213) | Skip retry on HTTP 200 |
151158
| 0.3.6 | 2022-10-11 | [17852](https://github.com/airbytehq/airbyte/pull/17852) | Use default behaviour, retry on 429 and all 5XX errors |
152159
| 0.3.5 | 2022-10-07 | [17715](https://github.com/airbytehq/airbyte/pull/17715) | Improve 502 handling for `comments` stream |
@@ -213,4 +220,3 @@ The GitHub connector should not run into GitHub API limitations under normal usa
213220
| 0.1.2 | 2021-07-13 | [4708](https://github.com/airbytehq/airbyte/pull/4708) | Fix bug with IssueEvents stream and add handling for rate limiting |
214221
| 0.1.1 | 2021-07-07 | [4590](https://github.com/airbytehq/airbyte/pull/4590) | Fix schema in the `pull_request` stream |
215222
| 0.1.0 | 2021-07-06 | [4174](https://github.com/airbytehq/airbyte/pull/4174) | New Source: GitHub |
216-

0 commit comments

Comments
 (0)