{"action":"created","comment":{"url":"https://api.github.com/repos/mbta/skate/pulls/comments/286118438","pull_request_review_id":240165662,"id":286118438,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4NjExODQzOA==","diff_hunk":"@@ -0,0 +1,80 @@\n+defmodule Concentrate.StopTimeUpdate do\n+  @moduledoc \"\"\"\n+  Structure for representing an update to a StopTime (e.g. a predicted arrival or departure)\n+  \"\"\"\n+  import Concentrate.StructHelpers\n+  alias Gtfs.Stop\n+\n+  defstruct_accessors([\n+    :trip_id,\n+    :stop_id,\n+    :arrival_time,\n+    :departure_time,\n+    :stop_sequence,\n+    :status,\n+    :track,\n+    :platform_id,\n+    :uncertainty,\n+    schedule_relationship: :SCHEDULED\n+  ])\n+\n+  @doc \"\"\"\n+  Returns a time for the StopTimeUpdate: arrival if present, otherwise departure.\n+  \"\"\"\n+  @spec time(%__MODULE__{}) :: non_neg_integer | nil\n+  def time(%__MODULE__{arrival_time: time}) when is_integer(time), do: time\n+  def time(%__MODULE__{departure_time: time}), do: time\n+\n+  @compile inline: [time: 1]\n+\n+  @doc \"\"\"\n+  Marks the update as skipped (when the stop is closed, for example).\n+  \"\"\"\n+  @spec skip(%__MODULE__{}) :: t\n+  def skip(%__MODULE__{} = stu) do\n+    %{stu | schedule_relationship: :SKIPPED, arrival_time: nil, departure_time: nil}\n+  end\n+\n+  defimpl Concentrate.Mergeable do\n+    @default_key_opts [stop_fn: &Gtfs.stop/1]\n+    def key(%{trip_id: trip_id, stop_id: stop_id, stop_sequence: stop_sequence}, opts) do\n+      opts = Keyword.merge(@default_key_opts, opts)\n+      stop_fn = opts[:stop_fn]\n+\n+      parent_station_id =\n+        if stop_id do\n+          stop_id\n+          |> stop_fn.()\n+          |> Stop.parent_station_id()\n+        end\n+\n+      {trip_id, parent_station_id, stop_sequence}","path":"lib/concentrate/stop_time_update.ex","position":51,"original_position":51,"commit_id":"c752417d74ab24d45f8d97ecf1e74f521565fc25","original_commit_id":"485d88552c1a659d1be401b27534a10f16ce0e75","user":{"login":"arkadyan","id":42339,"node_id":"MDQ6VXNlcjQyMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/42339?v=4","gravatar_id":"","url":"https://api.github.com/users/arkadyan","html_url":"https://github.com/arkadyan","followers_url":"https://api.github.com/users/arkadyan/followers","following_url":"https://api.github.com/users/arkadyan/following{/other_user}","gists_url":"https://api.github.com/users/arkadyan/gists{/gist_id}","starred_url":"https://api.github.com/users/arkadyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkadyan/subscriptions","organizations_url":"https://api.github.com/users/arkadyan/orgs","repos_url":"https://api.github.com/users/arkadyan/repos","events_url":"https://api.github.com/users/arkadyan/events{/privacy}","received_events_url":"https://api.github.com/users/arkadyan/received_events","type":"User","site_admin":false},"body":"That's true at the moment, but different features are going to want more pieces of data as we go. I don't know if any of that will need to come from StopTimeUpdate, but I'm relunctant to throw out data until we have a better sense.","created_at":"2019-05-21T16:35:39Z","updated_at":"2019-05-21T16:35:40Z","html_url":"https://github.com/mbta/skate/pull/51#discussion_r286118438","pull_request_url":"https://api.github.com/repos/mbta/skate/pulls/51","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mbta/skate/pulls/comments/286118438"},"html":{"href":"https://github.com/mbta/skate/pull/51#discussion_r286118438"},"pull_request":{"href":"https://api.github.com/repos/mbta/skate/pulls/51"}},"in_reply_to_id":285767544},"pull_request":{"url":"https://api.github.com/repos/mbta/skate/pulls/51","id":280520511,"node_id":"MDExOlB1bGxSZXF1ZXN0MjgwNTIwNTEx","html_url":"https://github.com/mbta/skate/pull/51","diff_url":"https://github.com/mbta/skate/pull/51.diff","patch_url":"https://github.com/mbta/skate/pull/51.patch","issue_url":"https://api.github.com/repos/mbta/skate/issues/51","number":51,"state":"open","locked":false,"title":"Ingest Busloc feed to add more data to vehicles","user":{"login":"arkadyan","id":42339,"node_id":"MDQ6VXNlcjQyMzM5","avatar_url":"https://avatars1.githubusercontent.com/u/42339?v=4","gravatar_id":"","url":"https://api.github.com/users/arkadyan","html_url":"https://github.com/arkadyan","followers_url":"https://api.github.com/users/arkadyan/followers","following_url":"https://api.github.com/users/arkadyan/following{/other_user}","gists_url":"https://api.github.com/users/arkadyan/gists{/gist_id}","starred_url":"https://api.github.com/users/arkadyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkadyan/subscriptions","organizations_url":"https://api.github.com/users/arkadyan/orgs","repos_url":"https://api.github.com/users/arkadyan/repos","events_url":"https://api.github.com/users/arkadyan/events{/privacy}","received_events_url":"https://api.github.com/users/arkadyan/received_events","type":"User","site_admin":false},"body":"Asana ticket: [Ingest Busloc feed](https://app.asana.com/0/1112935048846093/1114820119721035)\r\n\r\nAdd a bunch of concentrate code to manage file parsing and data merging.","created_at":"2019-05-20T19:53:07Z","updated_at":"2019-05-21T16:35:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ffe736adc88e45c2f802bb1040efa84017a61b17","assignee":{"login":"skyqrose","id":23065557,"node_id":"MDQ6VXNlcjIzMDY1NTU3","avatar_url":"https://avatars0.githubusercontent.com/u/23065557?v=4","gravatar_id":"","url":"https://api.github.com/users/skyqrose","html_url":"https://github.com/skyqrose","followers_url":"https://api.github.com/users/skyqrose/followers","following_url":"https://api.github.com/users/skyqrose/following{/other_user}","gists_url":"https://api.github.com/users/skyqrose/gists{/gist_id}","starred_url":"https://api.github.com/users/skyqrose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyqrose/subscriptions","organizations_url":"https://api.github.com/users/skyqrose/orgs","repos_url":"https://api.github.com/users/skyqrose/repos","events_url":"https://api.github.com/users/skyqrose/events{/privacy}","received_events_url":"https://api.github.com/users/skyqrose/received_events","type":"User","site_admin":false},"assignees":[{"login":"skyqrose","id":23065557,"node_id":"MDQ6VXNlcjIzMDY1NTU3","avatar_url":"https://avatars0.githubusercontent.com/u/23065557?v=4","gravatar_id":"","url":"https://api.github.com/users/skyqrose","html_url":"https://github.com/skyqrose","followers_url":"https://api.github.com/users/skyqrose/followers","following_url":"https://api.github.com/users/skyqrose/following{/other_user}","gists_url":"https://api.github.com/users/skyqrose/gists{/gist_id}","starred_url":"https://api.github.com/users/skyqrose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skyqrose/subscriptions","organizations_url":"https://api.github.com/users/skyqrose/orgs","repos_url":"https://api.github.com/users/skyqrose/repos","events_url":"https://api.github.com/users/skyqrose/events{/privacy}","received_events_url":"https://api.github.com/users/skyqrose/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mbta/skate/pulls/51/commits","review_comments_url":"https://api.github.com/repos/mbta/skate/pulls/51/comments","review_comment_url":"https://api.github.com/repos/mbta/skate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mbta/skate/issues/51/comments","statuses_url":"https://api.github.com/repos/mbta/skate/statuses/c752417d74ab24d45f8d97ecf1e74f521565fc25","head":{"label":"mbta:mss-ingest-busloc","ref":"mss-ingest-busloc","sha":"c752417d74ab24d45f8d97ecf1e74f521565fc25","user":{"login":"mbta","id":17993322,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3OTkzMzIy","avatar_url":"https://avatars0.githubusercontent.com/u/17993322?v=4","gravatar_id":"","url":"https://api.github.com/users/mbta","html_url":"https://github.com/mbta","followers_url":"https://api.github.com/users/mbta/followers","following_url":"https://api.github.com/users/mbta/following{/other_user}","gists_url":"https://api.github.com/users/mbta/gists{/gist_id}","starred_url":"https://api.github.com/users/mbta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbta/subscriptions","organizations_url":"https://api.github.com/users/mbta/orgs","repos_url":"https://api.github.com/users/mbta/repos","events_url":"https://api.github.com/users/mbta/events{/privacy}","received_events_url":"https://api.github.com/users/mbta/received_events","type":"Organization","site_admin":false},"repo":{"id":175481826,"node_id":"MDEwOlJlcG9zaXRvcnkxNzU0ODE4MjY=","name":"skate","full_name":"mbta/skate","private":false,"owner":{"login":"mbta","id":17993322,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3OTkzMzIy","avatar_url":"https://avatars0.githubusercontent.com/u/17993322?v=4","gravatar_id":"","url":"https://api.github.com/users/mbta","html_url":"https://github.com/mbta","followers_url":"https://api.github.com/users/mbta/followers","following_url":"https://api.github.com/users/mbta/following{/other_user}","gists_url":"https://api.github.com/users/mbta/gists{/gist_id}","starred_url":"https://api.github.com/users/mbta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbta/subscriptions","organizations_url":"https://api.github.com/users/mbta/orgs","repos_url":"https://api.github.com/users/mbta/repos","events_url":"https://api.github.com/users/mbta/events{/privacy}","received_events_url":"https://api.github.com/users/mbta/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mbta/skate","description":"Gliding on wheels","fork":false,"url":"https://api.github.com/repos/mbta/skate","forks_url":"https://api.github.com/repos/mbta/skate/forks","keys_url":"https://api.github.com/repos/mbta/skate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbta/skate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbta/skate/teams","hooks_url":"https://api.github.com/repos/mbta/skate/hooks","issue_events_url":"https://api.github.com/repos/mbta/skate/issues/events{/number}","events_url":"https://api.github.com/repos/mbta/skate/events","assignees_url":"https://api.github.com/repos/mbta/skate/assignees{/user}","branches_url":"https://api.github.com/repos/mbta/skate/branches{/branch}","tags_url":"https://api.github.com/repos/mbta/skate/tags","blobs_url":"https://api.github.com/repos/mbta/skate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbta/skate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbta/skate/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbta/skate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbta/skate/statuses/{sha}","languages_url":"https://api.github.com/repos/mbta/skate/languages","stargazers_url":"https://api.github.com/repos/mbta/skate/stargazers","contributors_url":"https://api.github.com/repos/mbta/skate/contributors","subscribers_url":"https://api.github.com/repos/mbta/skate/subscribers","subscription_url":"https://api.github.com/repos/mbta/skate/subscription","commits_url":"https://api.github.com/repos/mbta/skate/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbta/skate/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbta/skate/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbta/skate/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbta/skate/contents/{+path}","compare_url":"https://api.github.com/repos/mbta/skate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbta/skate/merges","archive_url":"https://api.github.com/repos/mbta/skate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbta/skate/downloads","issues_url":"https://api.github.com/repos/mbta/skate/issues{/number}","pulls_url":"https://api.github.com/repos/mbta/skate/pulls{/number}","milestones_url":"https://api.github.com/repos/mbta/skate/milestones{/number}","notifications_url":"https://api.github.com/repos/mbta/skate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbta/skate/labels{/name}","releases_url":"https://api.github.com/repos/mbta/skate/releases{/id}","deployments_url":"https://api.github.com/repos/mbta/skate/deployments","created_at":"2019-03-13T19:00:01Z","updated_at":"2019-05-20T19:30:43Z","pushed_at":"2019-05-21T16:26:32Z","git_url":"git://github.com/mbta/skate.git","ssh_url":"git@github.com:mbta/skate.git","clone_url":"https://github.com/mbta/skate.git","svn_url":"https://github.com/mbta/skate","homepage":null,"size":543,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"mbta:master","ref":"master","sha":"914a86b8b6856aa77c3441115517c1546cdd5a33","user":{"login":"mbta","id":17993322,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3OTkzMzIy","avatar_url":"https://avatars0.githubusercontent.com/u/17993322?v=4","gravatar_id":"","url":"https://api.github.com/users/mbta","html_url":"https://github.com/mbta","followers_url":"https://api.github.com/users/mbta/followers","following_url":"https://api.github.com/users/mbta/following{/other_user}","gists_url":"https://api.github.com/users/mbta/gists{/gist_id}","starred_url":"https://api.github.com/users/mbta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbta/subscriptions","organizations_url":"https://api.github.com/users/mbta/orgs","repos_url":"https://api.github.com/users/mbta/repos","events_url":"https://api.github.com/users/mbta/events{/privacy}","received_events_url":"https://api.github.com/users/mbta/received_events","type":"Organization","site_admin":false},"repo":{"id":175481826,"node_id":"MDEwOlJlcG9zaXRvcnkxNzU0ODE4MjY=","name":"skate","full_name":"mbta/skate","private":false,"owner":{"login":"mbta","id":17993322,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3OTkzMzIy","avatar_url":"https://avatars0.githubusercontent.com/u/17993322?v=4","gravatar_id":"","url":"https://api.github.com/users/mbta","html_url":"https://github.com/mbta","followers_url":"https://api.github.com/users/mbta/followers","following_url":"https://api.github.com/users/mbta/following{/other_user}","gists_url":"https://api.github.com/users/mbta/gists{/gist_id}","starred_url":"https://api.github.com/users/mbta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbta/subscriptions","organizations_url":"https://api.github.com/users/mbta/orgs","repos_url":"https://api.github.com/users/mbta/repos","events_url":"https://api.github.com/users/mbta/events{/privacy}","received_events_url":"https://api.github.com/users/mbta/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mbta/skate","description":"Gliding on wheels","fork":false,"url":"https://api.github.com/repos/mbta/skate","forks_url":"https://api.github.com/repos/mbta/skate/forks","keys_url":"https://api.github.com/repos/mbta/skate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbta/skate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbta/skate/teams","hooks_url":"https://api.github.com/repos/mbta/skate/hooks","issue_events_url":"https://api.github.com/repos/mbta/skate/issues/events{/number}","events_url":"https://api.github.com/repos/mbta/skate/events","assignees_url":"https://api.github.com/repos/mbta/skate/assignees{/user}","branches_url":"https://api.github.com/repos/mbta/skate/branches{/branch}","tags_url":"https://api.github.com/repos/mbta/skate/tags","blobs_url":"https://api.github.com/repos/mbta/skate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbta/skate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbta/skate/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbta/skate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbta/skate/statuses/{sha}","languages_url":"https://api.github.com/repos/mbta/skate/languages","stargazers_url":"https://api.github.com/repos/mbta/skate/stargazers","contributors_url":"https://api.github.com/repos/mbta/skate/contributors","subscribers_url":"https://api.github.com/repos/mbta/skate/subscribers","subscription_url":"https://api.github.com/repos/mbta/skate/subscription","commits_url":"https://api.github.com/repos/mbta/skate/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbta/skate/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbta/skate/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbta/skate/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbta/skate/contents/{+path}","compare_url":"https://api.github.com/repos/mbta/skate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbta/skate/merges","archive_url":"https://api.github.com/repos/mbta/skate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbta/skate/downloads","issues_url":"https://api.github.com/repos/mbta/skate/issues{/number}","pulls_url":"https://api.github.com/repos/mbta/skate/pulls{/number}","milestones_url":"https://api.github.com/repos/mbta/skate/milestones{/number}","notifications_url":"https://api.github.com/repos/mbta/skate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbta/skate/labels{/name}","releases_url":"https://api.github.com/repos/mbta/skate/releases{/id}","deployments_url":"https://api.github.com/repos/mbta/skate/deployments","created_at":"2019-03-13T19:00:01Z","updated_at":"2019-05-20T19:30:43Z","pushed_at":"2019-05-21T16:26:32Z","git_url":"git://github.com/mbta/skate.git","ssh_url":"git@github.com:mbta/skate.git","clone_url":"https://github.com/mbta/skate.git","svn_url":"https://github.com/mbta/skate","homepage":null,"size":543,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mbta/skate/pulls/51"},"html":{"href":"https://github.com/mbta/skate/pull/51"},"issue":{"href":"https://api.github.com/repos/mbta/skate/issues/51"},"comments":{"href":"https://api.github.com/repos/mbta/skate/issues/51/comments"},"review_comments":{"href":"https://api.github.com/repos/mbta/skate/pulls/51/comments"},"review_comment":{"href":"https://api.github.com/repos/mbta/skate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mbta/skate/pulls/51/commits"},"statuses":{"href":"https://api.github.com/repos/mbta/skate/statuses/c752417d74ab24d45f8d97ecf1e74f521565fc25"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"arkadyan"}}