-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing endpoints available in singer-io/tap-github #93
Conversation
@Ry-DS make sure to have a look @edgarrmondragon's PR #31 to avoid duplication |
Conversions using regex patterns in description. Some need manual fixes such as arrays, nested objects, and Click to expand// projects
{
th.Property("owner_url", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("columns_url", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("name", th.StringType),
th.Property("body", th.StringType),
th.Property("number", th.IntegerType),
th.Property("state", th.StringType),
th.Property("creator", th.ObjectType(
th.Property("login", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("avatar_url", th.StringType),
th.Property("gravatar_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("followers_url", th.StringType),
th.Property("following_url", th.StringType),
th.Property("gists_url", th.StringType),
th.Property("starred_url", th.StringType),
th.Property("subscriptions_url", th.StringType),
th.Property("organizations_url", th.StringType),
th.Property("repos_url", th.StringType),
th.Property("events_url", th.StringType),
th.Property("received_events_url", th.StringType),
th.Property("type", th.StringType),
th.Property("site_admin", th.BooleanType)
),),
th.Property("created_at", th.StringType),
th.Property("updated_at", th.StringType)
}
// project cards
{
th.Property("url", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("note", th.StringType),
th.Property("creator", th.ObjectType(
th.Property("login", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("avatar_url", th.StringType),
th.Property("gravatar_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("followers_url", th.StringType),
th.Property("following_url", th.StringType),
th.Property("gists_url", th.StringType),
th.Property("starred_url", th.StringType),
th.Property("subscriptions_url", th.StringType),
th.Property("organizations_url", th.StringType),
th.Property("repos_url", th.StringType),
th.Property("events_url", th.StringType),
th.Property("received_events_url", th.StringType),
th.Property("type", th.StringType),
th.Property("site_admin", th.BooleanType)
),),
th.Property("created_at", th.StringType),
th.Property("updated_at", th.StringType),
th.Property("archived", th.BooleanType),
th.Property("column_url", th.StringType),
th.Property("content_url", th.StringType),
th.Property("project_url", th.StringType)
}
// project columns
{
th.Property("url", th.StringType),
th.Property("project_url", th.StringType),
th.Property("cards_url", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("name", th.StringType),
th.Property("created_at", th.StringType),
th.Property("updated_at", th.StringType)
}
// pr commits
{
th.Property("url", th.StringType),
th.Property("sha", th.StringType),
th.Property("node_id", th.StringType),
th.Property("html_url", th.StringType),
th.Property("comments_url", th.StringType),
th.Property("commit", th.ObjectType(
th.Property("url", th.StringType),
th.Property("author", th.ObjectType(
th.Property("name", th.StringType),
th.Property("email", th.StringType),
th.Property("date", th.StringType)
),),
th.Property("committer", th.ObjectType(
th.Property("name", th.StringType),
th.Property("email", th.StringType),
th.Property("date", th.StringType)
),),
th.Property("message", th.StringType),
th.Property("tree", th.ObjectType(
th.Property("url", th.StringType),
th.Property("sha", th.StringType)
),),
th.Property("comment_count", th.IntegerType),
th.Property("verification", th.ObjectType(
th.Property("verified", th.BooleanType),
th.Property("reason", th.StringType),
"signature": null,
"payload": null
),),
),),
th.Property("author", th.ObjectType(
th.Property("login", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("avatar_url", th.StringType),
th.Property("gravatar_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("followers_url", th.StringType),
th.Property("following_url", th.StringType),
th.Property("gists_url", th.StringType),
th.Property("starred_url", th.StringType),
th.Property("subscriptions_url", th.StringType),
th.Property("organizations_url", th.StringType),
th.Property("repos_url", th.StringType),
th.Property("events_url", th.StringType),
th.Property("received_events_url", th.StringType),
th.Property("type", th.StringType),
th.Property("site_admin", th.BooleanType)
),),
th.Property("committer", th.ObjectType(
th.Property("login", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("avatar_url", th.StringType),
th.Property("gravatar_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("followers_url", th.StringType),
th.Property("following_url", th.StringType),
th.Property("gists_url", th.StringType),
th.Property("starred_url", th.StringType),
th.Property("subscriptions_url", th.StringType),
th.Property("organizations_url", th.StringType),
th.Property("repos_url", th.StringType),
th.Property("events_url", th.StringType),
th.Property("received_events_url", th.StringType),
th.Property("type", th.StringType),
th.Property("site_admin", th.BooleanType)
),),
"parents": [
{
th.Property("url", th.StringType),
th.Property("sha", th.StringType)
}
]
}
// releases
{
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("assets_url", th.StringType),
th.Property("upload_url", th.StringType),
th.Property("tarball_url", th.StringType),
th.Property("zipball_url", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("tag_name", th.StringType),
th.Property("target_commitish", th.StringType),
th.Property("name", th.StringType),
th.Property("body", th.StringType),
th.Property("draft", th.BooleanType),
th.Property("prerelease", th.BooleanType),
th.Property("created_at", th.StringType),
th.Property("published_at", th.StringType),
th.Property("author", th.ObjectType(
th.Property("login", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("avatar_url", th.StringType),
th.Property("gravatar_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("followers_url", th.StringType),
th.Property("following_url", th.StringType),
th.Property("gists_url", th.StringType),
th.Property("starred_url", th.StringType),
th.Property("subscriptions_url", th.StringType),
th.Property("organizations_url", th.StringType),
th.Property("repos_url", th.StringType),
th.Property("events_url", th.StringType),
th.Property("received_events_url", th.StringType),
th.Property("type", th.StringType),
th.Property("site_admin", th.BooleanType)
),),
"assets": [
{
th.Property("url", th.StringType),
th.Property("browser_download_url", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("name", th.StringType),
th.Property("label", th.StringType),
th.Property("state", th.StringType),
th.Property("content_type", th.StringType),
th.Property("size", th.IntegerType),
th.Property("download_count", th.IntegerType),
th.Property("created_at", th.StringType),
th.Property("updated_at", th.StringType),
th.Property("uploader", th.ObjectType(
th.Property("login", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("avatar_url", th.StringType),
th.Property("gravatar_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("followers_url", th.StringType),
th.Property("following_url", th.StringType),
th.Property("gists_url", th.StringType),
th.Property("starred_url", th.StringType),
th.Property("subscriptions_url", th.StringType),
th.Property("organizations_url", th.StringType),
th.Property("repos_url", th.StringType),
th.Property("events_url", th.StringType),
th.Property("received_events_url", th.StringType),
th.Property("type", th.StringType),
th.Property("site_admin", th.BooleanType)
),),
}
]
}
// teams
{
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("name", th.StringType),
th.Property("slug", th.StringType),
th.Property("description", th.StringType),
th.Property("privacy", th.StringType),
th.Property("permission", th.StringType),
th.Property("members_url", th.StringType),
th.Property("repositories_url", th.StringType),
"parent": null
}
// team members
{
th.Property("login", th.StringType),
th.Property("id", th.IntegerType),
th.Property("node_id", th.StringType),
th.Property("avatar_url", th.StringType),
th.Property("gravatar_id", th.StringType),
th.Property("url", th.StringType),
th.Property("html_url", th.StringType),
th.Property("followers_url", th.StringType),
th.Property("following_url", th.StringType),
th.Property("gists_url", th.StringType),
th.Property("starred_url", th.StringType),
th.Property("subscriptions_url", th.StringType),
th.Property("organizations_url", th.StringType),
th.Property("repos_url", th.StringType),
th.Property("events_url", th.StringType),
th.Property("received_events_url", th.StringType),
th.Property("type", th.StringType),
th.Property("site_admin", th.BooleanType)
}
// team roles
{
th.Property("url", th.StringType),
th.Property("role", th.StringType),
th.Property("state", th.StringType)
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a lot! I think there's not much missing, but some changes are probably required for the tap to work.
I've only written some of the comments once to avoid repeating the same thing over and over, but they might apply to multiple streams.
I've logged an issue in the SDK to keep this discussion going. For now, I agree it sounds like preserving as a string type is the "safe" option. |
In our use-case, we pipe the output from this tap into target-postgres which actually converts |
# Conflicts: # tap_github/repository_streams.py # tap_github/tap.py
Closes #83
TODO:
Convert Reviews and Pull Request Commits to GraphQL streams (they are too slow with rest since PR is the parent)See Add missing endpoints available in singer-io/tap-github #93 (comment)Add pagination for the Graphql client #89Decided that pagination of the graphql api is not worthwhile to explore (see above comment)Parent keys are missing in the new streams. Is this ok?Decided to add themignore_parent_replication_key
to true unless sure if notStreams:
This PR involved a lot of json to propertylist conversions. Here are some regex conversion expressions to make things easier:
"(\w+)": .+"
th.Property("$1", th.StringType)
"(\w+)": \d+
th.Property("$1", th.IntegerType)
"(\w+)": (true|false)+
th.Property("$1", th.BooleanType)
"(\w+)": \{(.|\n+?)\},
th.Property("$1", th.ObjectType($2),),
Maybe we could standardise the above regex queries and document them in the README?
Discussion points:
singer_sdk.exceptions.FatalAPIError: 403 Client Error: Forbidden for path: /repos/octocat/Hello-World/collaborators