From e09c683370798730409e4583d0b075511da8e41d Mon Sep 17 00:00:00 2001 From: Trish Gillett Date: Wed, 28 May 2025 21:35:16 -0400 Subject: [PATCH] Add contributors stream Co-authored-by: MindaugasN --- tap_github/repository_streams.py | 22 ++++++++++++++++++++++ tap_github/streams.py | 2 ++ 2 files changed, 24 insertions(+) diff --git a/tap_github/repository_streams.py b/tap_github/repository_streams.py index 4c0ef6ce..aca1c262 100644 --- a/tap_github/repository_streams.py +++ b/tap_github/repository_streams.py @@ -2703,3 +2703,25 @@ class DeploymentStatusesStream(GitHubRestStream): th.Property("environment_url", th.StringType), th.Property("log_url", th.StringType), ).to_dict() + + +class CustomPropertiesStream(GitHubRestStream): + """Defines 'custom_properties' stream.""" + + name = "custom_properties" + path = "/repos/{org}/{repo}/properties/values" + primary_keys: ClassVar[list[str]] = ["repo", "org", "property_name"] + replication_key = None + parent_stream_type = RepositoryStream + ignore_parent_replication_key = True + state_partitioning_keys: ClassVar[list[str]] = ["repo", "org"] + + schema = th.PropertiesList( + # Parent Keys + th.Property("repo", th.StringType), + th.Property("org", th.StringType), + th.Property("repo_id", th.IntegerType), + # Custom Property Keys + th.Property("property_name", th.StringType), + th.Property("value", th.StringType), + ).to_dict() diff --git a/tap_github/streams.py b/tap_github/streams.py index 33090ff9..a8b362c9 100644 --- a/tap_github/streams.py +++ b/tap_github/streams.py @@ -20,6 +20,7 @@ CommitsStream, CommunityProfileStream, ContributorsStream, + CustomPropertiesStream, DependenciesStream, DependentsStream, DeploymentsStream, @@ -130,6 +131,7 @@ def __init__(self, valid_queries: set[str], streams: list[type[Stream]]) -> None ORGANIZATIONS = ( {"organizations"}, [ + CustomPropertiesStream, OrganizationStream, OrganizationMembersStream, TeamMembersStream,