Skip to content

Commit

Permalink
add setting
Browse files Browse the repository at this point in the history
  • Loading branch information
TrishGillett committed Sep 17, 2024
1 parent 99eaa57 commit d2da696
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tap_github/repository_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,17 @@ def get_url_params(
"""Return a dictionary of values to be used in URL parameterization."""
assert context is not None, f"Context cannot be empty for '{self.name}' stream."
params = super().get_url_params(context, next_page_token)
# Fetch all milestones, regardless of state (open, closed).
params["state"] = "all"

def get_state_config():
if (
"milestone_stream_params" in self.config
and "state" in self.config["milestone_stream_params"]
):
return self.config["milestone_stream_params"]["state"]
else:
return "open"

params["state"] = get_state_config()
return params

schema = th.PropertiesList(
Expand Down
13 changes: 13 additions & 0 deletions tap_github/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ def logger(cls) -> logging.Logger:
th.Property("repositories", th.ArrayType(th.StringType)),
th.Property("user_usernames", th.ArrayType(th.StringType)),
th.Property("user_ids", th.ArrayType(th.StringType)),
th.Property(
"milestone_stream_params",
th.ObjectType(
th.Property(
"state",
th.StringType,
description=(
"Configures which states are of interest. "
"Must be one of [open, closed, all], defaults to open."
),
),
),
),
th.Property("start_date", th.DateTimeType),
th.Property("stream_maps", th.ObjectType()),
th.Property("stream_map_config", th.ObjectType()),
Expand Down

0 comments on commit d2da696

Please sign in to comment.