{"action":"created","comment":{"url":"https://api.github.com/repos/okkur/dailymile/pulls/comments/169723914","pull_request_review_id":98297105,"id":169723914,"diff_hunk":"@@ -132,77 +137,82 @@ func getProjectID(baseURL string, token string, projectname string, namespace st\n }\n \n // Get and return currently active milestones\n-func getMilestones(baseURL string, token string, projectID string) (map[string]string, error) {\n-\tmilestones := []milestoneAPI{}\n-\n-\tstrURL := []string{baseURL, projectID, \"/milestones?state=active&per_page=100\"}\n-\tURL := strings.Join(strURL, \"\")\n+func getActiveMilestones(baseURL string, token string, projectID string) ([]milestoneAPI, error) {\n+\tstate := \"active\"\n+\treturn getMilestones(baseURL, token, projectID, state)\n+}\n \n-\tm, linkHeader, err := callServer(URL, token, milestones)\n-\tif err != nil {\n-\t\treturn m, err\n-\t}\n+// Get and return inactive milestones\n+func getInactiveMilestones(baseURL string, token string, projectID string) ([]milestoneAPI, error) {\n+\tstate := \"closed\"\n+\treturn getMilestones(baseURL, token, projectID, state)\n+}\n \n-\tfor _, milestone := range milestones {\n-\t\tm[milestone.Title] = milestone.DueDate\n-\t}\n+func getMilestones(baseURL string, token string, projectID string, state string) ([]milestoneAPI, error) {\n+\tm := []milestoneAPI{}\n+\tclient := &http.Client{}\n+\tstrURL := []string{baseURL, \"/projects/\", projectID, \"/milestones\"}\n+\tURL := strings.Join(strURL, \"\")","path":"main.go","position":89,"original_position":89,"commit_id":"13f8e735610997de6c5415bb633be4f5d65d80b1","original_commit_id":"13f8e735610997de6c5415bb633be4f5d65d80b1","user":{"login":"erbesharat","id":7544732,"avatar_url":"https://avatars2.githubusercontent.com/u/7544732?v=4","gravatar_id":"","url":"https://api.github.com/users/erbesharat","html_url":"https://github.com/erbesharat","followers_url":"https://api.github.com/users/erbesharat/followers","following_url":"https://api.github.com/users/erbesharat/following{/other_user}","gists_url":"https://api.github.com/users/erbesharat/gists{/gist_id}","starred_url":"https://api.github.com/users/erbesharat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erbesharat/subscriptions","organizations_url":"https://api.github.com/users/erbesharat/orgs","repos_url":"https://api.github.com/users/erbesharat/repos","events_url":"https://api.github.com/users/erbesharat/events{/privacy}","received_events_url":"https://api.github.com/users/erbesharat/received_events","type":"User","site_admin":false},"body":"Yeah you are right, I didn't think about it that way 😄 ","created_at":"2018-02-21T17:55:47Z","updated_at":"2018-02-21T17:55:47Z","html_url":"https://github.com/okkur/dailymile/pull/30#discussion_r169723914","pull_request_url":"https://api.github.com/repos/okkur/dailymile/pulls/30","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/okkur/dailymile/pulls/comments/169723914"},"html":{"href":"https://github.com/okkur/dailymile/pull/30#discussion_r169723914"},"pull_request":{"href":"https://api.github.com/repos/okkur/dailymile/pulls/30"}},"in_reply_to_id":169415486},"pull_request":{"url":"https://api.github.com/repos/okkur/dailymile/pulls/30","id":164695146,"html_url":"https://github.com/okkur/dailymile/pull/30","diff_url":"https://github.com/okkur/dailymile/pull/30.diff","patch_url":"https://github.com/okkur/dailymile/pull/30.patch","issue_url":"https://api.github.com/repos/okkur/dailymile/issues/30","number":30,"state":"open","locked":false,"title":"Refactor callServer function and add getInactiveMilestones","user":{"login":"dbriesz","id":20975751,"avatar_url":"https://avatars1.githubusercontent.com/u/20975751?v=4","gravatar_id":"","url":"https://api.github.com/users/dbriesz","html_url":"https://github.com/dbriesz","followers_url":"https://api.github.com/users/dbriesz/followers","following_url":"https://api.github.com/users/dbriesz/following{/other_user}","gists_url":"https://api.github.com/users/dbriesz/gists{/gist_id}","starred_url":"https://api.github.com/users/dbriesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbriesz/subscriptions","organizations_url":"https://api.github.com/users/dbriesz/orgs","repos_url":"https://api.github.com/users/dbriesz/repos","events_url":"https://api.github.com/users/dbriesz/events{/privacy}","received_events_url":"https://api.github.com/users/dbriesz/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\nRefactors the callServer function so that it includes pagination and returns a []milestoneAPI. Also adds a getInactiveMilestones function that returns inactive milestones.\r\n","created_at":"2018-01-23T21:31:41Z","updated_at":"2018-02-21T17:55:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"148b14eea2c1b2721bea6ae9cfe916f37f0a3c7f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/okkur/dailymile/pulls/30/commits","review_comments_url":"https://api.github.com/repos/okkur/dailymile/pulls/30/comments","review_comment_url":"https://api.github.com/repos/okkur/dailymile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/okkur/dailymile/issues/30/comments","statuses_url":"https://api.github.com/repos/okkur/dailymile/statuses/13f8e735610997de6c5415bb633be4f5d65d80b1","head":{"label":"dbriesz:refactor-callserver","ref":"refactor-callserver","sha":"13f8e735610997de6c5415bb633be4f5d65d80b1","user":{"login":"dbriesz","id":20975751,"avatar_url":"https://avatars1.githubusercontent.com/u/20975751?v=4","gravatar_id":"","url":"https://api.github.com/users/dbriesz","html_url":"https://github.com/dbriesz","followers_url":"https://api.github.com/users/dbriesz/followers","following_url":"https://api.github.com/users/dbriesz/following{/other_user}","gists_url":"https://api.github.com/users/dbriesz/gists{/gist_id}","starred_url":"https://api.github.com/users/dbriesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbriesz/subscriptions","organizations_url":"https://api.github.com/users/dbriesz/orgs","repos_url":"https://api.github.com/users/dbriesz/repos","events_url":"https://api.github.com/users/dbriesz/events{/privacy}","received_events_url":"https://api.github.com/users/dbriesz/received_events","type":"User","site_admin":false},"repo":{"id":117714059,"name":"dailymile","full_name":"dbriesz/dailymile","owner":{"login":"dbriesz","id":20975751,"avatar_url":"https://avatars1.githubusercontent.com/u/20975751?v=4","gravatar_id":"","url":"https://api.github.com/users/dbriesz","html_url":"https://github.com/dbriesz","followers_url":"https://api.github.com/users/dbriesz/followers","following_url":"https://api.github.com/users/dbriesz/following{/other_user}","gists_url":"https://api.github.com/users/dbriesz/gists{/gist_id}","starred_url":"https://api.github.com/users/dbriesz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbriesz/subscriptions","organizations_url":"https://api.github.com/users/dbriesz/orgs","repos_url":"https://api.github.com/users/dbriesz/repos","events_url":"https://api.github.com/users/dbriesz/events{/privacy}","received_events_url":"https://api.github.com/users/dbriesz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dbriesz/dailymile","description":"Daily milestone (todo) generation for Gitlab.","fork":true,"url":"https://api.github.com/repos/dbriesz/dailymile","forks_url":"https://api.github.com/repos/dbriesz/dailymile/forks","keys_url":"https://api.github.com/repos/dbriesz/dailymile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dbriesz/dailymile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dbriesz/dailymile/teams","hooks_url":"https://api.github.com/repos/dbriesz/dailymile/hooks","issue_events_url":"https://api.github.com/repos/dbriesz/dailymile/issues/events{/number}","events_url":"https://api.github.com/repos/dbriesz/dailymile/events","assignees_url":"https://api.github.com/repos/dbriesz/dailymile/assignees{/user}","branches_url":"https://api.github.com/repos/dbriesz/dailymile/branches{/branch}","tags_url":"https://api.github.com/repos/dbriesz/dailymile/tags","blobs_url":"https://api.github.com/repos/dbriesz/dailymile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dbriesz/dailymile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dbriesz/dailymile/git/refs{/sha}","trees_url":"https://api.github.com/repos/dbriesz/dailymile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dbriesz/dailymile/statuses/{sha}","languages_url":"https://api.github.com/repos/dbriesz/dailymile/languages","stargazers_url":"https://api.github.com/repos/dbriesz/dailymile/stargazers","contributors_url":"https://api.github.com/repos/dbriesz/dailymile/contributors","subscribers_url":"https://api.github.com/repos/dbriesz/dailymile/subscribers","subscription_url":"https://api.github.com/repos/dbriesz/dailymile/subscription","commits_url":"https://api.github.com/repos/dbriesz/dailymile/commits{/sha}","git_commits_url":"https://api.github.com/repos/dbriesz/dailymile/git/commits{/sha}","comments_url":"https://api.github.com/repos/dbriesz/dailymile/comments{/number}","issue_comment_url":"https://api.github.com/repos/dbriesz/dailymile/issues/comments{/number}","contents_url":"https://api.github.com/repos/dbriesz/dailymile/contents/{+path}","compare_url":"https://api.github.com/repos/dbriesz/dailymile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dbriesz/dailymile/merges","archive_url":"https://api.github.com/repos/dbriesz/dailymile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dbriesz/dailymile/downloads","issues_url":"https://api.github.com/repos/dbriesz/dailymile/issues{/number}","pulls_url":"https://api.github.com/repos/dbriesz/dailymile/pulls{/number}","milestones_url":"https://api.github.com/repos/dbriesz/dailymile/milestones{/number}","notifications_url":"https://api.github.com/repos/dbriesz/dailymile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dbriesz/dailymile/labels{/name}","releases_url":"https://api.github.com/repos/dbriesz/dailymile/releases{/id}","deployments_url":"https://api.github.com/repos/dbriesz/dailymile/deployments","created_at":"2018-01-16T17:04:40Z","updated_at":"2018-01-16T17:04:41Z","pushed_at":"2018-02-14T22:16:15Z","git_url":"git://github.com/dbriesz/dailymile.git","ssh_url":"git@github.com:dbriesz/dailymile.git","clone_url":"https://github.com/dbriesz/dailymile.git","svn_url":"https://github.com/dbriesz/dailymile","homepage":null,"size":2216,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"okkur:master","ref":"master","sha":"7d50d6c8ca85df2633c10caaea366d1f613a8336","user":{"login":"okkur","id":31181753,"avatar_url":"https://avatars1.githubusercontent.com/u/31181753?v=4","gravatar_id":"","url":"https://api.github.com/users/okkur","html_url":"https://github.com/okkur","followers_url":"https://api.github.com/users/okkur/followers","following_url":"https://api.github.com/users/okkur/following{/other_user}","gists_url":"https://api.github.com/users/okkur/gists{/gist_id}","starred_url":"https://api.github.com/users/okkur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okkur/subscriptions","organizations_url":"https://api.github.com/users/okkur/orgs","repos_url":"https://api.github.com/users/okkur/repos","events_url":"https://api.github.com/users/okkur/events{/privacy}","received_events_url":"https://api.github.com/users/okkur/received_events","type":"Organization","site_admin":false},"repo":{"id":101048879,"name":"dailymile","full_name":"okkur/dailymile","owner":{"login":"okkur","id":31181753,"avatar_url":"https://avatars1.githubusercontent.com/u/31181753?v=4","gravatar_id":"","url":"https://api.github.com/users/okkur","html_url":"https://github.com/okkur","followers_url":"https://api.github.com/users/okkur/followers","following_url":"https://api.github.com/users/okkur/following{/other_user}","gists_url":"https://api.github.com/users/okkur/gists{/gist_id}","starred_url":"https://api.github.com/users/okkur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okkur/subscriptions","organizations_url":"https://api.github.com/users/okkur/orgs","repos_url":"https://api.github.com/users/okkur/repos","events_url":"https://api.github.com/users/okkur/events{/privacy}","received_events_url":"https://api.github.com/users/okkur/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/okkur/dailymile","description":"Daily milestone (todo) generation for Gitlab.","fork":false,"url":"https://api.github.com/repos/okkur/dailymile","forks_url":"https://api.github.com/repos/okkur/dailymile/forks","keys_url":"https://api.github.com/repos/okkur/dailymile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okkur/dailymile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okkur/dailymile/teams","hooks_url":"https://api.github.com/repos/okkur/dailymile/hooks","issue_events_url":"https://api.github.com/repos/okkur/dailymile/issues/events{/number}","events_url":"https://api.github.com/repos/okkur/dailymile/events","assignees_url":"https://api.github.com/repos/okkur/dailymile/assignees{/user}","branches_url":"https://api.github.com/repos/okkur/dailymile/branches{/branch}","tags_url":"https://api.github.com/repos/okkur/dailymile/tags","blobs_url":"https://api.github.com/repos/okkur/dailymile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okkur/dailymile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okkur/dailymile/git/refs{/sha}","trees_url":"https://api.github.com/repos/okkur/dailymile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okkur/dailymile/statuses/{sha}","languages_url":"https://api.github.com/repos/okkur/dailymile/languages","stargazers_url":"https://api.github.com/repos/okkur/dailymile/stargazers","contributors_url":"https://api.github.com/repos/okkur/dailymile/contributors","subscribers_url":"https://api.github.com/repos/okkur/dailymile/subscribers","subscription_url":"https://api.github.com/repos/okkur/dailymile/subscription","commits_url":"https://api.github.com/repos/okkur/dailymile/commits{/sha}","git_commits_url":"https://api.github.com/repos/okkur/dailymile/git/commits{/sha}","comments_url":"https://api.github.com/repos/okkur/dailymile/comments{/number}","issue_comment_url":"https://api.github.com/repos/okkur/dailymile/issues/comments{/number}","contents_url":"https://api.github.com/repos/okkur/dailymile/contents/{+path}","compare_url":"https://api.github.com/repos/okkur/dailymile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okkur/dailymile/merges","archive_url":"https://api.github.com/repos/okkur/dailymile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okkur/dailymile/downloads","issues_url":"https://api.github.com/repos/okkur/dailymile/issues{/number}","pulls_url":"https://api.github.com/repos/okkur/dailymile/pulls{/number}","milestones_url":"https://api.github.com/repos/okkur/dailymile/milestones{/number}","notifications_url":"https://api.github.com/repos/okkur/dailymile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okkur/dailymile/labels{/name}","releases_url":"https://api.github.com/repos/okkur/dailymile/releases{/id}","deployments_url":"https://api.github.com/repos/okkur/dailymile/deployments","created_at":"2017-08-22T09:59:33Z","updated_at":"2017-08-25T21:50:07Z","pushed_at":"2018-02-21T16:47:32Z","git_url":"git://github.com/okkur/dailymile.git","ssh_url":"git@github.com:okkur/dailymile.git","clone_url":"https://github.com/okkur/dailymile.git","svn_url":"https://github.com/okkur/dailymile","homepage":null,"size":2215,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/okkur/dailymile/pulls/30"},"html":{"href":"https://github.com/okkur/dailymile/pull/30"},"issue":{"href":"https://api.github.com/repos/okkur/dailymile/issues/30"},"comments":{"href":"https://api.github.com/repos/okkur/dailymile/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/okkur/dailymile/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/okkur/dailymile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/okkur/dailymile/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/okkur/dailymile/statuses/13f8e735610997de6c5415bb633be4f5d65d80b1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"erbesharat"}}