-
Notifications
You must be signed in to change notification settings - Fork 0
Add PR Files stream #6
Conversation
The sdk docs are not super clear about it, but basically, what it means from what I've understood:
|
As a side question, which maybe we should have looked at first, is there no way to get the same info as what you have, but on a repo level endpoint? Something like Also, I just realised that you opened this PR against our fork, but maybe worth opening a PR against the main repo, to also get feedback from the meltano team, they understand this tap structure (and the underlying sdk) much better than we do. |
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.
Looks fine, barring a few minor changes. Is there another endpoint to get commits that are not attached to a PR (with the same info, "list commits" does not have the number of changes for instance)
tap_github/streams.py
Outdated
|
||
name = "pull_request_files" | ||
path = "/repos/{org}/{repo}/pulls/{pull_number}/files" | ||
primary_keys = ["filename"] |
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.
I think this will cause problems, as filenames are most likely not going to be globally unique. This comment might be helpful.
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.
tap_github/streams.py
Outdated
primary_keys = ["filename"] | ||
parent_stream_type = PullRequestsStream | ||
ignore_parent_replication_key = False | ||
state_partitioning_keys = ["repo", "org"] |
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.
I think you want something like this, but not 100% sure how you get the pull_number
, you might need to add it to the record in post_process
.
state_partitioning_keys = ["repo", "org"] | |
state_partitioning_keys = ["repo", "org", "pull_number"] |
I tried looking thru the docs but couldn't find anything like you mentioned 😕 (primarily looked to see if we could get files from Repo and work out which PR it came from). We might be stuck with this approach, but do let me konw if you find something that might work. |
Opened on meltano's main |
Not sure what
state_partitioning_keys
is, hoping it's correct currently. Any ideas?