{"action":"created","comment":{"url":"https://api.github.com/repos/jimhester/covr/pulls/comments/26097747","id":26097747,"diff_hunk":"@@ -0,0 +1,190 @@\n+#' Run covr on a package and upload the result to codecov.io\n+#' @param path file path to the package\n+#' @param Codecov url (change for Enterprise)\n+#' @param ... additional arguments passed to \\code{\\link{package_coverage}}\n+#' @export\n+codecov <- function(path = \".\", base_url = 'https://codecov.io', ...) {\n+  \n+  # -------\n+  # Jenkins\n+  # -------\n+  if (Sys.getenv('JENKINS_URL')) {\n+    # https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project\n+    # path <- Sys.getenv(\"WORKSPACE\")\n+    codecov_url <- paste(base_url, \"/upload/v2?service=jenkins\", \n+                         \"&branch=\", Sys.getenv('GIT_BRANCH'), \n+                         \"&commit=\", Sys.getenv('GIT_COMMIT'),\n+                         \"&build=\", Sys.getenv('BUILD_NUMBER'),\n+                         \"&build_url=\", Sys.getenv('BUILD_URL'), sep=\"\")\n+\n+  # ---------\n+  # Travis CI\n+  # ---------\n+  } else if (Sys.getenv('CI') == \"true\" && Sys.getenv('TRAVIS') == \"true\") {\n+    # http://docs.travis-ci.com/user/ci-environment/#Environment-variables\n+    # path <- Sys.getenv('TRAVIS_BUILD_DIR')\n+    codecov_url <- paste(base_url, \"/upload/v2?service=travis-org\",\n+                         \"&branch=\", Sys.getenv('TRAVIS_BRANCH'),\n+                         \"&build=\", Sys.getenv('TRAVIS_JOB_NUMBER'),\n+                         \"&pull_request=\", ifelse(Sys.getenv('TRAVIS_PULL_REQUEST')!='false', Sys.getenv('TRAVIS_PULL_REQUEST'), ''),\n+                         \"&travis_job_id=\", Sys.getenv('TRAVIS_JOB_ID'),\n+                         \"&owner=\", strsplit(Sys.getenv('TRAVIS_REPO_SLUG'), '/')[0],\n+                         \"&repo=\", strsplit(Sys.getenv('TRAVIS_REPO_SLUG'), '/')[1],\n+                         \"&commit=\", Sys.getenv('TRAVIS_COMMIT'), sep=\"\")\n+  # --------\n+  # Codeship\n+  # --------\n+  } else if (Sys.getenv('CI') == \"true\" && Sys.getenv('CI_NAME') == 'codeship') {\n+    # https://www.codeship.io/documentation/continuous-integration/set-environment-variables/\n+    codecov_url <- paste(base_url, \"/upload/v2?service=codeship\",\n+                         \"&branch=\", Sys.getenv('CI_BRANCH'),\n+                         \"&build=\", Sys.getenv('CI_BUILD_NUMBER'),\n+                         \"&build_url=\", Sys.getenv('CI_BUILD_URL'),\n+                         \"&commit=\", Sys.getenv('CI_COMMIT_ID')), sep=\"\")","path":"R/codecov.R","position":43,"original_position":43,"commit_id":"7fb3d65565f5b135da390a545b45b49ca484be51","original_commit_id":"8a016081b1f86aeeca80a6df98125194d7d42fba","user":{"login":"daroczig","id":495736,"avatar_url":"https://avatars.githubusercontent.com/u/495736?v=3","gravatar_id":"","url":"https://api.github.com/users/daroczig","html_url":"https://github.com/daroczig","followers_url":"https://api.github.com/users/daroczig/followers","following_url":"https://api.github.com/users/daroczig/following{/other_user}","gists_url":"https://api.github.com/users/daroczig/gists{/gist_id}","starred_url":"https://api.github.com/users/daroczig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daroczig/subscriptions","organizations_url":"https://api.github.com/users/daroczig/orgs","repos_url":"https://api.github.com/users/daroczig/repos","events_url":"https://api.github.com/users/daroczig/events{/privacy}","received_events_url":"https://api.github.com/users/daroczig/received_events","type":"User","site_admin":false},"body":"There's an extra closing parenthesis before the `sep` -- and the same issue also occurs at a few other lines below.","created_at":"2015-03-10T04:06:11Z","updated_at":"2015-03-10T04:06:11Z","html_url":"https://github.com/jimhester/covr/pull/66#discussion_r26097747","pull_request_url":"https://api.github.com/repos/jimhester/covr/pulls/66","_links":{"self":{"href":"https://api.github.com/repos/jimhester/covr/pulls/comments/26097747"},"html":{"href":"https://github.com/jimhester/covr/pull/66#discussion_r26097747"},"pull_request":{"href":"https://api.github.com/repos/jimhester/covr/pulls/66"}}},"pull_request":{"url":"https://api.github.com/repos/jimhester/covr/pulls/66","id":30757624,"html_url":"https://github.com/jimhester/covr/pull/66","diff_url":"https://github.com/jimhester/covr/pull/66.diff","patch_url":"https://github.com/jimhester/covr/pull/66.patch","issue_url":"https://api.github.com/repos/jimhester/covr/issues/66","number":66,"state":"open","locked":false,"title":"Add support for codecov.io","user":{"login":"stevepeak","id":2041757,"avatar_url":"https://avatars.githubusercontent.com/u/2041757?v=3","gravatar_id":"","url":"https://api.github.com/users/stevepeak","html_url":"https://github.com/stevepeak","followers_url":"https://api.github.com/users/stevepeak/followers","following_url":"https://api.github.com/users/stevepeak/following{/other_user}","gists_url":"https://api.github.com/users/stevepeak/gists{/gist_id}","starred_url":"https://api.github.com/users/stevepeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevepeak/subscriptions","organizations_url":"https://api.github.com/users/stevepeak/orgs","repos_url":"https://api.github.com/users/stevepeak/repos","events_url":"https://api.github.com/users/stevepeak/events{/privacy}","received_events_url":"https://api.github.com/users/stevepeak/received_events","type":"User","site_admin":false},"body":"Uploading reports to [Codecov.io](https://codecov.io/)\r\n\r\nSupported `json` format:\r\n```json\r\n{\r\n  \"uploader\": \"R\",\r\n  \"files\": [\r\n    {\r\n      \"name\": \"string\",\r\n      \"coverage\": [null, 0, null, 1]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n> Branch coverage is supported via `\"1/2\"` for partial coverage or `\"2/2\"` for full branch coverage. This is optional if R can produce this data.\r\n\r\n\r\nMy first R lang experience. Help me fix any issues presented. Special thanks to @daroczig and @RomanTsegelskyi","created_at":"2015-03-09T12:52:27Z","updated_at":"2015-03-10T04:06:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7ae3123bec53d7055e68d3d6a748f4a77581dff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jimhester/covr/pulls/66/commits","review_comments_url":"https://api.github.com/repos/jimhester/covr/pulls/66/comments","review_comment_url":"https://api.github.com/repos/jimhester/covr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jimhester/covr/issues/66/comments","statuses_url":"https://api.github.com/repos/jimhester/covr/statuses/7fb3d65565f5b135da390a545b45b49ca484be51","head":{"label":"stevepeak:master","ref":"master","sha":"7fb3d65565f5b135da390a545b45b49ca484be51","user":{"login":"stevepeak","id":2041757,"avatar_url":"https://avatars.githubusercontent.com/u/2041757?v=3","gravatar_id":"","url":"https://api.github.com/users/stevepeak","html_url":"https://github.com/stevepeak","followers_url":"https://api.github.com/users/stevepeak/followers","following_url":"https://api.github.com/users/stevepeak/following{/other_user}","gists_url":"https://api.github.com/users/stevepeak/gists{/gist_id}","starred_url":"https://api.github.com/users/stevepeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevepeak/subscriptions","organizations_url":"https://api.github.com/users/stevepeak/orgs","repos_url":"https://api.github.com/users/stevepeak/repos","events_url":"https://api.github.com/users/stevepeak/events{/privacy}","received_events_url":"https://api.github.com/users/stevepeak/received_events","type":"User","site_admin":false},"repo":{"id":31896087,"name":"covr","full_name":"stevepeak/covr","owner":{"login":"stevepeak","id":2041757,"avatar_url":"https://avatars.githubusercontent.com/u/2041757?v=3","gravatar_id":"","url":"https://api.github.com/users/stevepeak","html_url":"https://github.com/stevepeak","followers_url":"https://api.github.com/users/stevepeak/followers","following_url":"https://api.github.com/users/stevepeak/following{/other_user}","gists_url":"https://api.github.com/users/stevepeak/gists{/gist_id}","starred_url":"https://api.github.com/users/stevepeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevepeak/subscriptions","organizations_url":"https://api.github.com/users/stevepeak/orgs","repos_url":"https://api.github.com/users/stevepeak/repos","events_url":"https://api.github.com/users/stevepeak/events{/privacy}","received_events_url":"https://api.github.com/users/stevepeak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevepeak/covr","description":"Test coverage reports for R","fork":true,"url":"https://api.github.com/repos/stevepeak/covr","forks_url":"https://api.github.com/repos/stevepeak/covr/forks","keys_url":"https://api.github.com/repos/stevepeak/covr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevepeak/covr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevepeak/covr/teams","hooks_url":"https://api.github.com/repos/stevepeak/covr/hooks","issue_events_url":"https://api.github.com/repos/stevepeak/covr/issues/events{/number}","events_url":"https://api.github.com/repos/stevepeak/covr/events","assignees_url":"https://api.github.com/repos/stevepeak/covr/assignees{/user}","branches_url":"https://api.github.com/repos/stevepeak/covr/branches{/branch}","tags_url":"https://api.github.com/repos/stevepeak/covr/tags","blobs_url":"https://api.github.com/repos/stevepeak/covr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevepeak/covr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevepeak/covr/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevepeak/covr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevepeak/covr/statuses/{sha}","languages_url":"https://api.github.com/repos/stevepeak/covr/languages","stargazers_url":"https://api.github.com/repos/stevepeak/covr/stargazers","contributors_url":"https://api.github.com/repos/stevepeak/covr/contributors","subscribers_url":"https://api.github.com/repos/stevepeak/covr/subscribers","subscription_url":"https://api.github.com/repos/stevepeak/covr/subscription","commits_url":"https://api.github.com/repos/stevepeak/covr/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevepeak/covr/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevepeak/covr/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevepeak/covr/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevepeak/covr/contents/{+path}","compare_url":"https://api.github.com/repos/stevepeak/covr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevepeak/covr/merges","archive_url":"https://api.github.com/repos/stevepeak/covr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevepeak/covr/downloads","issues_url":"https://api.github.com/repos/stevepeak/covr/issues{/number}","pulls_url":"https://api.github.com/repos/stevepeak/covr/pulls{/number}","milestones_url":"https://api.github.com/repos/stevepeak/covr/milestones{/number}","notifications_url":"https://api.github.com/repos/stevepeak/covr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevepeak/covr/labels{/name}","releases_url":"https://api.github.com/repos/stevepeak/covr/releases{/id}","created_at":"2015-03-09T12:03:02Z","updated_at":"2015-03-10T04:03:24Z","pushed_at":"2015-03-10T04:03:23Z","git_url":"git://github.com/stevepeak/covr.git","ssh_url":"git@github.com:stevepeak/covr.git","clone_url":"https://github.com/stevepeak/covr.git","svn_url":"https://github.com/stevepeak/covr","homepage":"","size":1115,"stargazers_count":0,"watchers_count":0,"language":"R","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":"jimhester:master","ref":"master","sha":"3ff7e6faa7ba566ff2c2d88fb17224c7a2c8748c","user":{"login":"jimhester","id":205275,"avatar_url":"https://avatars.githubusercontent.com/u/205275?v=3","gravatar_id":"","url":"https://api.github.com/users/jimhester","html_url":"https://github.com/jimhester","followers_url":"https://api.github.com/users/jimhester/followers","following_url":"https://api.github.com/users/jimhester/following{/other_user}","gists_url":"https://api.github.com/users/jimhester/gists{/gist_id}","starred_url":"https://api.github.com/users/jimhester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimhester/subscriptions","organizations_url":"https://api.github.com/users/jimhester/orgs","repos_url":"https://api.github.com/users/jimhester/repos","events_url":"https://api.github.com/users/jimhester/events{/privacy}","received_events_url":"https://api.github.com/users/jimhester/received_events","type":"User","site_admin":false},"repo":{"id":28287105,"name":"covr","full_name":"jimhester/covr","owner":{"login":"jimhester","id":205275,"avatar_url":"https://avatars.githubusercontent.com/u/205275?v=3","gravatar_id":"","url":"https://api.github.com/users/jimhester","html_url":"https://github.com/jimhester","followers_url":"https://api.github.com/users/jimhester/followers","following_url":"https://api.github.com/users/jimhester/following{/other_user}","gists_url":"https://api.github.com/users/jimhester/gists{/gist_id}","starred_url":"https://api.github.com/users/jimhester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimhester/subscriptions","organizations_url":"https://api.github.com/users/jimhester/orgs","repos_url":"https://api.github.com/users/jimhester/repos","events_url":"https://api.github.com/users/jimhester/events{/privacy}","received_events_url":"https://api.github.com/users/jimhester/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jimhester/covr","description":"Test coverage reports for R","fork":false,"url":"https://api.github.com/repos/jimhester/covr","forks_url":"https://api.github.com/repos/jimhester/covr/forks","keys_url":"https://api.github.com/repos/jimhester/covr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jimhester/covr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jimhester/covr/teams","hooks_url":"https://api.github.com/repos/jimhester/covr/hooks","issue_events_url":"https://api.github.com/repos/jimhester/covr/issues/events{/number}","events_url":"https://api.github.com/repos/jimhester/covr/events","assignees_url":"https://api.github.com/repos/jimhester/covr/assignees{/user}","branches_url":"https://api.github.com/repos/jimhester/covr/branches{/branch}","tags_url":"https://api.github.com/repos/jimhester/covr/tags","blobs_url":"https://api.github.com/repos/jimhester/covr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jimhester/covr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jimhester/covr/git/refs{/sha}","trees_url":"https://api.github.com/repos/jimhester/covr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jimhester/covr/statuses/{sha}","languages_url":"https://api.github.com/repos/jimhester/covr/languages","stargazers_url":"https://api.github.com/repos/jimhester/covr/stargazers","contributors_url":"https://api.github.com/repos/jimhester/covr/contributors","subscribers_url":"https://api.github.com/repos/jimhester/covr/subscribers","subscription_url":"https://api.github.com/repos/jimhester/covr/subscription","commits_url":"https://api.github.com/repos/jimhester/covr/commits{/sha}","git_commits_url":"https://api.github.com/repos/jimhester/covr/git/commits{/sha}","comments_url":"https://api.github.com/repos/jimhester/covr/comments{/number}","issue_comment_url":"https://api.github.com/repos/jimhester/covr/issues/comments{/number}","contents_url":"https://api.github.com/repos/jimhester/covr/contents/{+path}","compare_url":"https://api.github.com/repos/jimhester/covr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jimhester/covr/merges","archive_url":"https://api.github.com/repos/jimhester/covr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jimhester/covr/downloads","issues_url":"https://api.github.com/repos/jimhester/covr/issues{/number}","pulls_url":"https://api.github.com/repos/jimhester/covr/pulls{/number}","milestones_url":"https://api.github.com/repos/jimhester/covr/milestones{/number}","notifications_url":"https://api.github.com/repos/jimhester/covr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jimhester/covr/labels{/name}","releases_url":"https://api.github.com/repos/jimhester/covr/releases{/id}","created_at":"2014-12-21T03:26:04Z","updated_at":"2015-03-09T15:22:32Z","pushed_at":"2015-03-09T15:22:32Z","git_url":"git://github.com/jimhester/covr.git","ssh_url":"git@github.com:jimhester/covr.git","clone_url":"https://github.com/jimhester/covr.git","svn_url":"https://github.com/jimhester/covr","homepage":"","size":1115,"stargazers_count":47,"watchers_count":47,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":19,"forks":12,"open_issues":19,"watchers":47,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jimhester/covr/pulls/66"},"html":{"href":"https://github.com/jimhester/covr/pull/66"},"issue":{"href":"https://api.github.com/repos/jimhester/covr/issues/66"},"comments":{"href":"https://api.github.com/repos/jimhester/covr/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/jimhester/covr/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/jimhester/covr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jimhester/covr/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/jimhester/covr/statuses/7fb3d65565f5b135da390a545b45b49ca484be51"}}}}