{"action":"opened","number":46,"pull_request":{"url":"https://api.github.com/repos/CanalTP/kirin/pulls/46","id":48771696,"html_url":"https://github.com/CanalTP/kirin/pull/46","diff_url":"https://github.com/CanalTP/kirin/pull/46.diff","patch_url":"https://github.com/CanalTP/kirin/pull/46.patch","issue_url":"https://api.github.com/repos/CanalTP/kirin/issues/46","number":46,"state":"open","locked":false,"title":"Delay handling","user":{"login":"antoine-de","id":3987698,"avatar_url":"https://avatars.githubusercontent.com/u/3987698?v=3","gravatar_id":"","url":"https://api.github.com/users/antoine-de","html_url":"https://github.com/antoine-de","followers_url":"https://api.github.com/users/antoine-de/followers","following_url":"https://api.github.com/users/antoine-de/following{/other_user}","gists_url":"https://api.github.com/users/antoine-de/gists{/gist_id}","starred_url":"https://api.github.com/users/antoine-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoine-de/subscriptions","organizations_url":"https://api.github.com/users/antoine-de/orgs","repos_url":"https://api.github.com/users/antoine-de/repos","events_url":"https://api.github.com/users/antoine-de/events{/privacy}","received_events_url":"https://api.github.com/users/antoine-de/received_events","type":"User","site_admin":false},"body":"Handle delay on StopTimeUpdates\r\n\r\nrefactoring of the handle.merge to make it works.\r\n\r\nWe need to merge the info from 3 sources:\r\n* the navitia base schedule\r\n* the trip update already in the bd (potentially not existent)\r\n* the incoming trip update\r\nThe result is either the db_trip_update if it exists, or the new_trip_update (it is updated as a side\r\neffect)\r\nThe mechanism is quite simple:\r\n* the result trip status is the new_trip_update's status\r\n        (ie in the db the trip was cancelled, and a new update is only an update, the trip update is\r\n        not cancelled anymore, only updated)\r\n* for each navitia's stop_time and for departure|arrival:\r\n    - if there is an update on this stoptime (in new_trip_update):\r\n            we compute the new datetime based on the new information and the navitia's base schedule\r\n    - else if there if the stoptime in the db:\r\n            we keep this db stoptime\r\n    - else we keep the navitia's base schedule\r\n\r\n**Important Note**:\r\nwe DO NOT HANDLE changes in navitia's schedule for the moment\r\nit will need to be handled, but it will be done after\r\n\r\nfix http://jira.canaltp.fr/browse/NAVP-354","created_at":"2015-10-26T17:35:57Z","updated_at":"2015-10-26T17:35:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CanalTP/kirin/pulls/46/commits","review_comments_url":"https://api.github.com/repos/CanalTP/kirin/pulls/46/comments","review_comment_url":"https://api.github.com/repos/CanalTP/kirin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CanalTP/kirin/issues/46/comments","statuses_url":"https://api.github.com/repos/CanalTP/kirin/statuses/52aa9ab6bbd0768e325897d126a307e10834becf","head":{"label":"antoine-de:merge_delay","ref":"merge_delay","sha":"52aa9ab6bbd0768e325897d126a307e10834becf","user":{"login":"antoine-de","id":3987698,"avatar_url":"https://avatars.githubusercontent.com/u/3987698?v=3","gravatar_id":"","url":"https://api.github.com/users/antoine-de","html_url":"https://github.com/antoine-de","followers_url":"https://api.github.com/users/antoine-de/followers","following_url":"https://api.github.com/users/antoine-de/following{/other_user}","gists_url":"https://api.github.com/users/antoine-de/gists{/gist_id}","starred_url":"https://api.github.com/users/antoine-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoine-de/subscriptions","organizations_url":"https://api.github.com/users/antoine-de/orgs","repos_url":"https://api.github.com/users/antoine-de/repos","events_url":"https://api.github.com/users/antoine-de/events{/privacy}","received_events_url":"https://api.github.com/users/antoine-de/received_events","type":"User","site_admin":false},"repo":{"id":43301704,"name":"kirin","full_name":"antoine-de/kirin","owner":{"login":"antoine-de","id":3987698,"avatar_url":"https://avatars.githubusercontent.com/u/3987698?v=3","gravatar_id":"","url":"https://api.github.com/users/antoine-de","html_url":"https://github.com/antoine-de","followers_url":"https://api.github.com/users/antoine-de/followers","following_url":"https://api.github.com/users/antoine-de/following{/other_user}","gists_url":"https://api.github.com/users/antoine-de/gists{/gist_id}","starred_url":"https://api.github.com/users/antoine-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoine-de/subscriptions","organizations_url":"https://api.github.com/users/antoine-de/orgs","repos_url":"https://api.github.com/users/antoine-de/repos","events_url":"https://api.github.com/users/antoine-de/events{/privacy}","received_events_url":"https://api.github.com/users/antoine-de/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antoine-de/kirin","description":"The magical unicorn","fork":true,"url":"https://api.github.com/repos/antoine-de/kirin","forks_url":"https://api.github.com/repos/antoine-de/kirin/forks","keys_url":"https://api.github.com/repos/antoine-de/kirin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antoine-de/kirin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antoine-de/kirin/teams","hooks_url":"https://api.github.com/repos/antoine-de/kirin/hooks","issue_events_url":"https://api.github.com/repos/antoine-de/kirin/issues/events{/number}","events_url":"https://api.github.com/repos/antoine-de/kirin/events","assignees_url":"https://api.github.com/repos/antoine-de/kirin/assignees{/user}","branches_url":"https://api.github.com/repos/antoine-de/kirin/branches{/branch}","tags_url":"https://api.github.com/repos/antoine-de/kirin/tags","blobs_url":"https://api.github.com/repos/antoine-de/kirin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antoine-de/kirin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antoine-de/kirin/git/refs{/sha}","trees_url":"https://api.github.com/repos/antoine-de/kirin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antoine-de/kirin/statuses/{sha}","languages_url":"https://api.github.com/repos/antoine-de/kirin/languages","stargazers_url":"https://api.github.com/repos/antoine-de/kirin/stargazers","contributors_url":"https://api.github.com/repos/antoine-de/kirin/contributors","subscribers_url":"https://api.github.com/repos/antoine-de/kirin/subscribers","subscription_url":"https://api.github.com/repos/antoine-de/kirin/subscription","commits_url":"https://api.github.com/repos/antoine-de/kirin/commits{/sha}","git_commits_url":"https://api.github.com/repos/antoine-de/kirin/git/commits{/sha}","comments_url":"https://api.github.com/repos/antoine-de/kirin/comments{/number}","issue_comment_url":"https://api.github.com/repos/antoine-de/kirin/issues/comments{/number}","contents_url":"https://api.github.com/repos/antoine-de/kirin/contents/{+path}","compare_url":"https://api.github.com/repos/antoine-de/kirin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antoine-de/kirin/merges","archive_url":"https://api.github.com/repos/antoine-de/kirin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antoine-de/kirin/downloads","issues_url":"https://api.github.com/repos/antoine-de/kirin/issues{/number}","pulls_url":"https://api.github.com/repos/antoine-de/kirin/pulls{/number}","milestones_url":"https://api.github.com/repos/antoine-de/kirin/milestones{/number}","notifications_url":"https://api.github.com/repos/antoine-de/kirin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antoine-de/kirin/labels{/name}","releases_url":"https://api.github.com/repos/antoine-de/kirin/releases{/id}","created_at":"2015-09-28T13:12:08Z","updated_at":"2015-09-28T13:12:09Z","pushed_at":"2015-10-26T17:31:08Z","git_url":"git://github.com/antoine-de/kirin.git","ssh_url":"git@github.com:antoine-de/kirin.git","clone_url":"https://github.com/antoine-de/kirin.git","svn_url":"https://github.com/antoine-de/kirin","homepage":null,"size":319,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CanalTP:master","ref":"master","sha":"366c2c75a8024c26650d68189f238d0c40b0bd42","user":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?v=3","gravatar_id":"","url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"repo":{"id":39950201,"name":"kirin","full_name":"CanalTP/kirin","owner":{"login":"CanalTP","id":2743985,"avatar_url":"https://avatars.githubusercontent.com/u/2743985?v=3","gravatar_id":"","url":"https://api.github.com/users/CanalTP","html_url":"https://github.com/CanalTP","followers_url":"https://api.github.com/users/CanalTP/followers","following_url":"https://api.github.com/users/CanalTP/following{/other_user}","gists_url":"https://api.github.com/users/CanalTP/gists{/gist_id}","starred_url":"https://api.github.com/users/CanalTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CanalTP/subscriptions","organizations_url":"https://api.github.com/users/CanalTP/orgs","repos_url":"https://api.github.com/users/CanalTP/repos","events_url":"https://api.github.com/users/CanalTP/events{/privacy}","received_events_url":"https://api.github.com/users/CanalTP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CanalTP/kirin","description":"The magical unicorn","fork":false,"url":"https://api.github.com/repos/CanalTP/kirin","forks_url":"https://api.github.com/repos/CanalTP/kirin/forks","keys_url":"https://api.github.com/repos/CanalTP/kirin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CanalTP/kirin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CanalTP/kirin/teams","hooks_url":"https://api.github.com/repos/CanalTP/kirin/hooks","issue_events_url":"https://api.github.com/repos/CanalTP/kirin/issues/events{/number}","events_url":"https://api.github.com/repos/CanalTP/kirin/events","assignees_url":"https://api.github.com/repos/CanalTP/kirin/assignees{/user}","branches_url":"https://api.github.com/repos/CanalTP/kirin/branches{/branch}","tags_url":"https://api.github.com/repos/CanalTP/kirin/tags","blobs_url":"https://api.github.com/repos/CanalTP/kirin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CanalTP/kirin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CanalTP/kirin/git/refs{/sha}","trees_url":"https://api.github.com/repos/CanalTP/kirin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CanalTP/kirin/statuses/{sha}","languages_url":"https://api.github.com/repos/CanalTP/kirin/languages","stargazers_url":"https://api.github.com/repos/CanalTP/kirin/stargazers","contributors_url":"https://api.github.com/repos/CanalTP/kirin/contributors","subscribers_url":"https://api.github.com/repos/CanalTP/kirin/subscribers","subscription_url":"https://api.github.com/repos/CanalTP/kirin/subscription","commits_url":"https://api.github.com/repos/CanalTP/kirin/commits{/sha}","git_commits_url":"https://api.github.com/repos/CanalTP/kirin/git/commits{/sha}","comments_url":"https://api.github.com/repos/CanalTP/kirin/comments{/number}","issue_comment_url":"https://api.github.com/repos/CanalTP/kirin/issues/comments{/number}","contents_url":"https://api.github.com/repos/CanalTP/kirin/contents/{+path}","compare_url":"https://api.github.com/repos/CanalTP/kirin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CanalTP/kirin/merges","archive_url":"https://api.github.com/repos/CanalTP/kirin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CanalTP/kirin/downloads","issues_url":"https://api.github.com/repos/CanalTP/kirin/issues{/number}","pulls_url":"https://api.github.com/repos/CanalTP/kirin/pulls{/number}","milestones_url":"https://api.github.com/repos/CanalTP/kirin/milestones{/number}","notifications_url":"https://api.github.com/repos/CanalTP/kirin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CanalTP/kirin/labels{/name}","releases_url":"https://api.github.com/repos/CanalTP/kirin/releases{/id}","created_at":"2015-07-30T12:48:49Z","updated_at":"2015-09-28T12:43:43Z","pushed_at":"2015-10-23T15:37:44Z","git_url":"git://github.com/CanalTP/kirin.git","ssh_url":"git@github.com:CanalTP/kirin.git","clone_url":"https://github.com/CanalTP/kirin.git","svn_url":"https://github.com/CanalTP/kirin","homepage":null,"size":736,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CanalTP/kirin/pulls/46"},"html":{"href":"https://github.com/CanalTP/kirin/pull/46"},"issue":{"href":"https://api.github.com/repos/CanalTP/kirin/issues/46"},"comments":{"href":"https://api.github.com/repos/CanalTP/kirin/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/CanalTP/kirin/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/CanalTP/kirin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CanalTP/kirin/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/CanalTP/kirin/statuses/52aa9ab6bbd0768e325897d126a307e10834becf"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":5,"additions":483,"deletions":114,"changed_files":8}}