Skip to content

Instantly share code, notes, and snippets.

@dahlbyk
Last active July 3, 2024 07:19
Show Gist options
  • Save dahlbyk/229f6ee762e2b0b45f3add7c2459e64a to your computer and use it in GitHub Desktop.
Save dahlbyk/229f6ee762e2b0b45f3add7c2459e64a to your computer and use it in GitHub Desktop.
GitHub API Comparison: Issue Events vs Issue Timeline

GitHub API Comparison: Issue Events vs Issue Timeline

Payload Attributes

events timeline Attribute Description
id The Integer ID of the event.
url The API URL for fetching the event.
actor The User object that generated the event.
commit_id The String SHA of a commit that referenced this Issue.
✔* commit_url The GitHub API link to a commit that referenced this Issue (*undocumented)
event Identifies the actual type of Event that occurred.
created_at The timestamp indicating when the event occurred.
label The Label object including name and color attributes. Only provided for labeled and unlabeled events.
assignee The User object which was assigned to (or unassigned from) this Issue. Only provided for assigned and unassigned events.
assigner The User object that performed the assignment (or unassignment) for this Issue. Only provided for assigned and unassigned events.
milestone The Milestone object including a title attribute. Only provided for milestoned and demilestoned events.
source The id, actor, and url for the source of a reference from another issue. Only provided for cross-referenced events.
rename An object containing rename details including from and to attributes. Only provided for renamed events.

Event Types

events timeline Event Description
assigned The issue was assigned to the actor.
closed The issue was closed by the actor. When the commit_id is present, it identifies the commit that closed the issue using "closes / fixes #NN" syntax.
commented A comment was added to the issue.
committed A commit was added to the pull request's HEAD branch. Only provided for pull requests.
cross-referenced The issue was referenced from another issue. The source attribute contains the id, actor, and url of the reference's source.
demilestoned The issue was removed from a milestone.
✔* ✔* deployed The pull request was deployed. (*undocumented)
head_ref_deleted The pull request's branch was deleted.
head_ref_restored The pull request's branch was restored.
labeled A label was added to the issue.
locked The issue was locked by the actor.
mentioned The actor was @mentioned in an issue body.
merged The issue was merged by the actor. The commit_id attribute is the SHA1 of the HEAD commit that was merged.
milestoned The issue was added to a milestone.
referenced The issue was referenced from a commit message. The commit_id attribute is the commit SHA1 of where that happened.
renamed The issue title was changed.
reopened The issue was reopened by the actor.
subscribed The actor subscribed to receive notifications for an issue.
unassigned The actor was unassigned from the issue.
unlabeled A label was removed from the issue.
unlocked The issue was unlocked by the actor.
unsubscribed The actor unsubscribed to stop receiving notifications for an issue.
@dahlbyk
Copy link
Author

dahlbyk commented May 26, 2016

Some observations...

  • deployed event does not include any useful information about the deployment. At least the applicable deployment or deployment status is necessary for this to be useful, though a more complete payload would avoid N+1 situations.
  • New committed payload includes commit details! ✨
  • New commented payload includes comment details! ✨
    • Does not seem to respect full+json, despite X-GitHub-Media-Type: github.mockingbird-preview; param=full; format=json
    • Complicated by overlapping preview periods, but it would be great if this also included reactions (like comment details).

@discorick
Copy link

discorick commented May 31, 2016

As @dahlbyk mentioned, getting the same level of details for referenced would be extremely helpful and would help us avoid N+1 queries for items like commit references!

@Stuk
Copy link

Stuk commented Jun 14, 2016

Thanks for putting this together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment