airbyte-source-github 2.1.15.dev202603131159__tar.gz → 2.1.15.dev202603182232__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/PKG-INFO +1 -1
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/pyproject.toml +1 -1
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/spec.json +30 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/streams.py +5 -5
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/utils.py +1 -25
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/README.md +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/__init__.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/backoff_strategies.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/config_migrations.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/constants.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/errors_handlers.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/github_schema.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/graphql.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/run.py +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/assignees.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/branches.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/collaborators.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/comments.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/commit_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/commit_comments.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/commits.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/contributor_activity.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/deployments.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/events.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/issue_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/issue_events.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/issue_labels.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/issue_milestones.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/issue_reactions.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/issue_timeline_events.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/issues.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/organizations.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/project_cards.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/project_columns.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/projects.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/projects_v2.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/pull_request_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/pull_request_commits.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/pull_request_stats.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/pull_requests.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/releases.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/repositories.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/review_comments.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/reviews.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/events/comment.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/events/commented.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/events/committed.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/events/cross_referenced.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/events/reviewed.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/reaction.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/reactions.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/user.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/shared/user_graphql.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/stargazers.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/tags.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/team_members.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/team_memberships.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/teams.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/users.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/workflow_jobs.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/workflow_runs.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/schemas/workflows.json +0 -0
- {airbyte_source_github-2.1.15.dev202603131159 → airbyte_source_github-2.1.15.dev202603182232}/source_github/source.py +0 -0
|
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
|
|
|
3
3
|
build-backend = "poetry.core.masonry.api"
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
|
-
version = "2.1.15.dev.
|
|
6
|
+
version = "2.1.15.dev.202603182232"
|
|
7
7
|
name = "airbyte-source-github"
|
|
8
8
|
description = "Source implementation for GitHub."
|
|
9
9
|
authors = [ "Airbyte <contact@airbyte.io>",]
|
|
@@ -149,6 +149,36 @@
|
|
|
149
149
|
"predicate_key": ["credentials", "option_title"],
|
|
150
150
|
"predicate_value": "OAuth Credentials",
|
|
151
151
|
"oauth_config_specification": {
|
|
152
|
+
"oauth_connector_input_specification": {
|
|
153
|
+
"type": "object",
|
|
154
|
+
"additionalProperties": false,
|
|
155
|
+
"properties": {
|
|
156
|
+
"consent_url": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"const": "https://github.com/login/oauth/authorize?client_id={{client_id_value}}&redirect_uri={{redirect_uri_value}}&state={{state_value}}&scope={{scopes_value | urlencode}}"
|
|
159
|
+
},
|
|
160
|
+
"access_token_url": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"const": "https://github.com/login/oauth/access_token"
|
|
163
|
+
},
|
|
164
|
+
"scopes": {
|
|
165
|
+
"type": "array",
|
|
166
|
+
"const": [
|
|
167
|
+
{"scope": "repo"},
|
|
168
|
+
{"scope": "read:org"},
|
|
169
|
+
{"scope": "read:repo_hook"},
|
|
170
|
+
{"scope": "read:user"},
|
|
171
|
+
{"scope": "read:project"},
|
|
172
|
+
{"scope": "read:discussion"},
|
|
173
|
+
{"scope": "workflow"}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
"extract_output": {
|
|
177
|
+
"type": "array",
|
|
178
|
+
"const": ["access_token"]
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
152
182
|
"complete_oauth_output_specification": {
|
|
153
183
|
"type": "object",
|
|
154
184
|
"additionalProperties": false,
|
|
@@ -190,11 +190,11 @@ class GithubStreamABC(HttpStream, ABC):
|
|
|
190
190
|
|
|
191
191
|
self.logger.warning(error_msg)
|
|
192
192
|
except GitHubAPILimitException as e:
|
|
193
|
-
internal_message =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
) from e
|
|
193
|
+
internal_message = (
|
|
194
|
+
f"Stream: `{self.name}`, slice: `{stream_slice}`. Limits for all provided tokens are reached, please try again later"
|
|
195
|
+
)
|
|
196
|
+
message = "Rate Limits for all provided tokens are reached. For more information please refer to documentation: https://docs.airbyte.com/integrations/sources/github#limitations--troubleshooting"
|
|
197
|
+
raise AirbyteTracedException(internal_message=internal_message, message=message, failure_type=FailureType.config_error) from e
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
class GithubStream(GithubStreamABC):
|
|
@@ -170,10 +170,6 @@ class MultipleTokenAuthenticatorWithRateLimiter(AbstractHeaderAuthenticator):
|
|
|
170
170
|
for token in self._tokens:
|
|
171
171
|
self._check_token_limits(token)
|
|
172
172
|
|
|
173
|
-
# Maximum duration for a single sleep interval when waiting for rate limit reset.
|
|
174
|
-
# Kept short to allow the platform's heartbeat mechanism to detect the connector is still alive.
|
|
175
|
-
SLEEP_INTERVAL_SECONDS = 60
|
|
176
|
-
|
|
177
173
|
def process_token(self, current_token, count_attr, reset_attr):
|
|
178
174
|
if getattr(current_token, count_attr) > 0:
|
|
179
175
|
setattr(current_token, count_attr, getattr(current_token, count_attr) - 1)
|
|
@@ -181,30 +177,10 @@ class MultipleTokenAuthenticatorWithRateLimiter(AbstractHeaderAuthenticator):
|
|
|
181
177
|
elif all(getattr(x, count_attr) == 0 for x in self._tokens.values()):
|
|
182
178
|
min_time_to_wait = min((getattr(x, reset_attr) - ab_datetime_now()).total_seconds() for x in self._tokens.values())
|
|
183
179
|
if min_time_to_wait < self.max_time:
|
|
184
|
-
|
|
185
|
-
self._sleep_with_heartbeat(wait_time, count_attr)
|
|
180
|
+
time.sleep(min_time_to_wait if min_time_to_wait > 0 else 0)
|
|
186
181
|
self.check_all_tokens()
|
|
187
182
|
else:
|
|
188
183
|
raise GitHubAPILimitException(f"Rate limits for all tokens ({count_attr}) were reached")
|
|
189
184
|
else:
|
|
190
185
|
self.update_token()
|
|
191
186
|
return False
|
|
192
|
-
|
|
193
|
-
def _sleep_with_heartbeat(self, total_wait: float, count_attr: str) -> None:
|
|
194
|
-
"""Sleep in small intervals, logging periodically so the platform heartbeat sees activity."""
|
|
195
|
-
remaining = total_wait
|
|
196
|
-
self._logger.info(
|
|
197
|
-
"Rate limit reached for all tokens (%s). Waiting %.0f seconds for reset.",
|
|
198
|
-
count_attr,
|
|
199
|
-
total_wait,
|
|
200
|
-
)
|
|
201
|
-
while remaining > 0:
|
|
202
|
-
interval = min(remaining, self.SLEEP_INTERVAL_SECONDS)
|
|
203
|
-
time.sleep(interval)
|
|
204
|
-
remaining -= interval
|
|
205
|
-
if remaining > 0:
|
|
206
|
-
self._logger.info(
|
|
207
|
-
"Still waiting for rate limit reset (%s). %.0f seconds remaining.",
|
|
208
|
-
count_attr,
|
|
209
|
-
remaining,
|
|
210
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|