airbyte-source-github 2.1.27__tar.gz → 2.1.28__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.
Files changed (63) hide show
  1. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/PKG-INFO +1 -1
  2. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/pyproject.toml +1 -1
  3. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/errors_handlers.py +20 -3
  4. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/streams.py +22 -2
  5. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/README.md +0 -0
  6. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/__init__.py +0 -0
  7. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/backoff_strategies.py +0 -0
  8. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/config_migrations.py +0 -0
  9. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/constants.py +0 -0
  10. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/github_schema.py +0 -0
  11. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/graphql.py +0 -0
  12. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/run.py +0 -0
  13. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/assignees.json +0 -0
  14. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/branches.json +0 -0
  15. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/collaborators.json +0 -0
  16. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/comments.json +0 -0
  17. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/commit_comment_reactions.json +0 -0
  18. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/commit_comments.json +0 -0
  19. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/commits.json +0 -0
  20. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/contributor_activity.json +0 -0
  21. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/deployments.json +0 -0
  22. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/events.json +0 -0
  23. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/issue_comment_reactions.json +0 -0
  24. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/issue_events.json +0 -0
  25. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/issue_labels.json +0 -0
  26. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/issue_milestones.json +0 -0
  27. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/issue_reactions.json +0 -0
  28. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/issue_timeline_events.json +0 -0
  29. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/issues.json +0 -0
  30. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/organizations.json +0 -0
  31. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/project_cards.json +0 -0
  32. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/project_columns.json +0 -0
  33. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/projects.json +0 -0
  34. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/projects_v2.json +0 -0
  35. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/pull_request_comment_reactions.json +0 -0
  36. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/pull_request_commits.json +0 -0
  37. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/pull_request_stats.json +0 -0
  38. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/pull_requests.json +0 -0
  39. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/releases.json +0 -0
  40. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/repositories.json +0 -0
  41. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/review_comments.json +0 -0
  42. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/reviews.json +0 -0
  43. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/events/comment.json +0 -0
  44. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/events/commented.json +0 -0
  45. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/events/committed.json +0 -0
  46. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/events/cross_referenced.json +0 -0
  47. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/events/reviewed.json +0 -0
  48. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/reaction.json +0 -0
  49. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/reactions.json +0 -0
  50. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/user.json +0 -0
  51. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/shared/user_graphql.json +0 -0
  52. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/stargazers.json +0 -0
  53. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/tags.json +0 -0
  54. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/team_members.json +0 -0
  55. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/team_memberships.json +0 -0
  56. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/teams.json +0 -0
  57. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/users.json +0 -0
  58. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/workflow_jobs.json +0 -0
  59. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/workflow_runs.json +0 -0
  60. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/schemas/workflows.json +0 -0
  61. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/source.py +0 -0
  62. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/spec.json +0 -0
  63. {airbyte_source_github-2.1.27 → airbyte_source_github-2.1.28}/source_github/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-source-github
3
- Version: 2.1.27
3
+ Version: 2.1.28
4
4
  Summary: Source implementation for GitHub.
5
5
  Home-page: https://airbyte.com
6
6
  License: ELv2
@@ -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.27"
6
+ version = "2.1.28"
7
7
  name = "airbyte-source-github"
8
8
  description = "Source implementation for GitHub."
9
9
  authors = [ "Airbyte <contact@airbyte.io>",]
@@ -199,11 +199,25 @@ class GitHubGraphQLErrorHandler(GithubStreamABCErrorHandler):
199
199
  def interpret_response(self, response_or_exception: Optional[Union[requests.Response, Exception]] = None) -> ErrorResolution:
200
200
  if isinstance(response_or_exception, requests.Response):
201
201
  if response_or_exception.status_code in (requests.codes.BAD_GATEWAY, requests.codes.GATEWAY_TIMEOUT):
202
- self.stream.page_size = int(self.stream.page_size / 2)
202
+ # Halve the page size on every 502/504 to reduce GraphQL query cost,
203
+ # but never let it drop below 1 — a page_size of 0 would request no
204
+ # records and cause infinite paging.
205
+ previous_page_size = self.stream.page_size
206
+ self.stream.page_size = max(1, int(self.stream.page_size / 2))
207
+ self._logger.info(
208
+ "GitHub GraphQL endpoint returned HTTP %s for stream `%s`; reducing GraphQL page_size from %s to %s and retrying.",
209
+ response_or_exception.status_code,
210
+ self.stream.name,
211
+ previous_page_size,
212
+ self.stream.page_size,
213
+ )
203
214
  return ErrorResolution(
204
215
  response_action=ResponseAction.RETRY,
205
216
  failure_type=FailureType.transient_error,
206
- error_message=f"Response status code: {response_or_exception.status_code}. Retrying...",
217
+ error_message=(
218
+ f"GitHub GraphQL endpoint returned HTTP {response_or_exception.status_code} "
219
+ f"for stream `{self.stream.name}`. Reducing GraphQL page size and retrying."
220
+ ),
207
221
  )
208
222
 
209
223
  self.stream.page_size = (
@@ -214,7 +228,10 @@ class GitHubGraphQLErrorHandler(GithubStreamABCErrorHandler):
214
228
  return ErrorResolution(
215
229
  response_action=ResponseAction.RETRY,
216
230
  failure_type=FailureType.transient_error,
217
- error_message=f"Response status code: {response_or_exception.status_code}. Retrying...",
231
+ error_message=(
232
+ f"GitHub GraphQL endpoint returned errors in the response body "
233
+ f"for stream `{self.stream.name}` (HTTP {response_or_exception.status_code}). Retrying."
234
+ ),
218
235
  )
219
236
 
220
237
  return super().interpret_response(response_or_exception)
@@ -201,6 +201,12 @@ class GithubStreamABC(HttpStream, ABC):
201
201
  f"GitHub returned HTTP 502 Bad Gateway for stream `{self.name}` after exhausting retries. "
202
202
  f"This is usually transient — the next sync attempt should succeed."
203
203
  )
204
+ elif e._exception.response.status_code == requests.codes.GATEWAY_TIMEOUT:
205
+ error_msg = (
206
+ f"GitHub returned HTTP 504 Gateway Timeout for stream `{self.name}` after exhausting retries "
207
+ f"and reducing the GraphQL page size. The next sync attempt should succeed; "
208
+ f'if 504s persist, lower "Page size for large streams" in the source configuration.'
209
+ )
204
210
  else:
205
211
  self.logger.error(f"Undefined error while reading records: {e._exception.response.text}")
206
212
  raise e
@@ -232,11 +238,15 @@ class GithubStream(GithubStreamABC):
232
238
  def get_error_display_message(self, exception: BaseException) -> Optional[str]:
233
239
  if (
234
240
  isinstance(exception, DefaultBackoffException)
235
- and exception.response.status_code == requests.codes.BAD_GATEWAY
241
+ and exception.response.status_code in (requests.codes.BAD_GATEWAY, requests.codes.GATEWAY_TIMEOUT)
236
242
  and self.large_stream
237
243
  and self.page_size > 1
238
244
  ):
239
- return f'Please try to decrease the "Page size for large streams" below {self.page_size}. The stream "{self.name}" is a large stream, such streams can fail with 502 for high "page_size" values.'
245
+ return (
246
+ f'Please try to decrease the "Page size for large streams" below {self.page_size}. '
247
+ f'The stream "{self.name}" is a large stream, such streams can fail with '
248
+ f'{exception.response.status_code} for high "page_size" values.'
249
+ )
240
250
  return super().get_error_display_message(exception)
241
251
 
242
252
  def transform(self, record: MutableMapping[str, Any], stream_slice: Mapping[str, Any]) -> MutableMapping[str, Any]:
@@ -850,6 +860,16 @@ class Releases(SemiIncrementalMixin, GitHubGraphQLStream):
850
860
 
851
861
  cursor_field = "created_at"
852
862
  is_sorted = "asc"
863
+ # The Releases GraphQL query is high-cost on the server side: every node
864
+ # materializes `description` and `descriptionHTML`, which forces GitHub
865
+ # to render each release body to HTML. On repositories with long release
866
+ # notes, a page_size of 100 pushes the resolver past its internal 10s
867
+ # deadline and returns 504 Gateway Timeout (reproduced deterministically
868
+ # against nodejs/node: first=100 -> 504 in ~11s; first=10 -> 200 in ~3s).
869
+ # `releaseAssets` / `reactionGroups` / `mentions` are NOT the cost driver
870
+ # — stripping them does not fix the timeout, only lowering `first` does.
871
+ # Mark as large_stream so it picks up the smaller default page size.
872
+ large_stream = True
853
873
 
854
874
  GRAPHQL_REACTION_TO_REST = {
855
875
  "THUMBS_UP": "plus_one",