This block is capable of resolving and displaying pull request related data from the following GitHub API streams:
- Pull Requests with an EntityType with the name
GithubPullRequest - Reviews with an EntityType with the name
GithubReview - Issue Events with an EntityType
GithubIssueEvent
It's possible to download new data for the example graph by querying the GitHub API manually. An example of doing this using the GitHub CLI:
gh api \
-H "Accept: application/vnd.github+json" \
/repos/blockprotocol/blockprotocol/issues/ISSUE_NUMBER/events
gh api \
-H "Accept: application/vnd.github+json" \
/repos/blockprotocol/blockprotocol/pulls/PULL_NUMBER
gh api \
-H "Accept: application/vnd.github+json" \
/repos/blockprotocol/blockprotocol/pulls/PULL_NUMBER/reviewsThe output then needs to be modified to fit the specification. This can be done through any number of ways, a short Python example is as follows:
from pathlib import Path
import uuid
import json
def main():
contents = json.loads(Path("issue_events.json").read_text())
modified = []
for entry in contents:
modified.append({
"entityId": str(uuid.uuid4()),
"entityTypeId": "GithubIssueEventType",
"properties": entry
})
Path("ssue_events_updated.json").write_text(json.dumps(modified))
if __name__ == "__main__":
main()