airbyte-source-github 2.1.8__tar.gz → 2.2.0.dev202601122028__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.8 → airbyte_source_github-2.2.0.dev202601122028}/PKG-INFO +1 -1
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/pyproject.toml +1 -1
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/source.py +2 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/streams.py +71 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/README.md +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/__init__.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/backoff_strategies.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/config_migrations.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/constants.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/errors_handlers.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/github_schema.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/graphql.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/run.py +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/assignees.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/branches.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/collaborators.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/comments.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/commit_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/commit_comments.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/commits.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/contributor_activity.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/deployments.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/events.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/issue_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/issue_events.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/issue_labels.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/issue_milestones.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/issue_reactions.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/issue_timeline_events.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/issues.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/organizations.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/project_cards.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/project_columns.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/projects.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/projects_v2.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/pull_request_comment_reactions.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/pull_request_commits.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/pull_request_stats.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/pull_requests.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/releases.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/repositories.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/review_comments.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/reviews.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/events/comment.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/events/commented.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/events/committed.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/events/cross_referenced.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/events/reviewed.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/reaction.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/reactions.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/user.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/shared/user_graphql.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/stargazers.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/tags.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/team_members.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/team_memberships.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/teams.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/users.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/workflow_jobs.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/workflow_runs.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/schemas/workflows.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/spec.json +0 -0
- {airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/utils.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.
|
|
6
|
+
version = "2.2.0.dev.202601122028"
|
|
7
7
|
name = "airbyte-source-github"
|
|
8
8
|
description = "Source implementation for GitHub."
|
|
9
9
|
authors = [ "Airbyte <contact@airbyte.io>",]
|
{airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/source.py
RENAMED
|
@@ -54,6 +54,7 @@ from .streams import (
|
|
|
54
54
|
Teams,
|
|
55
55
|
Users,
|
|
56
56
|
WorkflowJobs,
|
|
57
|
+
WorkflowRunAttempts,
|
|
57
58
|
WorkflowRuns,
|
|
58
59
|
Workflows,
|
|
59
60
|
)
|
|
@@ -309,5 +310,6 @@ class SourceGithub(AbstractSource):
|
|
|
309
310
|
Workflows(**repository_args_with_start_date),
|
|
310
311
|
workflow_runs_stream,
|
|
311
312
|
WorkflowJobs(parent=workflow_runs_stream, **repository_args_with_start_date),
|
|
313
|
+
WorkflowRunAttempts(parent=workflow_runs_stream, **repository_args_with_start_date),
|
|
312
314
|
TeamMemberships(parent=team_members_stream, **repository_args),
|
|
313
315
|
]
|
{airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/streams.py
RENAMED
|
@@ -1506,6 +1506,77 @@ class WorkflowRuns(SemiIncrementalMixin, GithubStream):
|
|
|
1506
1506
|
self.state = new_state
|
|
1507
1507
|
|
|
1508
1508
|
|
|
1509
|
+
class WorkflowRunAttempts(SemiIncrementalMixin, GithubStream):
|
|
1510
|
+
"""
|
|
1511
|
+
Get all workflow run attempts for a GitHub repository.
|
|
1512
|
+
This stream fetches every attempt of each workflow run, allowing users to track re-runs.
|
|
1513
|
+
API documentation: https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run-attempt
|
|
1514
|
+
"""
|
|
1515
|
+
|
|
1516
|
+
primary_key = ["id", "run_attempt"]
|
|
1517
|
+
|
|
1518
|
+
# key for accessing slice value from record
|
|
1519
|
+
record_slice_key = ["repository", "full_name"]
|
|
1520
|
+
|
|
1521
|
+
# https://docs.github.com/en/actions/managing-workflow-runs/re-running-workflows-and-jobs
|
|
1522
|
+
re_run_period = 32 # days
|
|
1523
|
+
|
|
1524
|
+
def __init__(self, parent: WorkflowRuns, **kwargs):
|
|
1525
|
+
super().__init__(**kwargs)
|
|
1526
|
+
self.parent = parent
|
|
1527
|
+
|
|
1528
|
+
def stream_slices(
|
|
1529
|
+
self, sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
|
|
1530
|
+
) -> Iterable[Optional[Mapping[str, Any]]]:
|
|
1531
|
+
# First get all workflow runs, then for each run we'll fetch all attempts
|
|
1532
|
+
parent_stream_slices = self.parent.stream_slices(
|
|
1533
|
+
sync_mode=SyncMode.full_refresh, cursor_field=cursor_field, stream_state=stream_state
|
|
1534
|
+
)
|
|
1535
|
+
for stream_slice in parent_stream_slices:
|
|
1536
|
+
parent_records = self.parent.read_records(
|
|
1537
|
+
sync_mode=SyncMode.full_refresh, cursor_field=cursor_field, stream_slice=stream_slice, stream_state=stream_state
|
|
1538
|
+
)
|
|
1539
|
+
for parent_record in parent_records:
|
|
1540
|
+
# For each workflow run, create slices for each attempt
|
|
1541
|
+
run_id = parent_record["id"]
|
|
1542
|
+
run_attempt = parent_record["run_attempt"] # This tells us the max attempt number
|
|
1543
|
+
for attempt_num in range(1, run_attempt + 1):
|
|
1544
|
+
yield {"repository": stream_slice["repository"], "run_id": run_id, "attempt_number": attempt_num}
|
|
1545
|
+
|
|
1546
|
+
def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> str:
|
|
1547
|
+
return f"repos/{stream_slice['repository']}/actions/runs/{stream_slice['run_id']}/attempts/{stream_slice['attempt_number']}"
|
|
1548
|
+
|
|
1549
|
+
def parse_response(self, response: requests.Response, stream_slice: Mapping[str, Any] = None, **kwargs) -> Iterable[Mapping]:
|
|
1550
|
+
# The attempts endpoint returns a single workflow run object, not an array
|
|
1551
|
+
record = response.json()
|
|
1552
|
+
yield record
|
|
1553
|
+
|
|
1554
|
+
def read_records(
|
|
1555
|
+
self,
|
|
1556
|
+
sync_mode: SyncMode,
|
|
1557
|
+
cursor_field: List[str] = None,
|
|
1558
|
+
stream_slice: Mapping[str, Any] = None,
|
|
1559
|
+
stream_state: Mapping[str, Any] = None,
|
|
1560
|
+
) -> Iterable[Mapping[str, Any]]:
|
|
1561
|
+
# Similar logic to WorkflowRuns for handling incremental sync with re-run period
|
|
1562
|
+
start_point = self.get_starting_point(stream_state=stream_state, stream_slice=stream_slice)
|
|
1563
|
+
break_point = None
|
|
1564
|
+
new_state = self.state
|
|
1565
|
+
if start_point:
|
|
1566
|
+
break_point = (ab_datetime_parse(start_point) - timedelta(days=self.re_run_period)).isoformat()
|
|
1567
|
+
for record in super(SemiIncrementalMixin, self).read_records(
|
|
1568
|
+
sync_mode=sync_mode, cursor_field=cursor_field, stream_slice=stream_slice, stream_state=stream_state
|
|
1569
|
+
):
|
|
1570
|
+
cursor_value = record[self.cursor_field]
|
|
1571
|
+
created_at = record["created_at"]
|
|
1572
|
+
if not start_point or cursor_value > start_point:
|
|
1573
|
+
yield record
|
|
1574
|
+
new_state = self._get_updated_state(new_state, record)
|
|
1575
|
+
if break_point and created_at < break_point:
|
|
1576
|
+
break
|
|
1577
|
+
self.state = new_state
|
|
1578
|
+
|
|
1579
|
+
|
|
1509
1580
|
class WorkflowJobs(SemiIncrementalMixin, GithubStream):
|
|
1510
1581
|
"""
|
|
1511
1582
|
Get all workflow jobs for a workflow run
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/graphql.py
RENAMED
|
File without changes
|
{airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/run.py
RENAMED
|
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
|
{airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/spec.json
RENAMED
|
File without changes
|
{airbyte_source_github-2.1.8 → airbyte_source_github-2.2.0.dev202601122028}/source_github/utils.py
RENAMED
|
File without changes
|