airbyte-source-github 2.1.14.dev202603041459__tar.gz → 2.1.15.dev202603131159__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.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/PKG-INFO +1 -1
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/pyproject.toml +1 -1
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/streams.py +5 -5
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/utils.py +25 -1
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/README.md +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/__init__.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/backoff_strategies.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/config_migrations.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/constants.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/errors_handlers.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/github_schema.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/graphql.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/run.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/assignees.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/branches.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/collaborators.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/comments.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/commit_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/commit_comments.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/commits.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/contributor_activity.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/deployments.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/events.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/issue_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/issue_events.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/issue_labels.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/issue_milestones.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/issue_reactions.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/issue_timeline_events.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/issues.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/organizations.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/project_cards.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/project_columns.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/projects.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/projects_v2.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/pull_request_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/pull_request_commits.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/pull_request_stats.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/pull_requests.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/releases.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/repositories.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/review_comments.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/reviews.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/events/comment.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/events/commented.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/events/committed.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/events/cross_referenced.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/events/reviewed.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/reaction.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/reactions.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/user.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/shared/user_graphql.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/stargazers.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/tags.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/team_members.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/team_memberships.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/teams.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/users.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/workflow_jobs.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/workflow_runs.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/schemas/workflows.json +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/source.py +0 -0
- {airbyte_source_github-2.1.14.dev202603041459 → airbyte_source_github-2.1.15.dev202603131159}/source_github/spec.json +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.
|
|
6
|
+
version = "2.1.15.dev.202603131159"
|
|
7
7
|
name = "airbyte-source-github"
|
|
8
8
|
description = "Source implementation for GitHub."
|
|
9
9
|
authors = [ "Airbyte <contact@airbyte.io>",]
|
|
@@ -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
|
-
|
|
193
|
+
internal_message = f"Stream: `{self.name}`, slice: `{stream_slice}`. {e}"
|
|
194
|
+
message = "Rate limit exceeded for all configured GitHub API tokens."
|
|
195
|
+
raise AirbyteTracedException(
|
|
196
|
+
internal_message=internal_message, message=message, failure_type=FailureType.transient_error
|
|
197
|
+
) from e
|
|
198
198
|
|
|
199
199
|
|
|
200
200
|
class GithubStream(GithubStreamABC):
|
|
@@ -170,6 +170,10 @@ 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
|
+
|
|
173
177
|
def process_token(self, current_token, count_attr, reset_attr):
|
|
174
178
|
if getattr(current_token, count_attr) > 0:
|
|
175
179
|
setattr(current_token, count_attr, getattr(current_token, count_attr) - 1)
|
|
@@ -177,10 +181,30 @@ class MultipleTokenAuthenticatorWithRateLimiter(AbstractHeaderAuthenticator):
|
|
|
177
181
|
elif all(getattr(x, count_attr) == 0 for x in self._tokens.values()):
|
|
178
182
|
min_time_to_wait = min((getattr(x, reset_attr) - ab_datetime_now()).total_seconds() for x in self._tokens.values())
|
|
179
183
|
if min_time_to_wait < self.max_time:
|
|
180
|
-
|
|
184
|
+
wait_time = max(min_time_to_wait, 0)
|
|
185
|
+
self._sleep_with_heartbeat(wait_time, count_attr)
|
|
181
186
|
self.check_all_tokens()
|
|
182
187
|
else:
|
|
183
188
|
raise GitHubAPILimitException(f"Rate limits for all tokens ({count_attr}) were reached")
|
|
184
189
|
else:
|
|
185
190
|
self.update_token()
|
|
186
191
|
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
|
|
File without changes
|