{"action":"created","issue":{"url":"https://api.github.com/repos/codeclimate/test-reporter/issues/192","repository_url":"https://api.github.com/repos/codeclimate/test-reporter","labels_url":"https://api.github.com/repos/codeclimate/test-reporter/issues/192/labels{/name}","comments_url":"https://api.github.com/repos/codeclimate/test-reporter/issues/192/comments","events_url":"https://api.github.com/repos/codeclimate/test-reporter/issues/192/events","html_url":"https://github.com/codeclimate/test-reporter/issues/192","id":235960605,"number":192,"title":"Submitting repeated commit report should be idempotent","user":{"login":"oboxodo","id":8324,"avatar_url":"https://avatars2.githubusercontent.com/u/8324?v=4","gravatar_id":"","url":"https://api.github.com/users/oboxodo","html_url":"https://github.com/oboxodo","followers_url":"https://api.github.com/users/oboxodo/followers","following_url":"https://api.github.com/users/oboxodo/following{/other_user}","gists_url":"https://api.github.com/users/oboxodo/gists{/gist_id}","starred_url":"https://api.github.com/users/oboxodo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oboxodo/subscriptions","organizations_url":"https://api.github.com/users/oboxodo/orgs","repos_url":"https://api.github.com/users/oboxodo/repos","events_url":"https://api.github.com/users/oboxodo/events{/privacy}","received_events_url":"https://api.github.com/users/oboxodo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"wfleming","id":188402,"avatar_url":"https://avatars3.githubusercontent.com/u/188402?v=4","gravatar_id":"","url":"https://api.github.com/users/wfleming","html_url":"https://github.com/wfleming","followers_url":"https://api.github.com/users/wfleming/followers","following_url":"https://api.github.com/users/wfleming/following{/other_user}","gists_url":"https://api.github.com/users/wfleming/gists{/gist_id}","starred_url":"https://api.github.com/users/wfleming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfleming/subscriptions","organizations_url":"https://api.github.com/users/wfleming/orgs","repos_url":"https://api.github.com/users/wfleming/repos","events_url":"https://api.github.com/users/wfleming/events{/privacy}","received_events_url":"https://api.github.com/users/wfleming/received_events","type":"User","site_admin":false},"assignees":[{"login":"wfleming","id":188402,"avatar_url":"https://avatars3.githubusercontent.com/u/188402?v=4","gravatar_id":"","url":"https://api.github.com/users/wfleming","html_url":"https://github.com/wfleming","followers_url":"https://api.github.com/users/wfleming/followers","following_url":"https://api.github.com/users/wfleming/following{/other_user}","gists_url":"https://api.github.com/users/wfleming/gists{/gist_id}","starred_url":"https://api.github.com/users/wfleming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfleming/subscriptions","organizations_url":"https://api.github.com/users/wfleming/orgs","repos_url":"https://api.github.com/users/wfleming/repos","events_url":"https://api.github.com/users/wfleming/events{/privacy}","received_events_url":"https://api.github.com/users/wfleming/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2017-06-14T17:55:23Z","updated_at":"2017-12-05T18:21:40Z","closed_at":"2017-12-05T18:02:02Z","author_association":"NONE","body":"I'm using the scripts reported in #181 (which you incorporated in your [docs](https://docs.codeclimate.com/docs/setting-up-test-coverage#section-ci-examples)) with Solano CI. But I'm having a problem.\r\n\r\nSometimes the CI ends up running a build for the same commit. This could be either because we manually triggered a new build or because of a fast-forward merge or because of some other reason.\r\n\r\nBut the build will be considered failed because `cc-test-reporter` is returning an error when we attempt to upload the coverage report. This is the error:\r\n\r\n```\r\nError: response from https://api.codeclimate.com/v1/test_reports.\r\nHTTP 409: A test report for commit f4014287c1624ae09d9008a78bd6f343912b976d already exists\r\n```\r\n\r\nI understand your system might want to reject a repeated report... but I don't have a way to know from the CI environment if a report for this commit has already been uploaded to CodeClimate. I could save some file with the SHA as name in S3 after uploading and check for its existence before uploading, but... that's a nasty workaround.\r\n\r\nI actually think that the uploader should keep reporting the 409 code, but the exit status should be 0 (zero) and the command execution be considered success. The end goal is to upload a coverage report for that commit. If you already have it, then it's success anyway.\r\n\r\nThat said, I think you should also replace your previous report with the newer one. There's a chance your customers might've uploaded a report with some old simplecov settings, then regenerated using a new configuration and want to overwrite the already sent report for the same commit. But this is an optional new feature request.\r\n\r\nI think the important thing here is to make the report upload idempotent if you already have a report for the same commit. This is not an edge case. It's pretty normal to have more than one build per commit."},"comment":{"url":"https://api.github.com/repos/codeclimate/test-reporter/issues/comments/349394428","html_url":"https://github.com/codeclimate/test-reporter/issues/192#issuecomment-349394428","issue_url":"https://api.github.com/repos/codeclimate/test-reporter/issues/192","id":349394428,"user":{"login":"oboxodo","id":8324,"avatar_url":"https://avatars2.githubusercontent.com/u/8324?v=4","gravatar_id":"","url":"https://api.github.com/users/oboxodo","html_url":"https://github.com/oboxodo","followers_url":"https://api.github.com/users/oboxodo/followers","following_url":"https://api.github.com/users/oboxodo/following{/other_user}","gists_url":"https://api.github.com/users/oboxodo/gists{/gist_id}","starred_url":"https://api.github.com/users/oboxodo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oboxodo/subscriptions","organizations_url":"https://api.github.com/users/oboxodo/orgs","repos_url":"https://api.github.com/users/oboxodo/repos","events_url":"https://api.github.com/users/oboxodo/events{/privacy}","received_events_url":"https://api.github.com/users/oboxodo/received_events","type":"User","site_admin":false},"created_at":"2017-12-05T18:21:40Z","updated_at":"2017-12-05T18:21:40Z","author_association":"NONE","body":"Just FTR, https://github.com/codeclimate/test-reporter/pull/268 seems to be the PR with the code changes for this.\r\n\r\nThanks!"}}
{"actor":{"display_login":"oboxodo"}}